Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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”



The syntax is clunky, but watchpoints can do what you want.

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


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.


GDB can do a, b, c (async Code is not really special?). d is going to be tricky and really depends.


Thanks to all the replies… ok, looks like I’m going to have another go at debugging!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: