4 ms·
Ask HN: Debugging by printing in C with vim/emacs
Is there a way to add and remove prints the way we add/remove breakpoint in debugger?Basically i want a workflow where i can
1. Mark places in a file to add prints to be inserted in the code and a single command/script
would add them.
2. delete all prints with single command/script.
- greenyoda 11y agoNot sure why you'd want to do this with your editor. The gdb debugger can add breakpoints that automatically print values of variables when they're hit. And gdb can also be scripted, so you can write a gdb script that automatically adds all the breakpoints you want.
- snlpoll 11y agobecause i am working on bootloader, gdb would be overkill