Currently I am using eclipse to browse cross compiled C source code. I don't have back end cross compiler to actually compile and build the code. But eclipse create source browse tree. I want to have similar setup in Emacs so that I can browse source code even though it may build or not.
2 Answers
I could think of two solutions as of now, Speedbar mode - A separate frame pop-ups with the list of files/folders related to the current project. More Info (https://www.emacswiki.org/emacs/SpeedBar). Comes bundled with emacs. No extra tools needed.
GGtags mode - Generate tags for the project in the root directory, and navigate the source using M-., M-* etc. More Info (https://github.com/leoliu/ggtags). Needs to have gnu global/ctags installed but it is easy to setup.
For C developers, I suggest ctags.
The problem of GNU Gloal is that it treats the function declaration as reference. That's awkward if you want to check the declaration of function ONLY. C++ code does not have this issue because function is always inside class/struct.
You can use https://github.com/redguardtoo/counsel-etags which provides everything you need for code navigation using ctags/etags.
irony
(withclang
backend) doesn't require code to compile, or has some reasonable tolerance to the point it's useful during work. Have you tried it?