strcpy-sse2-unaligned.S not found

后端 未结 1 732
迷失自我
迷失自我 2021-02-05 07:47

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

1条回答
  •  鱼传尺愫
    2021-02-05 08:16

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

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

    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:

    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.

    0 讨论(0)
提交回复
热议问题