I am trying to create a DWARFProgram for a Ghidra program. I would like to extract the function debug symbols. I get an error when constructing the DWARFProgram.
The constructor prints the following and then throws a NullPointerException:
Elf symbol table section .dynsym linked to string table section .dynstr
Elf symbol table section .symtab linked to string table section .strtab
Elf relocation table section .rel.dyn linked to symbol table section .dynsym affecting PT_LOAD
Reading DWARF debug string table
My code (using Jython):
monitor = ConsoleTaskMonitor()
program = ghidraProject.openProgram('/', programName, False)
binfile = File(programDir + programName)
options = DWARFImportOptions()
sectionProvider = ElfSectionProvider(binfile)
dwarfProg = DWARFProgram(program, options, monitor, sectionProvider)