如何在GDB中调试libgcc源代码? Ubuntu 14.04.1

时间:2014-10-29 15:46:21

标签: c++ c linux gcc gdb

我想在Ubuntu 14.04.1上的源代码级别的GDB中调试libgcc_s.so.1。所以我下载了libgcc1-dbg并获得了gcc的来源。

在GDB中,我使用directory来指定gcc源目录。但是当我GDB遇到一些问题,并且在libgcc_s.so.1中中断时,我无法获得源代码。

Reading symbols from /home/love/pri...(no debugging symbols found)...done.

(gdb) directory ~/source/gcc-4.9/

Source directories searched: /home/lovelydream/source/gcc-4.9:$cdir:$cwd

(gdb) c

The program is not being run.

(gdb) run

Starting program: /home/lovelydream/prison

warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000

> 

Program received signal SIGINT, Interrupt.

0x00007ffff75e6350 in __read_nocancel () at ../sysdeps/unix/syscall-template.S:81

81  ../sysdeps/unix/syscall-template.S: 没有那个文件或目录.

(gdb) b _Unwind_Find_FDE

Breakpoint 1 at 0x7ffff78d20c0

(gdb) c

Continuing.

x

Breakpoint 1, 0x00007ffff78d20c0 in _Unwind_Find_FDE ()

   from /lib/x86_64-linux-gnu/libgcc_s.so.1

(gdb) info source

Current source file is ../sysdeps/unix/syscall-template.S

Compilation directory is /build/buildd/eglibc-2.19/io

Source language is asm.

Compiled with DWARF 2 debugging format.

Does not include preprocessor macro info.

(gdb) ni

0x00007ffff78d20c2 in _Unwind_Find_FDE () from /lib/x86_64-linux-gnu/libgcc_s.so.1

(gdb) directory ~/source/gcc-4.9/

Source directories searched: /home/lovelydream/source/gcc-4.9:$cdir:$cwd

(gdb) ni

0x00007ffff78d20c4 in _Unwind_Find_FDE () from /lib/x86_64-linux-gnu/libgcc_s.so.1

(gdb) list

76  ../sysdeps/unix/syscall-template.S: 没有那个文件或目录.

(gdb) list

76  in ../sysdeps/unix/syscall-template.S

(gdb) list

76  in ../sysdeps/unix/syscall-template.S

(gdb) info source

0 个答案:

没有答案