From: Michael Snyder <msnyder@specifix.com>
To: gdb-patches@sourceware.org
Subject: [RFA] set/show enable-software-singlestep
Date: Tue, 24 Jun 2008 18:43:00 -0000 [thread overview]
Message-ID: <1214331534.3601.1211.camel@localhost.localdomain> (raw)
[-- Attachment #1: Type: text/plain, Size: 354 bytes --]
There may be cases where gdb would be inclined to use
software singlestep, but you might not want it to. Examples:
* "target remote" to a target such as a simulator that
would be able to support normal singlestep.
* reverse debugging, where you can't predict the
"come-from" address of a jump instruction.
What do you guys think? Useful?
[-- Attachment #2: swss.txt --]
[-- Type: text/plain, Size: 1937 bytes --]
2008-06-23 Michael Snyder <msnyder@localhost.localdomain>
* gdbarch.c (enable_sw_ss): New mode variable.
(show_enable_sw_ss): New setshow helper function.
(gdbarch_software_single_step_p): If enable_sw_ss is false,
just return zero.
(_initialize_gdbarch): Add setshow command for
enable-software-singlestep (default true).
Index: gdbarch.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.c,v
retrieving revision 1.428
diff -u -p -r1.428 gdbarch.c
--- gdbarch.c 24 May 2008 16:32:01 -0000 1.428
+++ gdbarch.c 24 Jun 2008 18:15:30 -0000
@@ -2486,11 +2486,26 @@ set_gdbarch_smash_text_address (struct g
gdbarch->smash_text_address = smash_text_address;
}
+int enable_sw_ss = 1;
+
+static void
+show_enable_sw_ss (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c,
+ const char *value)
+{
+ fprintf_filtered (file, _("\
+Debugger's willingness to use software singlestep is %s.\n"),
+ value);
+}
+
int
gdbarch_software_single_step_p (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- return gdbarch->software_single_step != NULL;
+ if (enable_sw_ss)
+ return gdbarch->software_single_step != NULL;
+ else
+ return 0;
}
int
@@ -3635,4 +3650,13 @@ When non-zero, architecture debugging is
NULL,
show_gdbarch_debug,
&setdebuglist, &showdebuglist);
+ add_setshow_zinteger_cmd ("enable-software-singlestep", class_support,
+ &enable_sw_ss, _("\
+Set debugger's willingness to use software singlestep."), _("\
+Show debugger's willingness to use software singlestep."), _("\
+If zero, gdb will not use software singlestep, even if\n\
+the architecture API would seem to call for it."),
+ NULL,
+ show_enable_sw_ss,
+ &setlist, &showlist);
}
next reply other threads:[~2008-06-24 18:19 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-24 18:43 Michael Snyder [this message]
2008-06-24 19:15 ` Daniel Jacobowitz
2008-06-24 19:32 ` Michael Snyder
2008-06-25 13:22 ` Joel Brobecker
2008-06-25 13:43 ` Daniel Jacobowitz
2008-06-25 14:15 ` Joel Brobecker
2008-06-25 14:33 ` Pedro Alves
2008-06-25 15:05 ` Daniel Jacobowitz
2008-06-25 15:38 ` Pedro Alves
[not found] ` <1214862215.3601.1525.camel@localhost.localdomain>
2008-07-10 2:46 ` Michael Snyder
2008-07-10 11:07 ` Pedro Alves
2008-07-10 22:47 ` Daniel Jacobowitz
2008-07-12 2:31 ` Michael Snyder
2008-07-12 2:28 ` Michael Snyder
2008-06-25 14:35 ` Pedro Alves
2008-06-25 14:42 ` Joel Brobecker
2008-06-24 19:25 ` Eli Zaretskii
2008-06-24 19:34 ` Luis Machado
2008-06-24 20:22 ` Michael Snyder
2008-06-25 1:40 ` Pedro Alves
2008-06-25 6:15 ` Michael Snyder
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=1214331534.3601.1211.camel@localhost.localdomain \
--to=msnyder@specifix.com \
--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