oracle / opengrok

OpenGrok is a fast and usable source code search and cross reference engine, written in Java
http://oracle.github.io/opengrok/
Other
4.33k stars 746 forks source link

Feature request: Support assembly #930

Open claunia opened 9 years ago

claunia commented 9 years ago

Add support for major assembly languages: 6502, 8080, Z80, 8086, IA-32, x86-64, PowerPC, 68000, MIPS, ARM, Sparc.

tarzanek commented 9 years ago

this would be very easy to do ... just write lex grammar parsers for symbols and xrefs ... see recent pushes for haskell, or older for scala/python/... ctags even support this out of box!

tarzanek commented 9 years ago

https://github.com/OpenGrok/OpenGrok/blob/master/doc/ctags.config has some enhancement we use in Solaris dev to recognize asm functions ...

claunia commented 9 years ago

It surprises me you use OpenGrok in Solaris development but have not implemented at least a SPARC and/or x86 support.

tarzanek commented 9 years ago

generic full search is already powerful I will have a deeper look how we handle asm but above ctag file is probably good enough for people but I agree it could be better!

vladak commented 9 years ago

Currently assembly files are handled in C analyzer, according to suffix (e.g. *.s) in CAnalyzerFactory.java.

tarzanek commented 9 years ago

I got a patch for this from Greg, so I will try to push this soon ...

vladak commented 9 years ago

The major question is what exactly is wanted, especially w.r.t. support for different architectures. I'd assume one would like to have at least:

On the other hand, some functionality of C analyzer should be preserved, e.g. assembly files often contain includes. Currently one can click on the include file name to trigger file based search.

As for the labels, the analyzer would have to understand various notations, e.g. stuff like:

jne 4f;

is forward jump on x86 - to label defined after this instruction (similarly '4b' would be backward jump). Other platforms can have different jump/branch instructions and different label definitions. How would we treat the labels anyway to have them searchable ? As symbols ? (do we allow single letter symbols currently ?)

vladak commented 9 years ago

What kind of patch exactly ? What architectures does it support ?

vladak commented 9 years ago

Another notable thing is that ctags-5.8 generates tags for labels etc. for files with "asm", "ASM", "s", "S" etc. suffixes, in its simplest form it should be just a matter of consuming the tags.

tarzanek commented 9 years ago

that's why I say it should be doable ;)

vladak commented 4 years ago

@tarzanek Patch from Greg Onufer (@gco) I guess. Is it (the patch) still floating around somewhere ?