From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20926 invoked by alias); 8 Oct 2008 18:15:15 -0000 Received: (qmail 20914 invoked by uid 22791); 8 Oct 2008 18:15:14 -0000 X-Spam-Check-By: sourceware.org Received: from igw1.br.ibm.com (HELO igw1.br.ibm.com) (32.104.18.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 08 Oct 2008 18:14:28 +0000 Received: from d24relay01.br.ibm.com (unknown [9.8.31.16]) by igw1.br.ibm.com (Postfix) with ESMTP id 6903F32C117 for ; Wed, 8 Oct 2008 14:42:28 -0300 (BRT) Received: from d24av02.br.ibm.com (d24av02.br.ibm.com [9.18.232.47]) by d24relay01.br.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id m98IECmU2617520 for ; Wed, 8 Oct 2008 15:14:12 -0300 Received: from d24av02.br.ibm.com (loopback [127.0.0.1]) by d24av02.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m98IELaW008663 for ; Wed, 8 Oct 2008 15:14:21 -0300 Received: from [9.8.10.102] ([9.8.10.102]) by d24av02.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m98IEL4V008582; Wed, 8 Oct 2008 15:14:21 -0300 Subject: Re: [RFA] Resubmit reverse debugging [5/5] From: Thiago Jung Bauermann To: Michael Snyder Cc: "gdb-patches@sourceware.org" In-Reply-To: <48EC18F9.8040105@vmware.com> References: <48EC18F9.8040105@vmware.com> Content-Type: text/plain; charset=utf-8 Date: Wed, 08 Oct 2008 18:15:00 -0000 Message-Id: <1223489663.19088.43.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 8bit 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/msg00251.txt.bz2 El mar, 07-10-2008 a las 19:20 -0700, Michael Snyder escribió: > +static void > +exec_reverse_once (char *cmd, char *args, int from_tty) > +{ > + /* String buffer for command consing. */ > + char reverse_command[512]; > + sprintf (reverse_command, "%s %s", cmd, args ? args : ""); > + > + execution_direction = EXEC_REVERSE; > + execute_command (reverse_command, from_tty); > + do_cleanups (old_chain); That fixed-length buffer being written with sprintf doesn't look good... What do you think about using xstrprintf instead? That will remove the possibility of buffer overflow, and also remove an arbitrary limit. > + add_com ("reverse-next", class_run, reverse_next, _("\ > +Step program backward, proceeding through subroutine calls.\n\ > +Like the \"reverse-step\" command as long as subroutine calls do not happen;\n\ > +when they do, the call is treated as one instruction.\n\ > +Argument N means do this N times (or till program stops for another reason).") > + ); > + add_com_alias ("rn", "reverse-next", class_alias, 1); What about adding "previous" and either "pr" or "pre" as alias to reverse-next? Sounds more natural to me than "reverse-next". Similarly, "previousi" and "pri" or "prei". I'd also half-seriously suggest adding a "step-back" alias on the same grounds. :-) -- []'s Thiago Jung Bauermann IBM Linux Technology Center