bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFA] Fix file name generation in edit_command (was: Ver 6.3 edit co


From: Daniel Jacobowitz
Subject: Re: [RFA] Fix file name generation in edit_command (was: Ver 6.3 edit command failing)
Date: Wed, 27 Apr 2005 10:36:20 -0400
User-agent: Mutt/1.5.8i

On Wed, Apr 27, 2005 at 05:30:11PM +0300, Eli Zaretskii wrote:
> > Date: Tue, 12 Apr 2005 09:58:25 -0400
> > From: address@hidden
> > 
> > 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  <address@hidden>
> 
>       * 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]