cesena / ghidra2dwarf

🐉 Export ghidra decompiled code to dwarf sections inside ELF binary
MIT License
179 stars 17 forks source link

Crash: AttributeError: 'NoneType' object has no attribute 'getAddress' #1

Closed io12 closed 3 years ago

io12 commented 3 years ago
Traceback (most recent call last):
  File "/tmp/dump/ghidra2dwarf/src/ghidra2dwarf.py", line 426, in <module>
    add_debug_info()
  File "/tmp/dump/ghidra2dwarf/src/ghidra2dwarf.py", line 87, in add_debug_info
    add_function(cu, f, file_index)
  File "/tmp/dump/ghidra2dwarf/src/ghidra2dwarf.py", line 283, in add_function
    add_decompiler_func_info(cu, die, func, file_index, linecount)
  File "/tmp/dump/ghidra2dwarf/src/ghidra2dwarf.py", line 147, in add_decompiler_func_info
    add_variable(cu, func_die, name, datatype, addr, storage)
  File "/tmp/dump/ghidra2dwarf/src/ghidra2dwarf.py", line 214, in add_variable
    varnode_addr = varnode.getAddress()
AttributeError: 'NoneType' object has no attribute 'getAddress'

I can't provide the Ghidra project that causes this (sorry), but it looks like it's possible for there to not be any varnodes.