GDB调试信息解析器/描述 [英] GDB debug info parser/description

查看:173
本文介绍了GDB调试信息解析器/描述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在工作中,我遇到了以下问题:

我需要解析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调试信息解析器/描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆