I’d like to be able to write annotations for GDB breakpoints directly into my C-source.
Instead of having to go into the GDB tui and add breakpoints using line numbers, function names, regex, etc., I want a build pipeline that enables add comment (or similar) in C code -> get breakpoint in GDB.
In case it might help to clarify, I’m currently thinking of enabling something like this:
foo();
bar(); // #breakpoint
baz();
I’d write a bash script, cbreak
, that checks all lines of all the .c
files in a directory for that #breakpoint annotation, and outputs each one that has the annotation to a file break.br
.
I can then cbreak && gcc … && …
and load the breakpoints from break.br
.
Is there a tool that already exists for this? Is this a bad idea?