From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9738 invoked by alias); 24 Jun 2008 19:25:48 -0000 Received: (qmail 9730 invoked by uid 22791); 24 Jun 2008 19:25:48 -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 19:25:30 +0000 Received: from [127.0.0.1] (bluesmobile.specifix.com [216.129.118.140]) by bluesmobile.specifix.com (Postfix) with ESMTP id F353D3B971; Tue, 24 Jun 2008 12:25:28 -0700 (PDT) Subject: Re: [RFA] set/show enable-software-singlestep From: Michael Snyder To: Daniel Jacobowitz Cc: gdb-patches@sourceware.org In-Reply-To: <20080624182933.GA12195@caradoc.them.org> References: <1214331534.3601.1211.camel@localhost.localdomain> <20080624182933.GA12195@caradoc.them.org> Content-Type: multipart/mixed; boundary="=-QmoE/qCt3sydTyPBWfF2" Date: Tue, 24 Jun 2008 19:32:00 -0000 Message-Id: <1214335528.3601.1216.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/msg00416.txt.bz2 --=-QmoE/qCt3sydTyPBWfF2 Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 725 On Tue, 2008-06-24 at 14:29 -0400, Daniel Jacobowitz wrote: > On Tue, Jun 24, 2008 at 11:18:54AM -0700, Michael Snyder wrote: > > 2008-06-23 Michael Snyder > > > > * gdbarch.c (enable_sw_ss): New mode variable. > > This is a generated file... D'oh! Oh yeah... > I recommend you leave the meaning of > gdbarch_software_single_step_p alone, and do the adjustment at its caller. Good suggestion. How about the attached? On Tue, 2008-06-24 at 21:42 +0300, Eli Zaretskii wrote: > It would be, if it were documented in the manual ;-) I hear thee, O voice crying out in the wilderness. I was just gonna... wait until we'd hashed out the user interface! Yeah, that's my story... ;-) --=-QmoE/qCt3sydTyPBWfF2 Content-Disposition: attachment; filename=canuse.txt Content-Type: text/plain; name=canuse.txt; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 2529 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); --=-QmoE/qCt3sydTyPBWfF2--