[PATCH 2/2] Try to initialize data-directory by first searching for "data-directory" in the same directory as the gdb binary

Jan Kratochvil jan.kratochvil@redhat.com
Sat Sep 22 11:08:00 GMT 2012


On Fri, 21 Sep 2012 21:05:36 +0200, Khoo Yit Phang wrote:
> On Sep 21, 2012, at 2:31 PM, Jan Kratochvil wrote:
> > Also it could check for /usr/gdb/data-directory which is less likely to be
> > present than /usr/bin/data-directory .
> 
> That does not happen, since the first part of relocate_gdb_data_directory finds BINDIR/data-directory by finding the directory containing the gdb binary, then appending "data-directory" to it. But in your patch:
> 
> > +     build directory.  */
> > +  datadir = ldirname (BINDIR);
> > +  datadir = reconcat (datadir, datadir,
> > +		      SLASH_STRING "gdb" SLASH_STRING "data-directory", NULL);
> > +  dir = relocate_path (gdb_program_name, datadir, 1, 1);
> 
> Doesn't this have a possibility of finding /usr/gdb/data-directory?

Your patch may find /usr/bin/data-directory, my patch may find
/usr/gdb/data-directory, I find the latter as a less possibly existing my
mistake.  But maybe it does not matter much.


Jan



More information about the Gdb-patches mailing list