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

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

问题描述

我试图在Unix中使用addr2line命令,但是每次它给出与??:0相同的输出.我给命令为addr2line -e a.out 0x4005BDC.我使用valgrind工具运行此a.out可执行文件时发现了此地址,以查找内存泄漏.我还使用-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.

推荐答案

您也可以使用gdb代替addr2line来检查内存地址.将可执行文件加载到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天全站免登陆