Skip to content

Commit

Permalink
Fix #417 - Implement db-* command to delete all breakpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Feb 1, 2024
1 parent 6b8c103 commit ed0bfd3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/agent/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const commandHandlers = {
dbj: debug.breakpointJson,
dbc: [debug.breakpointNativeCommand, 'associate an r2 command when the native breakpoint is hit', '[addr] [cmd]'],
'db-': [debug.breakpointUnset, 'unset the native breakpoint in the given address', '[addr]'],
'db-*': [debug.breakpointUnsetAll, 'unset all the breakpoints'],
dc: [debug.breakpointContinue, 'continue execution of the interrupted child'],
dcu: [debug.breakpointContinueUntil, 'continue execution until given address', '[addr]'],
dk: [debug.sendSignal, 'send signal to process in the target process', '[signal]|([pid] [signum])'],
Expand Down
6 changes: 6 additions & 0 deletions src/agent/lib/debug/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ export function breakpointNativeCommand(args: string[]) {
}
}

export function breakpointUnsetAll(args: string[]) {
for (const [address, bp] of newBreakpoints.entries()) {
breakpointUnset([address]);
}
}

export function breakpointUnset(args: string[]) {
const addr = getPtr(args[0]).toString();
const bp = newBreakpoints.get(addr);
Expand Down

0 comments on commit ed0bfd3

Please sign in to comment.