Afshin
Afshin

Reputation: 439

Manipulating Debug Info

Does anyone know how to manipulate debug info generated by GCC. Specifically, I am searching for the size of the local variable "A" in debug info, Can I derive it from there?

I can not even see my local variables there.

I could not find much information online on how to manipulate the data generated by objdump in sections .debug_info and other relevant debug sections. objdump shows some assembly code, which I do not know how it is related to the main binary.

Any link for more info on this topic is really appreciated. I know how to derive the debug info, but I do not understand the data that is there.

Upvotes: 2

Views: 139

Answers (1)

Igor Skochinsky
Igor Skochinsky

Reputation: 25268

objdump -W or readelf -w display the DWARF debugging info from the file, if present. The output may look somewhat scary at the start, but the info you need will be there. It might be helpful to check the DWARF spec for unfamiliar terms in the listing.

If you need to extract it programmatically, have a look at Libdwarf.

Upvotes: 3

Related Questions