Open singalen opened 4 years ago
Ok. Sounds interesting. You are up for working on it yourself?
I made some initial research in the code. This should be doable, but no promises.
The condition should be checked somewhere around start_job_command()
, and I need to call enter_debugger()
- is this correct?
I'd stay out of src which is mostly GNU Make and work as much as possible in libdebugger
To get started I might modify info targets
so that instead of printing everything it filters according to some pattern. But no promises ;-)
Sorry, how would it help to create a data breakpoint? To be clear, I don't want to filter existing breakpoints by condition. I want to have a pure-data breakpoint, that triggers whenever ANY command matches a given regex.
To do this, I need to:
breakpoint_node
, it needs to be disconnected from a file location, but to have a command regex;$(shell)
too, after variable expansion (I wonder how this plays with .ONESHELL
);libdebug
to either list its regex breakpoints or to match the given command to regex breakpoints;Does this sound reasonable?
Ok - I think I see now. So yes, I think new_job in jobs.c is where you want to change.
And what you write sounds reasonable.
Still though, you would do well to change job.c a little as possible. It's already complicated and ugly enough. If you can just put inside new_job a call to a new routine inside libdebugger to make the additional check and trigger when true.
I have a huge set of makefiles. I need to find what creates a certain directory. I would like to set a breakpoint that triggers:
.+mkdir.+problem_directory$
is executed.The current breakpoints are useful when you know what file and line you want to stop at, but they cannot stop when a certain file is accessed.