linux无法加载符号,linux - 尽管存在符号,但GDB不会加载调试符号 - 堆栈内存溢出...

为什么会发生这种情况,如何加载调试符号?

这是最有可能发生,因为事实上库没有调试符号。

file binary

... not stripped

上面的输出并不表明二进制已调试符号,只知道它有一个符号表。 这样: objdump -syms 。

要真正看到调试符号,请执行以下操作: readelf -wi binary (我预计您不会看到任何符号)。

如果实际上存在调试符号,则应该看到以下内容:

$ readelf -wi ./a.out

Contents of the .debug_info section:

Compilation Unit @ offset 0x0:

Length: 0x4e (32-bit)

Version: 4

Abbrev Offset: 0x0

Pointer Size: 8

<0>: Abbrev Number: 1 (DW_TAG_compile_unit)

DW_AT_producer : (indirect string, offset: 0x5): GNU C11 7.3.0 -mtune=generic -march=x86-64 -g

<10> DW_AT_language : 12 (ANSI C99)

<11> DW_AT_name : t.c

<15> DW_AT_comp_dir : (indirect string, offset: 0x0): /tmp

<19> DW_AT_low_pc : 0x5fa

<21> DW_AT_high_pc : 0xb

<29> DW_AT_stmt_list : 0x0

<1><2d>: Abbrev Number: 2 (DW_TAG_subprogram)

<2e> DW_AT_external : 1

<2e> DW_AT_name : (indirect string, offset: 0x33): main

<32> DW_AT_decl_file : 1

<33> DW_AT_decl_line : 1

<34> DW_AT_type : <0x4a>

<38> DW_AT_low_pc : 0x5fa

<40> DW_AT_high_pc : 0xb

<48> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa)

<4a> DW_AT_GNU_all_call_sites: 1

<1><4a>: Abbrev Number: 3 (DW_TAG_base_type)

<4b> DW_AT_byte_size : 4

<4c> DW_AT_encoding : 5 (signed)

<4d> DW_AT_name : int

<1><51>: Abbrev Number: 0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值