aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/mem-break.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2014-06-02 22:27:32 +0100
committerPedro Alves <palves@redhat.com>2014-06-02 22:27:32 +0100
commit0a261ed82e9b5f6fbc3725258a742515df8f4b42 (patch)
tree10a28a665a2c108795ffc541271a4c81bb76fa40 /gdb/gdbserver/mem-break.h
parent96ae5695ce2512600524915ace0bfef95a9734fc (diff)
downloadgdb-0a261ed82e9b5f6fbc3725258a742515df8f4b42.zip
gdb-0a261ed82e9b5f6fbc3725258a742515df8f4b42.tar.gz
gdb-0a261ed82e9b5f6fbc3725258a742515df8f4b42.tar.bz2
gdbserver: on GDB breakpoint reinsertion, also delete the breakpoint's commands.
If GDB decides to change the breakpoint's conditions or commands, it'll reinsert the same breakpoint again, with the new options attached, without deleting the previous breakpoint. E.g., (gdb) set breakpoint always-inserted on (gdb) b main if 0 Breakpoint 1 at 0x400594: file foo.c, line 21. Sending packet: $Z0,400594,1;X3,220027#68...Packet received: OK (gdb) b main Breakpoint 15 at 0x400594: file foo.c, line 21. Sending packet: $Z0,400594,1#49...Packet received: OK GDBserver understands this and deletes the breakpoint's previous conditions. But, it forgets to delete the previous commands. gdb/gdbserver/ 2014-06-02 Pedro Alves <palves@redhat.com> * ax.c (gdb_free_agent_expr): New function. * ax.h (gdb_free_agent_expr): New declaration. * mem-break.c (delete_gdb_breakpoint_1): Also clear the commands list. (clear_breakpoint_conditions, clear_breakpoint_commands): Make static. (clear_breakpoint_conditions_and_commands): New function. * mem-break.h (clear_breakpoint_conditions): Delete declaration. (clear_breakpoint_conditions_and_commands): New declaration.
Diffstat (limited to 'gdb/gdbserver/mem-break.h')
-rw-r--r--gdb/gdbserver/mem-break.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/gdbserver/mem-break.h b/gdb/gdbserver/mem-break.h
index 2649462..c84c688 100644
--- a/gdb/gdbserver/mem-break.h
+++ b/gdb/gdbserver/mem-break.h
@@ -90,9 +90,10 @@ int breakpoint_here (CORE_ADDR addr);
int breakpoint_inserted_here (CORE_ADDR addr);
-/* Clear all breakpoint conditions associated with this address. */
+/* Clear all breakpoint conditions and commands associated with a
+ breakpoint. */
-void clear_breakpoint_conditions (struct breakpoint *bp);
+void clear_breakpoint_conditions_and_commands (struct breakpoint *bp);
/* Set target-side condition CONDITION to the breakpoint at ADDR.
Returns false on failure. On success, advances CONDITION pointer