3 ms·
I have use gdb and various debuggers for a long time. They are very useful but there are limitations. "gdb rr" - tried it with demo helloworld. That works.
by srcmap 7y ago
I have use gdb and various debuggers for a long time. They are very useful but there are limitations.
"gdb rr" - tried it with demo helloworld. That works. But when tried it with a more complex program (FBOSS - Faceboss' Switch/Router open source program), gdb rr function core dump immediately.
Also there are certain categories of bugs what are very difficult to use gdb with:
* multi threads / race condition bugs - gdb break point in affect the flow of the program and cause different behaviors.
* Bugs can not be reliably reproduced.
* Server programs or embedded system programs where the code can not be stopped.
* This problem get much worst when combine with performance related issue - I work on one system design requirement that would switch over to backup system when system missing a heart beat for 50 milliseconds. Any gdb breakpoint in that app would automatically trigger a hard system fail over to backup.
BTW, I do use gdb a lot and can script gdb to do conditional breakpoints with script that auto dump variables, info etc.
- rhinoceraptor 7y agoI would highly recommend looking into dtrace or bpftrace (depending on your platform). They're not as powerful as a debugger, but you can use them when nothing else will work. They're totally safe to use in production, because they can't modify memory, and they have a very small performance impact when in use.
- bzbarsky 7y agoI'm not sure what you mean by "gdb rr". "rr" is a separate debugger that uses the gdb frontend but a different backend. Importantly, it does not utilize breakpoints during the initial program execution, precisely to address your first, second, and fourth points. The third point is still a problem, since it requires the program being debugged to run under rr from the start.
- roca 7y agoIf you really want to use rr on FBOSS, please file an rr issue and we'll look into it.