Having trouble stepping into string.h
in GDB 7.5. Here's a simple example program:
Source code:
#include #include int main() { char str1[20]; strcpy(str1, "STEP INTO ME\n"); printf(str1); }
Compiled: ~$ gcc -g foo.c
Invoked: ~$ gdb -q ./a.out
GDB:
(gdb) break 5 Breakpoint 1 at 0x8048471: file foo.c, line 6. (gdb) break strcpy Function "strcpy" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 2 (strcpy) pending. (gdb) run Starting program: /home/user/a.out Breakpoint 1, main () at foo.c:6 6 strcpy(str_a, "Hello, world!\n"); (gdb) step 7 printf(str_a);
Shouldn't I be in the string library at this point? Instead it continues to the printf().
EDIT:
Scott's suggestion "worked", but not in the expected manner.
Breakpoint 1, main () at foo.c:6 6 strcpy(str_a, "Hello, world!\n"); (gdb) i r $eip eip 0x80484a1 0x80484a1 (gdb) step Breakpoint 2, __strcpy_ssse3 () at ../sysdeps/i386/i686/multiarch/strcpy-ssse3.S:78 78 ../sysdeps/i386/i686/multiarch/strcpy-ssse3.S: No such file or directory. (gdb) i r $eip eip 0xb7e9c820 0xb7e9c820 <__strcpy_ssse3> +21>
I am surprised at the directory in 78
... expected something like: /lib/.../cmov/libc.so.6
. And the claim that there is no such file or directory.