From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10344 invoked by alias); 24 Jun 2008 18:19:14 -0000 Received: (qmail 10335 invoked by uid 22791); 24 Jun 2008 18:19:13 -0000 X-Spam-Check-By: sourceware.org Received: from bluesmobile.specifix.com (HELO bluesmobile.specifix.com) (216.129.118.140) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 24 Jun 2008 18:18:56 +0000 Received: from [127.0.0.1] (bluesmobile.specifix.com [216.129.118.140]) by bluesmobile.specifix.com (Postfix) with ESMTP id 8EA9B3BEA0 for ; Tue, 24 Jun 2008 11:18:54 -0700 (PDT) Subject: [RFA] set/show enable-software-singlestep From: Michael Snyder To: gdb-patches@sourceware.org Content-Type: multipart/mixed; boundary="=-XFNFwcJk94prM9yzS3BG" Date: Tue, 24 Jun 2008 18:43:00 -0000 Message-Id: <1214331534.3601.1211.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-7.fc7) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-06/txt/msg00412.txt.bz2 --=-XFNFwcJk94prM9yzS3BG Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 354 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? --=-XFNFwcJk94prM9yzS3BG Content-Disposition: attachment; filename=swss.txt Content-Type: text/plain; name=swss.txt; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 1937 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); } --=-XFNFwcJk94prM9yzS3BG--