Trepan-Debuggers / remake

Enhanced GNU Make - tracing, error reporting, debugging, profiling and more
http://bashdb.sf.net/remake
GNU General Public License v3.0
796 stars 75 forks source link

WIP: #107: Debugger "watchpoints": breakpoints that trigger when a command… #108

Open singalen opened 4 years ago

singalen commented 4 years ago

… executed matches a particular regex.

Got a permission from my company to contribute.

Here's what worked for me. It's rather an invitation to review, there are some things to clean up here.

rocky commented 4 years ago

Thanks. I'll be trying it out soon.

singalen commented 4 years ago

So what do you think?

rocky commented 4 years ago

I've been thinking about this some more.

The times when I have wanted something liike this has been for matching against specfic targets because there are patterns in the make file like:

.c.o:

but I want to stop before a particular target gets built. Ditto for a dependency. One way this could be added would be to change the watch command to add a parameter like @, <, and c for target, depedency and command.

However unless you are up for it, so as not to muddy the waters here, I think it best to wait until this is done.

What do you think?

singalen commented 4 years ago

Thanks for a kind words! Going through the review now.

singalen commented 4 years ago

Are you sure the documentation should go into info/watch.rst? I didn't add info watch command, it is a standalone watch command, related to break. Maybe I should add breakpoints/watch.rst instead?

singalen commented 4 years ago

Speaking of matching the targets and others, that sounds like a useful development of the idea. I'll see if I'm up to it; anyway, I would suggest doing it incrementally, in another PR.

rocky commented 4 years ago

Are you sure the documentation should go into info/watch.rst? I didn't add info watch command, it is a standalone watch command, related to break. Maybe I should add breakpoints/watch.rst instead?

Yes, you are correct.

(gdb) help breakpoints
...
thbreak -- Set a temporary hardware assisted breakpoint
trace -- Set a tracepoint at specified location
watch -- Set a watchpoint for an expression