From patchwork Mon Oct 14 14:53:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 34937 Received: (qmail 43380 invoked by alias); 14 Oct 2019 14:53:13 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 43369 invoked by uid 89); 14 Oct 2019 14:53:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=developing, D*adacore.com, HContent-Transfer-Encoding:8bit X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Oct 2019 14:53:12 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id AF34456045; Mon, 14 Oct 2019 10:53:10 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id GiREMQSFXVo4; Mon, 14 Oct 2019 10:53:10 -0400 (EDT) Received: from murgatroyd.Home (174-29-53-230.hlrn.qwest.net [174.29.53.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 5964C56043; Mon, 14 Oct 2019 10:53:10 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Update stopped_by_sw_breakpoint documentation Date: Mon, 14 Oct 2019 08:53:06 -0600 Message-Id: <20191014145306.4421-1-tromey@adacore.com> MIME-Version: 1.0 While developing a patch for PR gdb/22992, I found that the documentation for stopped_by_sw_breakpoint was somewhat unclear. This patch adds the text that I think would have helped me avoid some extra investigation. gdb/ChangeLog 2019-10-14 Tom Tromey * target.h (target_ops::stopped_by_sw_breakpoint): Update comment. --- gdb/ChangeLog | 5 +++++ gdb/target.h | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/gdb/target.h b/gdb/target.h index 8dbd2d62dc4..84a6acbf7a4 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -507,6 +507,13 @@ struct target_ops processes a breakpoint event, the breakpoint may already be done from the target, so GDB needs to be able to tell whether it should ignore the event and whether it should adjust the PC. + + Note that the PC only needs to be adjusted if a software + breakpoint was in fact hit. In other cases, it should be left + alone. Also, this method should check + software_breakpoint_inserted_here_p before returning true -- + and thus also be updating the regcache with the adjusted PC. + See adjust_pc_after_break. */ virtual bool stopped_by_sw_breakpoint () TARGET_DEFAULT_RETURN (false);