在工作中,我遇到了以下问题:
我需要解析GDB调试信息。
单独的调试信息文件是一个二进制文件,所以我不能在不知道格式的情况下阅读它。
所以,这里有一个问题:
是否有任何现成的解析器用于GDB信息,或者至少有文档描述它?
解决方案
是否有任何适用于GDB信息的解析器?
没有这样的事情。有各种调试信息格式( DWARF , STABS 等)和这些调试格式的多个使用者(GDB是如果你在Linux上,默认的调试格式是 DWARF ,记录在 here。
我需要解析。 .. debug info
根据您的实际需要, readelf -w 或已经提到 libdwarf 可能是合适的。或者你可以从头开始编写自己的解析器,尽管它不可能是最佳的解决方案。
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?
解决方案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.
更多推荐
GDB调试信息解析器/描述
发布评论