2008-06-23 Michael Snyder * 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); }