Search code examples
c++gdb

How to solve the problem that gdb exits main function with a message "../sysdeps/nptl/libc_start_call_main.h: No such file or directory"?


exit debugging log:

Breakpoint 1, main () at 1.cpp:6
6           cout << "hello world" << endl;
(gdb) n
hello world
7           return 0;
(gdb) n
9       }
(gdb) n
__libc_start_call_main (main=main@entry=0x5555555551a9 <main()>, argc=argc@entry=1, argv=argv@entry=0x7fffffffe348) at ../sysdeps/nptl/libc_start_call_main.h:74
74      ../sysdeps/nptl/libc_start_call_main.h: No such file or directory.

Hope to solve this problem "No such file or directory".


Solution

  • Hope to solve this problem

    1. You don't actually have a problem, since it's unlikely that you want to step into libc implementation to start with, but ...
    2. If you really do want to step into libc code, you need to install GIBC source, and tell GDB where that source is installed (using GDB dir command).