GDB调试信息解析器/描述

编程入门 行业动态 更新时间:2024-10-11 23:20:01
本文介绍了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调试信息解析器/描述

本文发布于:2023-11-06 08:28:37,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:信息   GDB

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!