From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17830 invoked by alias); 9 Oct 2008 14:50:02 -0000 Received: (qmail 17759 invoked by uid 22791); 9 Oct 2008 14:50:01 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 09 Oct 2008 14:49:25 +0000 Received: (qmail 25937 invoked from network); 9 Oct 2008 14:49:23 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 9 Oct 2008 14:49:23 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [RFA] Displaced stepping just enable in non-stop mode Date: Thu, 09 Oct 2008 14:50:00 -0000 User-Agent: KMail/1.9.9 Cc: teawater , "Joel Brobecker" , "Michael Snyder" References: <20081007121745.GH28138@adacore.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200810091549.26712.pedro@codesourcery.com> 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-10/txt/msg00285.txt.bz2 Hi, Thanks for doing this. On Wednesday 08 October 2008 07:10:43, teawater wrote: > -int can_use_displaced_stepping =3D 1; > +const char can_use_displaced_stepping_auto[] =3D "auto"; > +const char can_use_displaced_stepping_on[] =3D "on"; > +const char can_use_displaced_stepping_off[] =3D "off"; > +const char *can_use_displaced_stepping_enum[] =3D > +{ > + =A0can_use_displaced_stepping_auto, > + =A0can_use_displaced_stepping_on, > + =A0can_use_displaced_stepping_off, > + =A0NULL, > +}; > +const char *can_use_displaced_stepping =3D can_use_displaced_stepping_au= to; Could you make these static while you're at it, please? It was just missed in the old boolean setting. > =A0static void > =A0show_can_use_displaced_stepping (struct ui_file *file, int from_tty, > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 struct cmd_list_element *c, > @@ -567,12 +579,16 @@ Debugger's willingness to use displaced=20 > =A0"breakpoints is %s.\n"), value); Could you update this function to show what effect the auto setting is currently having? See breakpoint.c:show_always_inserted_mode for an example. > =A0} > =A0 > -/* Return non-zero if displaced stepping is enabled, and can be used > +/* Return non-zero if displaced stepping is auto, and can be used > + =A0 with GDBARCH, and in non-stop mode. > + =A0 Return non-zero if displaced stepping is on, and can be used > =A0 =A0 with GDBARCH. =A0*/ > =A0static int > =A0use_displaced_stepping (struct gdbarch *gdbarch) > =A0{ > - =A0return (can_use_displaced_stepping > + =A0return (((can_use_displaced_stepping =3D=3D can_use_displaced_steppi= ng_auto > +=A0=A0=A0=A0=A0=A0=A0 =A0 =A0&& non_stop) > +=A0=A0=A0=A0=A0=A0=A0 =A0 || can_use_displaced_stepping =3D=3D can_use_d= isplaced_stepping_on) > =A0=A0=A0=A0=A0=A0=A0=A0 =A0&& gdbarch_displaced_step_copy_insn_p (gdbarc= h)); > =A0} > =A0 > @@ -4857,11 +4873,14 @@ function is skipped and the step command > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = =A0 show_step_stop_if_no_debug, > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = =A0 &setlist, &showlist); > =A0 > - =A0add_setshow_boolean_cmd ("can-use-displaced-stepping", class_mainten= ance, > + =A0add_setshow_enum_cmd ("can-use-displaced-stepping", class_maintenanc= e, > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = =A0 can_use_displaced_stepping_enum, > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = =A0 &can_use_displaced_stepping, _("\ > =A0Set debugger's willingness to use displaced stepping."), _("\ > =A0Show debugger's willingness to use displaced stepping."), _("\ > -If zero, gdb will not use displaced stepping to step over\n\ > +If auto, gdb will auto use displaced stepping if it need (in non-stop mo= de).\n\ > +If on, gdb will use displaced stepping if such is supported by the targe= t.\n\ > +If off, gdb will not use displaced stepping to step over\n\ > =A0breakpoints, even if such is supported by the target."), This also needs to be updated in the manual. I'd suggest borrowing the text from breakpoint.c's "always-inserted" command description to make it a bit more descriptive, and mention which mode is the default. Should mostly be a matter of copy-paste, I think. --=20 Pedro Alves