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

Modern debuggers allow you to execute log statements on breakpoints. Much better than modifying your program to output something.


I used this a lot! Combined with scripting support, you can make the experience even more interactive.

Used gdb scripts in the past to make debug sessions repeatable. Stuck beyond the point your interested in? No problem, just restart the session with your gdb script and your right back on track! You can also add custom functions to output your state in a more meaningful way or to mock some state. In longer debugging sessions, a good debugger can be a life safer!

Still, for shorter sessions, reading logs and adding occasional prints are hard to beat.




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

Search: