[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Purpose



I'm confused about the purpose of the libc6-dbg package if I every
time I try to step into a libc function I get an error about missing
source files.

What is this package good for if not stepping into libc code?


============ BEGIN PASTE ================
rutski@titan:~/test$ cat main.c
#include <stdlib.h>
#include <string.h>

int
main(int argc, char** argv)
{
    int x;
    void* p = malloc(10);
    p = realloc(p, 20);
    x = strcmp(argv[0], argv[0]);
}
rutski@titan:~/test$ gcc -ggdb -O0 main.c
rutski@titan:~/test$ LD_LIBRARY_PATH=/usr/lib/debug ldd a.out
        linux-gate.so.1 =>  (0xb7f2d000)
        libc.so.6 => /usr/lib/debug/libc.so.6 (0xb7ded000)
        /lib/ld-linux.so.2 (0xb7f2e000)
rutski@titan:~/test$ LD_LIBRARY_PATH=/usr/lib/debug gdb -q a.out
(gdb) break main
Breakpoint 1 at 0x80483e5: file main.c, line 8.
(gdb) run
Starting program: /home/rutski/test/a.out

Breakpoint 1, main () at main.c:8
8           void* p = malloc(10);
(gdb) s
*__GI___libc_malloc (bytes=10) at malloc.c:3546
3546    malloc.c: No such file or directory.
        in malloc.c
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/rutski/test/a.out

Breakpoint 1, main () at main.c:8
8           void* p = malloc(10);
(gdb) n
9           p = realloc(p, 20);
(gdb) s
*__GI___libc_realloc (oldmem=0x88ab008, bytes=20) at malloc.c:3635
3635    malloc.c: No such file or directory.
        in malloc.c
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/rutski/test/a.out

Breakpoint 1, main () at main.c:8
8           void* p = malloc(10);
(gdb) n
9           p = realloc(p, 20);
(gdb)
10          x = strcmp(argv[0], argv[0]);
(gdb) s
11      }
(gdb) quit
The program is running.  Exit anyway? (y or n) y
rutski@titan:~/test$


Reply to: