ghidra icon indicating copy to clipboard operation
ghidra copied to clipboard

DWARF Typedefs Handled Confusingly

Open edmcman opened this issue 1 year ago • 2 comments

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:

  1. Load attached executable
  2. Look at list in data type manager

Expected behavior I expected the typedefee to have a different name, maybe struct list.

Screenshots image

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

edmcman avatar May 09 '24 21:05 edmcman

I can see how it could improve things. This won't be a high priority, but I'll talk it over with the team.

dev747368 avatar May 09 '24 23:05 dev747368

If you provide some guidance on where/how to change the behavior, I can also take a stab at it.

edmcman avatar May 10 '24 12:05 edmcman

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.

ghidra1 avatar Jul 05 '24 19:07 ghidra1