strcpy-sse2-unaligned.S未找到

我正在编译下面的简单代码,并在gdb中运行它。 我在strcpy行设置了一个断点,一旦我为输入abc运行它,然后按s,我得到以下错误:

Breakpoint 1, main (argc=2, argv=0x7fffffffdd98) at ExploitMe.c:9 9 strcpy(buffer, argv[1]); (gdb) s __strcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S:48 48 ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S: No such file or directory. 

我使用的是ubuntu 12.04 AMD64和gcc 2.15。 任何的想法?


 main(int argc, char *argv[]) { char buffer[80]; strcpy(buffer, argv[1]); return 0; } 

在调试时忽略这些“错误”是完全无害的。

错误只是因为GDB正在寻找strcpy函数的来源。 libc中没有源代码的任何函数都会给出类似的错误,例如:

 int *p = malloc(sizeof *p); 

然后…

 (gdb) s 5 int *p = malloc(sizeof *p); (gdb) s __GI___libc_malloc (bytes=4) at malloc.c:2910 2910 malloc.c: No such file or directory. 

您可以随时下载GNU libc的源代码并将其与GDB链接:

 git clone https://github.com/jeremie-koenig/glibc /opt/src/glibc 

然后…

 (gdb) dir /opt/src/glibc/malloc (gdb) s 5 int *p = malloc(sizeof *p); (gdb) s __GI___libc_malloc (bytes=4) at malloc.c:2910 2910 } (gdb) s 2915 } else if (!in_smallbin_range(size)) 

…这将让您逐步完成malloc的源代码。 它并不是特别有用,但它有时可以派上用场。