ELF 核心文件格式 [英] ELF core file format

查看:25
本文介绍了ELF 核心文件格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

没有深入挖掘 GDB 源代码,我在哪里可以找到有关用于创建核心文件的格式的文档?

Short of digging through GDB source, where can I find documentation about the format used to create core files?

ELF 规范使核心文件格式保持开放,所以我想这应该是一部分GDB 规范!遗憾的是,我没有从 GNU 的 gdb 文档中找到这方面的任何帮助.

The ELF specification leaves the core file format open, so I guess this should be part of the GDB specifications! Sadly, I did not find any help in this regard from GNU's gdb documentation.

这就是我想要做的事情:将虚拟地址映射到包含正在运行的进程的可执行文件/库中的函数名称.为此,我首先想从核心文件中找出从虚拟地址空间到可执行文件/库名称的映射,然后挖掘相关文件以获取符号信息.

Here's what I am trying to do: Map virtual addresses to function names in executable/libraries that comprised the running process. To do that, I would first like to figure out, from the core file, the map from virtual address space to the name of the executable file/libraries, and then dig into the relevant file to get the symbolic information.

现在readelf -a core"告诉我核心文件中几乎所有的段都是load"类型的——我猜这些是所有参与的 .text 和 .bss/.data 段文件,加上一个堆栈段.除了这些加载段之外,还有一个音符段,但似乎不包含地图.那么一个段对应哪个文件的信息,是如何存储在核心文件中的呢?这些加载"段是否以特定方式包含文件信息?

Now 'readelf -a core' tells me that nearly all the segments in the core file are of the type 'load' -- I'd guess these are the .text and .bss/.data segments from all the participating files, plus a stack segment. Barring these load segments, there is one note segment, but that does not seem to contain the map. So how is the information about which file a segment corresponds to, stored in the core file? Are those 'load' segments format in a particular way to include the file information?

推荐答案

与其说是 gdb 不如说是 gdb 使用的 bfd 库,binutils

Not so much gdb as the bfd library used by gdb, binutils, etc.

这篇关于ELF 核心文件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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