Open claunia opened 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!
https://github.com/OpenGrok/OpenGrok/blob/master/doc/ctags.config has some enhancement we use in Solaris dev to recognize asm functions ...
It surprises me you use OpenGrok in Solaris development but have not implemented at least a SPARC and/or x86 support.
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!
Currently assembly files are handled in C analyzer, according to suffix (e.g. *.s
) in CAnalyzerFactory.java
.
I got a patch for this from Greg, so I will try to push this soon ...
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 ?)
What kind of patch exactly ? What architectures does it support ?
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.
that's why I say it should be doable ;)
@tarzanek Patch from Greg Onufer (@gco) I guess. Is it (the patch) still floating around somewhere ?
Add support for major assembly languages: 6502, 8080, Z80, 8086, IA-32, x86-64, PowerPC, 68000, MIPS, ARM, Sparc.