2008-06-23 Michael Snyder * infrun.c (can_use_sw_ss): New mode variable. (show_can_use_sw_ss): New setshow helper function. (resume): Check for can-use-software-singlestep. (_initialize_infrun): Add set/show command for can-use-software-singlestep. Index: infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.281 diff -u -p -r1.281 infrun.c --- infrun.c 13 Jun 2008 20:19:19 -0000 1.281 +++ infrun.c 24 Jun 2008 19:22:49 -0000 @@ -583,6 +583,21 @@ static CORE_ADDR displaced_step_original /* Saved contents of copy area. */ static gdb_byte *displaced_step_saved_copy; +/* When this is non-zero (default), we are allowed to use software + singlestep, if the architecture supports it. When zero, we will + use the normal singlestep model even if the architecture/abi would + not normally permit it. */ +int can_use_sw_ss = 1; +static void +show_can_use_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); +} + /* When this is non-zero, we are allowed to use displaced stepping, if the architecture supports it. When this is zero, we use traditional the hold-and-step approach. */ @@ -947,9 +962,9 @@ a command like `return' or `jump' to con return; } - if (step && gdbarch_software_single_step_p (gdbarch)) + if (step && can_use_sw_ss && gdbarch_software_single_step_p (gdbarch)) { - /* Do it the hard way, w/temp breakpoints */ + /* Do it the hard way, w/temp breakpoints ("software singlestep"). */ if (gdbarch_software_single_step (gdbarch, get_current_frame ())) { /* ...and don't ask hardware to do it. */ @@ -4634,6 +4649,16 @@ breakpoints, even if such is supported b &maintenance_set_cmdlist, &maintenance_show_cmdlist); + add_setshow_boolean_cmd ("can-use-software-singlestep", class_maintenance, + &can_use_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_can_use_sw_ss, + &maintenance_set_cmdlist, + &maintenance_show_cmdlist); /* ptid initializations */ null_ptid = ptid_build (0, 0, 0);