←back to thread

376 points turrini | 5 comments | | HN request time: 0.624s | source
1. alfiedotwtf ◴[] No.42148130[source]
Debugger vs printf:

Has anyone found a reliable way to use a debugger when you have a) multi-process b) multi-threaded c) async d) timeouts? I would love to use a debugger but printf and logs “just work”

replies(4): >>42148913 #>>42149860 #>>42149876 #>>42151188 #
2. fisf ◴[] No.42148913[source]
GDB can do a, b, c (async Code is not really special?). d is going to be tricky and really depends.
3. slashdave ◴[] No.42149860[source]
The syntax is clunky, but watchpoints can do what you want.

https://ftp.gnu.org/old-gnu/Manuals/gdb/html_mono/gdb.html#S...

4. Mr-Frog ◴[] No.42149876[source]
I used GDB to debug contributions to the ION Delay-Tolerant-Networking stack, which is composed of dozens of processes. After some practice it became super easy to attach GDB instances to several running processes and watch the C structs be passed between them.
5. alfiedotwtf ◴[] No.42151188[source]
Thanks to all the replies… ok, looks like I’m going to have another go at debugging!