Se vuoi debuggare la libreria sharata devi scaricartela.
Ma ad intuito io credo tu non stia usando correttamente gdb. Se devi seguire un programma non devi fare STEP all'interno di una funzione che non ha simboli. Devi usare NEXT
Exempio Sbagliato:
(gdb) b main
Breakpoint 1 at 0x40069f: file a.c, line 9.
(gdb) lisy
Undefined command: "lisy". Try "help".
(gdb) list
1 #include <stdio.h>
2
3 int main ()
4 {
5 char buf[1024];
6 FILE *fp;
7 int x;
8
9 if (!(fp=fopen("foo.txt","r")))
10 {
(gdb)
11 perror ("fopen");
12 return -1;
13 }
14
15 while (!feof(fp))
16 {
17 x= fscanf(fp, "%s", buf);
18 }
19 fclose (fp);
20 return 0;
(gdb) run
Starting program: /home/max/a.out
Breakpoint 1, main () at a.c:9
9 if (!(fp=fopen("foo.txt","r")))
(gdb) s
_IO_new_fopen (filename=0x400816 "foo.txt", mode=0x400814 "r") at ../libio/iofopen.c:107
107 ../libio/iofopen.c: No such file or directory.
in ../libio/iofopen.c
(gdb)
Esempio Corretto:
max@studio:~> gdb ./a.out -q
Reading symbols from /home/max/a.out...done.
(gdb) list
1 #include <stdio.h>
2
3 int main ()
4 {
5 char buf[1024];
6 FILE *fp;
7 int x;
8
9 if (!(fp=fopen("foo.txt","r")))
10 {
(gdb)
11 perror ("fopen");
12 return -1;
13 }
14
15 while (!feof(fp))
16 {
17 x= fscanf(fp, "%s", buf);
18 }
19 fclose (fp);
20 return 0;
(gdb) b main
Breakpoint 1 at 0x40069f: file a.c, line 9.
(gdb) run
Starting program: /home/max/a.out
Breakpoint 1, main () at a.c:9
9 if (!(fp=fopen("foo.txt","r")))
(gdb) n
15 while (!feof(fp))
(gdb) quit
A debugging session is active.
Inferior 1 [process 12459] will be killed.
Quit anyway? (y or n)