A Ghidra extension that imports the STABS debug info emitted by gcc 2.95.3 (C and g++ 2.95 C++) from ELF binaries.
It imports:
- structs, unions, enums and typedefs (under
/STABS) - C++ classes: members, methods, base classes and nested classes
- function names, namespaces and signatures (gnu-v2 demangled)
- parameters, stack locals and register locals
- global and static data
It runs as the STABS analyzer in Auto Analysis and enables itself for ELF programs that have .stab/.stabstr sections.
Requires Java 21 and Ghidra 12.1.4.
export GHIDRA_INSTALL_DIR=/path/to/ghidra_12.1.4_PUBLIC
./gradlew buildExtensionThe zip goes to dist/. Install it with File → Install Extensions and restart Ghidra.
./gradlew testTo also parse real binaries, point stabs.testBinaries at a directory of ELF files with STABS (-Pstabs.testBinaries=<dir>, the STABS_TEST_BINARIES environment variable, or local.properties). Every file in it that has .stab/.stabstr sections must parse without issues.
- Vtable layouts and line numbers aren't imported yet.
- Classes that g++ passes by invisible reference are detected heuristically.
- Disable Ghidra 12.1.4's GCC Exception Handlers analyzer on relocated
.sofiles: it mislocates.eh_frameentries in relocated images (seedocs/ghidra-eh-frame-image-base.md).