I am trying to debug multi-threaded program with one thread that waits input from user. When I put a breakpoint at some function of other thread and run app, it switches into same breakpoint and then immediately at input thread, so app waits input from user and I can't do any command in gdb. I simply need see all stack before invoking same function. I can't make bt command in
Does thread apply all bt answer your question?
You can add commands to a breakpoint, see the manual. Something like this:
(gdb) break some_func
Breakpoint 2 at ...
(gdb) commands 2
Type commands for breakpoint(s) 2, one per line.
End with a line saying just "end".
>thread apply all bt full
>end
(gdb) cont
Continuing.
Breakpoint 2, ...
Thread 1 (Thread 0x....
...
Oh, I'm guessing you get gdb printing this on you:
---Type <return> to continue, or q <return> to quit---
Just do the following before you do run (you can also stick this into .gdbinit file):
(gdb) set pagination off
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With