|Re: Differences between "ELF Parser" and "GNU ELF Parser"? [message #1752739 is a reply to message #152561]
||Thu, 26 January 2017 18:12
| Alex Freidin
Registered: July 2009
Unfortunately, the differences between these binary parsers are not described in CDT Help. Googling brought me to this old thread. Many tutorials for configuring Eclipse CDT suggest to switch to "GNU ELF parser" without actually explaining the differences with "ELF Parser". Here is what I found:|
- "GNU ELF Parser" sits on top of the basic "ELF Parser" and uses several utilities from binutils package to get additional info from ELF binary: objdump, c++filt and addr2line.
- When "GNU ELF Parser" is enabled, double-clicking on a binary in 'Project Explorer' view under [Project] > Binaries will run 'objdump' and open a read-only editor with objdump output including ELF information and disassembly. Objdump is called with these default switches: -C -x -S.
As of Eclipse Neon, there is no UI to configure objdump path and switches, but the underlying infrastructure provides this capability for tool vendors defining their own binary parser.
- When compiling C++ project with debug info, the basic "ELF Parser" gets demangled function names from the debug info. But, when compiling without debug info, it does not demangle function names. That's where 'c++filt' in "GNU ELF Parser" comes into play.
When expanding the binary compiled in "Release" configuration in 'Project Explorer' view, the function names appear mangled when "ELF Parser" is enabled. But, with "GNU ELF Parser" the names appear demangled as in the source code.
- "GNU ELF Parser" calls 'addr2line' to get line information for functions and variables. This only works if the executable has debug info.
I haven't found any visible difference in the UI representation and whether this info provides an extra functionality beyond the basic "ELF Parser". E.g. "ELF Parser" has no issue showing all function names and clicking a function in the binary opens it in the editor and marks its boundaries. I would be happy to get more info on this.
In addition, I think this utility is also used by Linux Tools project.
(Size: 9.10KB, Downloaded 1237 times)
Powered by FUDForum
. Page generated in 0.02241 seconds