-
Notifications
You must be signed in to change notification settings - Fork 24
Added Conditional Breakpoint Support #941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
…ems, and return type for `get_breakpoint_condition`
…dresses (new fallback to address comparison and VA comparisons)
…consistency issues
… + context menu additions) Co-authored-by: AdamR05 <215697996+AdamR05@users.noreply.github.com>
…on change events Co-authored-by: AdamR05 <215697996+AdamR05@users.noreply.github.com>
…t code Co-authored-by: AdamR05 <215697996+AdamR05@users.noreply.github.com>
|
Hi @3rdit I will review this ASAP and let you know what I think For context, I am working on a different PR that adds hardware breakpoint #53. And in light of the hardware breakpoint, I plan to make another large refactor on the breakpoint handling, e.g., the added breakpoints will be referred to by their index, not their address, etc. This would mean some non-trivial merge conflict in the future. However, I hope to minimize the frictions for you as you are doing these all for free. I will most likely review and merge your PR first, and brace for the merge conflicts on my branch. Hopefully that will be manageable |
PR Overview
This PR adds conditional breakpoint support to the debugger, allowing a user to specify expressions that must evaluate to true for the breakpoint to actually trigger. This is implemented at the debugger core level (not adapter level), so it works the same across all adapters.
As discussed with @xusheng6:
The conditions for breakpoints are written using the expression parser (i.e.
$rax == 0) making it the exact same for each debugger. The API now has:SetBreakpointCondition(),GetBreakpointCondition()on DebuggerControllerset_breakpoint_condition(),get_breakpoint_condition()For example:
In the breakpoint widget, there's a new "Condition" column that can be set by right-clicking and pressing "Edit Condition...", this works in the widget and disassembly view.
The condition is also persistent across sessions (saved to the binary view metadata).
Upcoming Changes
AbsoluteBreakpointConditionChangedEvent,RelativeBreakpointConditionChangedEvent) so subscribers don't need a separate API call to retrieve it.It makes sense to have some sort of unit testing for this. I reviewed the unit testing and noticed how breakpoints get tested indebugger_test.py, it would be trivial to add a quick unit test for conditions.This PR will close #93 and maybe close #422 (if the feature above is approved to be added in this PR).