public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [RFC 2/4] [gdb] Introduce maint set prefer-software-single-stepping on/off
Date: Wed, 29 Nov 2023 21:33:24 +0100	[thread overview]
Message-ID: <20231129203326.11952-2-tdevries@suse.de> (raw)
In-Reply-To: <20231129203326.11952-1-tdevries@suse.de>

Add a maintenance command that enables using software single-stepping on
targets that support this:
...
(gdb) maint set prefer-software-single-stepping on
...

By default, prefer-software-single-stepping is off, and behaviour is
unchanged.

Also, there are no users yet, the following patch will add one for amd64.

This is an RFC for the moment, so no docs yet.

Tested on x86_64-linux.
---
 gdb/breakpoint.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 60e795e1849..3d90e2a2159 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -13945,6 +13945,9 @@ insert_single_step_breakpoint (struct gdbarch *gdbarch,
   update_global_location_list (UGLL_INSERT);
 }
 
+extern bool prefer_software_single_stepping;
+bool prefer_software_single_stepping;
+
 bool
 software_single_step_p (struct gdbarch *gdbarch)
 {
@@ -15168,6 +15171,16 @@ When on, breakpoint location specific debugging is enabled."),
 			   show_debug_breakpoint,
 			   &setdebuglist, &showdebuglist);
 
+  add_setshow_boolean_cmd ("prefer-software-single-stepping", class_maintenance,
+			   &prefer_software_single_stepping, _("\
+Set whether software single-stepping is preferred."), _("\
+Show whether software single-stepping is preferred."), _("\
+When on, if both are available, software single-stepping is preferred over hardware single-stepping."),
+			   NULL,
+			   NULL,
+			   &maintenance_set_cmdlist,
+			   &maintenance_show_cmdlist);
+
   add_setshow_enum_cmd ("condition-evaluation", class_breakpoint,
 			condition_evaluation_enums,
 			&condition_evaluation_mode_1, _("\
-- 
2.35.3


  reply	other threads:[~2023-11-29 20:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29 20:33 [RFC 1/4] [gdb/tdep] Add dummy amd64_software_single_step Tom de Vries
2023-11-29 20:33 ` Tom de Vries [this message]
2023-11-29 20:33 ` [RFC 3/4] [gdb/tdep] Enable prefer-software-single-stepping on amd64 Tom de Vries
2023-11-29 20:33 ` [RFC 4/4] [gdb/testsuite] Add test-case gdb.base/gdb-sigterm-3.exp Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231129203326.11952-2-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).