我已将使用的 GCC 版本从4.2.1更新到8.1.0。(这是我唯一改变的东西)
问题是,在我这样做之后,调试符号就消失了。
我只使用“ -g ”选项运行 GDB。
使用 gcc v8.1.0,运行 gdb 时没有调试符号:
(gdb) br test
Breakpoint 1 at 0xa5fa053
(gdb) bt
0 0x09fa2303 in test_func()
1 0x097cecc7 in test_func_2 ()
2 0x097cf314 in test_func_3 ()
v4.2.1 是这样的:
(gdb) br test_func
Breakpoint 1 at 0xaa2fc7a: file /projects/gabriela/test/test.c, line 3
(gdb) r
Breakpoint 1, test_func(unit=0, flags=0, test1=0xffff95e0, test2=0xffff9b9c) at /projects/gabriela/test/test.c, line 3
(gdb) bt
0 test_func (unit=0, flags=0, test1=0xffff95e0, test2=0xffff9b9c) at /projects/gabriela/test/test.c, line 3
1 0x099ad349 in test_func_2 (unit=0, flags=0, test1=0x0, test2=0x0) at /projects/gabriela/test/test.c:10
2 0x099ada04 in test_func_3 (unit=0, flags=0, test1=0x0) at /projects/gabriela/test/test.c:20
如何使 gcc8.1.0 的 dbg符号像gcc4.2.1?