C语言 strcpy-sse2-unaligned.S 未找到

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13978692/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 04:48:49  来源:igfitidea点击:

strcpy-sse2-unaligned.S not found

c

提问by Afshin

I am compiling the simple code below, and run it in gdb. I set a break point at the strcpy line, as soon as I run it for the input for instance abc, and then press s, I get the following error:

我正在编译下面的简单代码,并在 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.

I am using ubuntu 12.04 AMD64 and gcc 2.15. Any idea?

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



main(int argc, char *argv[]) {

    char buffer[80];

    strcpy(buffer, argv[1]);

    return 0;
}

采纳答案by netcoder

It is completely harmless to ignore these "errors" when debugging.

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

The error is simply because GDB is looking for the source of the strcpyfunction. Any function in libc that you don't have the source for will you give a similar error, e.g.:

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

int *p = malloc(sizeof *p);

Then...

然后...

(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.

You can always download GNU libc's source and link it with GDB:

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

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

Then...

然后...

(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))

... which will let you step through malloc's source code. It's not particularly useful, but it can come in handy sometimes.

...这将让您单步执行malloc的源代码。它不是特别有用,但有时会派上用场。