Re: [Patch] Improve path lookup of absolute source file

Thiago Jung Bauermann
2008-09-26T04:15:15Z

Hi,

Francois Rigault schrieb:
> 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.

This patch is a good idea, thanks. Some comments:

We need it against current CVS HEAD of GDB. Also, could you run the
testsuite before and after applying your patch, to be sure it introduces
no regression? It doesn't seem to me it will, but this is good practice
anyway.

Also, some nits regarding formatting, since GDB uses the GNU Coding
Standard:

> *** 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. */

s/symbol/symbol table/
Also, you need two spaces after the full stop.

> + if (FILENAME_CMP (lbasename(name), lbasename(pst->filename)) != 0)

There should be a space between the function name and the parenthesis.

> + {
> + continue;
> + }

You don't need the curly braces here, since there's only one statement
inside the if.
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center