From f7e6eed5283bb5c8a3598dd986dc922b9a794f58 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 4 Mar 2015 20:41:16 +0000 Subject: remote+docs: software/hardware breakpoint traps This adjusts target remote to tell the core whether a trap was caused by a breakpoint. To that end, the patch teaches GDB about new RSP stop reasons "T05 swbreak" and "T05 hwbreak", that remote targets report back to GDB, similarly to how "T05 watch" indicates a stop caused by a watchpoint. Because targets that can report these events are expected to themselves adjust the PC after a software breakpoint, these new stop reasons must only be reported if the stub is talking to a GDB that understands them. Because of that, the use of the new stop reasons needs to be handshaked on initial connection, using the qSupported mechanism. GDB simply sends "swbreak+" in its qSupports query, and the stub reports back "swbreak+" too. Because these new stop reasons are required to fix a fundamental non-stop mode problem, this commit extends the remote non-stop intro section in the manual, documenting the events as required. To be clear, GDB will still cope with remote targets that don't support these new stop reasons; it will behave just like today. Tested on x86-64 Fedora 20, native and gdbserver. gdb/ChangeLog: 2015-03-04 Pedro Alves * NEWS: Mention the new "swbreak" and "hwbreak" stop reasons. * remote.c (struct remote_state) : Delete field. : New field. (PACKET_swbreak_feature, PACKET_hwbreak_feature): New enum values. (packet_set_cmd_state): New function. (remote_protocol_features): Register the "swbreak" and "hwbreak" features. (remote_query_supported): If not disabled with the corresponding "set remote foo-packet" command, report support for the swbreak and hwbreak features. (struct stop_reply) : Delete field. : New field. (remote_parse_stop_reply): Handle "swbreak" and "hwbreak". (remote_wait_as): Adjust. (remote_stopped_by_sw_breakpoint) (remote_supports_stopped_by_sw_breakpoint) (remote_stopped_by_hw_breakpoint) (remote_supports_stopped_by_hw_breakpoint): New functions. (remote_stopped_by_watchpoint): New function. (init_remote_ops): Install them. (_initialize_remote): Register new "set/show remote swbreak-feature-packet" and "set/show remote swbreak-feature-packet" commands. gdb/doc/ChangeLog: 2015-03-04 Pedro Alves * gdb.texinfo (Remote Configuration): Document the "set/show remote swbreak-feature-packet" and "set/show remote hwbreak-feature-packet" commands. (Packets) : Add cross link to the "swbreak" stop reason's decription. (Stop Reply Packets): Document the swbreak and hwbreak stop reasons. (General Query Packets): Document the swbreak and hwbreak qSupported features. (Remote Non-Stop): Explain that swbreak and hwbreak are required. --- gdb/NEWS | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gdb/NEWS') diff --git a/gdb/NEWS b/gdb/NEWS index 1c0f0792ed1..49dc0e622df 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -63,6 +63,16 @@ qXfer:btrace-conf:read Qbtrace-conf:bts:size Set the requested ring buffer size for branch tracing in BTS format. +swbreak stop reason + Indicates a memory breakpoint instruction was executed, irrespective + of whether it was GDB that planted the breakpoint or the breakpoint + is hardcoded in the program. This is required for correct non-stop + mode operation. + +hwbreak stop reason + Indicates the target stopped for a hardware breakpoint. This is + required for correct non-stop mode operation. + * The info record command now shows the recording format and the branch tracing configuration for the current thread when using the btrace record target. -- cgit v1.2.1