Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [Patch] Improve path lookup of absolute source file
@ 2008-09-11 12:48 Francois Rigault
  2008-09-26  4:15 ` Thiago Jung Bauermann
  2008-09-26 13:02 ` Daniel Jacobowitz
  0 siblings, 2 replies; 10+ messages in thread
From: Francois Rigault @ 2008-09-11 12:48 UTC (permalink / raw)
  To: gdb-patches

When setting breakpoints on a source file using an absolute path,
lookup_symtab will try to match the target source file path with each
symbol file path. For each of these paths, the realpath function is
called, potentially leading to a big number of IOs.

On a slow IO filesystem, like a network file system, this can slow down
the performances. gdb takes here 15s to complete the setting of the
first breakpoint on an absolute source file path.

In order to let gdb find the files without generating IOs, a simple
trick is to check that symbol source file and target source file have
the same basename, as source file used at compilation time and the one
used for debugging are unlikely to have different basenames. See the
patch below against gdb-6.8.

Regards




*** gdb/symtab.c        Thu Sep 11 11:10:13 2008
--- gdb/symtab.c        Thu Sep 11 11:31:46 2008
*************** lookup_partial_symtab (const char *name)
*** 259,264 ****
--- 259,270 ----
        return (pst);
        }
 
+     /* Skip this symbol if basenames differ. */
+     if (FILENAME_CMP (lbasename(name), lbasename(pst->filename)) != 0)
+       {
+       continue;
+       } 
+ 
      /* If the user gave us an absolute path, try to find the file in
         this symtab and use its absolute path.  */
      if (full_path != NULL)



^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [Patch] Improve path lookup of absolute source file
@ 2009-03-11 10:32 Francois Rigault
  2009-03-15 19:44 ` Joel Brobecker
  0 siblings, 1 reply; 10+ messages in thread
From: Francois Rigault @ 2009-03-11 10:32 UTC (permalink / raw)
  To: Daniel Jacobowitz, Thiago Jung Bauermann; +Cc: gdb-patches

Daniel Jacobowitz <drow@false.org> wrote on 26/09/2008 15:01:55:
> I'm nervous about "unlikely".  What happens before and after if they
> do have different basenames?  e.g. a symlink foo.c to foo_x86.c; if
> GDB or GCC resolves the symlink at some point we'll mismatch and now
> completely fail to locate the file.

Hi,

would you accept a patch that uses a macro somewhere so that
users can choose to compile gdb with or without the modified lookup 
routine ? 

Francois



^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [Patch] Improve path lookup of absolute source file
@ 2009-07-15 17:16 Francois Rigault
  2009-07-30  0:07 ` Tom Tromey
  0 siblings, 1 reply; 10+ messages in thread
From: Francois Rigault @ 2009-07-15 17:16 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: brobecker, drow, gdb-patches, tromey

Eli Zaretskii <eliz@gnu.org> wrote on 24/04/2009 17:11:50:

> > Cc: gdb-patches@sourceware.org, Daniel Jacobowitz <drow@false.
> org>,         Joel Brobecker <brobecker@gmail.com>
> > From: Tom Tromey <tromey@redhat.com>
> > Date: Fri, 24 Apr 2009 08:52:17 -0600
> > 
> > Do you have a copyright assignment on file?  This patch is big enough
> > to require one.
> 
> Today's copyright.list doesn't seem to show Francois's name, FWIW.

No need to consider copyright, although this patch "looks" big it is
actually just a simple refactoring. I'll be happy without my name
inside copyright.list file.

F


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-07-29 22:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-11 12:48 [Patch] Improve path lookup of absolute source file Francois Rigault
2008-09-26  4:15 ` Thiago Jung Bauermann
2008-09-26 13:02 ` Daniel Jacobowitz
2009-03-11 10:32 Francois Rigault
2009-03-15 19:44 ` Joel Brobecker
2009-03-17 15:57   ` Francois Rigault
2009-04-24 14:52     ` Tom Tromey
2009-04-24 15:12       ` Eli Zaretskii
2009-07-15 17:16 Francois Rigault
2009-07-30  0:07 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox