Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] set/show enable-software-singlestep
@ 2008-06-24 18:43 Michael Snyder
  2008-06-24 19:15 ` Daniel Jacobowitz
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Michael Snyder @ 2008-06-24 18:43 UTC (permalink / raw)
  To: gdb-patches

[-- 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);
 }

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2008-07-12  2:31 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-24 18:43 [RFA] set/show enable-software-singlestep Michael Snyder
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox