如何在Linux中使用addr2line命令 [英] How to use addr2line command in linux

查看:256
本文介绍了如何在Linux中使用addr2line命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用在Unix中addr2line命令,但每次它给输出作为??相同:0。我给命令,如 addr2line -e a.out的0x4005BDC 。在运行与的valgrind 工具来查找内存泄漏这a.out可执行文件我得到这个地址。我还编了源$ C ​​$ c。与 -g 选项。

I am trying to use addr2line command in Unix but everytime it is giving the same output as ??:0. I am giving command as addr2line -e a.out 0x4005BDC . I got this address while running this a.out executable with valgrind tool to find the memory leakage. I also compiled the source code with -g option.

推荐答案

您也可以使用addr2line的GDB,而不是检查内存地址。加载的可执行文件中GDB并打印其存储在地址符号的名称。 16检查符号表

You can also use gdb instead of addr2line to examine memory address. Load executable file in gdb and print the name of a symbol which is stored at the address. 16 Examining the Symbol Table.

(gdb) info symbol 0x4005BDC 

这篇关于如何在Linux中使用addr2line命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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