GDB debug info parser/description

冷暖自知 提交于 2019-12-13 04:06:41

问题


During the work I faced with the following problem:

I need to parse GDB debug info.

Separate debug info file is a binary, so I can not read it without knowing a format.

So, here is the question:

Is there any ready parser for GDB info, or at least document describing it?


回答1:


Is there any ready parser for GDB info

There is no such thing. There are various debug info formats (DWARF, STABS, etc.) and multiple consumers of these debug formats (GDB is one such consumer).

If you are on Linux, the default debug format is DWARF, documented here.

I need to parse ... debug info

Depending on your actual needs, readelf -w or already mentioned libdwarf may be appropriate. Or you could write your own parser from scratch, though it's unlikely to be the optimal solution.




回答2:


You should probably take a look at libdwarf. See http://sourceforge.net/projects/libdwarf/ or http://wiki.dwarfstd.org/index.php?title=Libdwarf_And_Dwarfdump



来源:https://stackoverflow.com/questions/16320864/gdb-debug-info-parser-description

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!