On Wed, Apr 27, 2005 at 05:30:11PM +0300, Eli Zaretskii wrote: > > Date: Tue, 12 Apr 2005 09:58:25 -0400 > > From: [EMAIL PROTECTED] > > > > 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 <[EMAIL PROTECTED]> > > * 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 _______________________________________________ Bug-gdb mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-gdb
