This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] Try to initialize data-directory by first searching for "data-directory" in the same directory as the gdb binary
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