summaryrefslogtreecommitdiff
path: root/gdb/gdbserver/ax.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/ax.h
parent96ae5695ce2512600524915ace0bfef95a9734fc (diff)
downloadbinutils-gdb-0a261ed82e9b5f6fbc3725258a742515df8f4b42.tar.gz
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/ax.h')
-rw-r--r--gdb/gdbserver/ax.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/gdbserver/ax.h b/gdb/gdbserver/ax.h
index ce4ff4fe8b9..63180042600 100644
--- a/gdb/gdbserver/ax.h
+++ b/gdb/gdbserver/ax.h
@@ -58,6 +58,9 @@ struct agent_expr
of bytes in expression, a comma, and then the bytes. */
struct agent_expr *gdb_parse_agent_expr (char **actparm);
+/* Release an agent expression. */
+void gdb_free_agent_expr (struct agent_expr *aexpr);
+
/* Convert the bytes of an agent expression back into hex digits, so
they can be printed or uploaded. This allocates the buffer,
callers should free when they are done with it. */