clinuxubuntugdb

/lib/x86_64-linux-gnu/libthread_db.so.1 The file doesn't exist


I'm trying to run gdb on my C program but my debugger shows this on my terminal:

> (gdb) file main

Reading symbols from main...done.

> (gdb) run

Starting program: /home/userA/Desktop/test/part4_sent/main 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
The file doesn't exist.
[Inferior 1 (process 10250) exited with code 01]

> (gdb) 

What's the problem? I have searched the internet but I haven't found anything to work..


Solution

  • These lines are produced by GDB:

    Starting program: /home/userA/Desktop/test/part4_sent/main 
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    

    This line is likely produced by your program, and is not something that GDB prints:

    The file doesn't exist.
    

    This line is GDB telling you that your program has exited with error code 1:

    [Inferior 1 (process 10250) exited with code 01]
    

    To verify this theory, you can set breakpoint on main, and observe that it is reached.

    You can then use catch syscall exit_group, which will cause GDB to stop when your program exits, and use GDB where command to see why it is exiting. (Does your program require an input file that you are failing to supply?).