Why doesn't gdb split into strcpy?

Please review the command line below. I set two breakpoints: one on strcpy and the other on printf. Why did this skip breakpoint 1?

root@ninja :~/Desktop/Programs# gcc -g -o exp exp.c root@ninja :~/Desktop/Programs# gdb -q exp Reading symbols from /root/Desktop/Programs/exp...done. (gdb) list 1 #include <stdio.h> 2 #include <string.h> 3 4 int main() { 5 char str_a[20]; 6 7 strcpy(str_a, "Hello world!\n"); 8 printf(str_a); 9 } (gdb) break strcpy Function "strcpy" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (strcpy) pending. (gdb) break printf Breakpoint 2 at 0x8048300 (gdb) run Starting program: /root/Desktop/Programs/exp Breakpoint 2, 0xb7eabf54 in printf () from /lib/i386-linux-gnu/i686/cmov/libc.so.6 (gdb) ir eip eip 0xb7eabf54 0xb7eabf54 <printf+4> (gdb) cont Continuing. Hello world! [Inferior 1 (process 3726) exited with code 015] 
+6
source share
1 answer

The first breakpoint is pending.

 (gdb) break strcpy Function "strcpy" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (strcpy) pending. <<here 

try: (gdb) break 7

7 - line number.

0
source

All Articles