From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23825 invoked by alias); 8 Oct 2008 20:27:18 -0000 Received: (qmail 23815 invoked by uid 22791); 8 Oct 2008 20:27:17 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 08 Oct 2008 20:26:42 +0000 Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id B1BEC37001; Wed, 8 Oct 2008 13:26:40 -0700 (PDT) Received: from [10.20.92.59] (promb-2s-dhcp59.eng.vmware.com [10.20.92.59]) by mailhost3.vmware.com (Postfix) with ESMTP id AAD21C9A17; Wed, 8 Oct 2008 13:26:40 -0700 (PDT) Message-ID: <48ED16FE.8010105@vmware.com> Date: Wed, 08 Oct 2008 20:27:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Thiago Jung Bauermann CC: "gdb-patches@sourceware.org" Subject: Re: [RFA] Resubmit reverse debugging [5/5] References: <48EC18F9.8040105@vmware.com> <1223489663.19088.43.camel@localhost.localdomain> In-Reply-To: <1223489663.19088.43.camel@localhost.localdomain> Content-Type: text/plain; charset=UTF-8; format=flowed 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/msg00256.txt.bz2 Thiago Jung Bauermann wrote: > 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. Sure, I'll look into it. >> + 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. :-) Lots of people have alternate suggestions for command names. The present set is as close to convergence as we were able to get in several previous rounds of discussion. I don't want the feature to be held up by this discussion, so I'm just saying "aliases are easy to add later".