From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20597 invoked by alias); 27 Apr 2005 14:36:46 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 20194 invoked from network); 27 Apr 2005 14:36:22 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 27 Apr 2005 14:36:22 -0000 Received: from drow by nevyn.them.org with local (Exim 4.50 #1 (Debian)) id 1DQneG-0000UD-Gn; Wed, 27 Apr 2005 10:36:20 -0400 Date: Wed, 27 Apr 2005 14:36:00 -0000 From: Daniel Jacobowitz To: Eli Zaretskii Cc: bug-gdb@rich-paul.net, bug-gdb@gnu.org, gdb-patches@sources.redhat.com Subject: Re: [RFA] Fix file name generation in edit_command (was: Ver 6.3 edit command failing) Message-ID: <20050427143620.GA1686@nevyn.them.org> Mail-Followup-To: Eli Zaretskii , bug-gdb@rich-paul.net, bug-gdb@gnu.org, gdb-patches@sources.redhat.com References: <01c54b35$Blat.v2.4$c3f52520@zahav.net.il> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01c54b35$Blat.v2.4$c3f52520@zahav.net.il> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-04/txt/msg00355.txt.bz2 On Wed, Apr 27, 2005 at 05:30:11PM +0300, Eli Zaretskii wrote: > > Date: Tue, 12 Apr 2005 09:58:25 -0400 > > From: bug-gdb@rich-paul.net > > > > While using gdb 6.3, I was having a problem with the directory name and the > > file name being concatenated by the edit command without an intervening slash. > > My solution was just to add the slash to the sprintf format string > > in cli/cli-cmds.c, near line 650. It worked for me. > > Thanks for pointing this out. > > In fact, the code there had quite a few problems besides the one you > found: it didn't use symtab->fullname, failed miserably for DOS-style > d:/foo/bar file names, etc. > > Does anyone object to the following patch? > > 2005-04-27 Eli Zaretskii > > * cli/cli-cmds.c (edit_command): Use symtab->fullname if > possible. Use IS_ABSOLUTE_PATH instead of checking for a literal > '/'. Make sure there's a slash between the directory and the file > name. Simplify and clarify the code logic. I can simplify this a whole lot further :-) You should use symtab_to_fullname. Then all the fallback logic is unnecessary; if symtab_to_fullname fails, GDB does not know where the file is. -- Daniel Jacobowitz CodeSourcery, LLC