I want to debug libgcc_s.so.1in GDB at the source level in Ubuntu 14.04.1. So I downloaded libgcc1-dbgand got the source gcc.
In GDB, I use directoryto specify the source directory gcc. But when I have a problem with GDB and break in libgcc_s.so.1, I can not get the source code.
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
source
share