ghidra
ghidra copied to clipboard
DWARF Typedefs Handled Confusingly
Describe the bug
C allows typedefs such as typedef struct foo * foo; because struct foo and foo are not the same type. When Ghidra imports such a typedef, it results in this non-sensical type: typedef list list *
To Reproduce Steps to reproduce the behavior:
- Load attached executable
- Look at
listin data type manager
Expected behavior
I expected the typedefee to have a different name, maybe struct list.
Screenshots
Attachments exe.zip
Environment (please complete the following information):
- OS: Ubuntu 22.04.04
- Java Version: OpenJDK Runtime Environment Temurin-17.0.11+9 (build 17.0.11+9)
- Ghidra Version: 11.0.3
- Ghidra Origin: official distro
Additional context
I can see how it could improve things. This won't be a high priority, but I'll talk it over with the team.
If you provide some guidance on where/how to change the behavior, I can also take a stab at it.
The issue stems from a bug in the datatype resolution logic that did not properly handle the duplicate name between typedef and associated struct. Fix is in the works.