From: Daniel Jacobowitz Date: Mon, 14 May 2007 14:10:35 +0000 (+0000) Subject: * buildsym.c (start_subfile): Handle absolute pathnames X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=84ba0adf42e55d24e3656fc0b0dbcff5eb1e0bbc;p=binutils-gdb.git * buildsym.c (start_subfile): Handle absolute pathnames while comparing subfile names. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f335419a322..af1cb80f7b6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2007-05-14 Maxim Grigoriev + + * buildsym.c (start_subfile): Handle absolute pathnames + while comparing subfile names. + 2007-05-13 Ulrich Weigand * hppa-hpux-tdep.c: Include "regcache.h". diff --git a/gdb/buildsym.c b/gdb/buildsym.c index 94800bd76b4..69d11e58ee4 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -549,11 +549,27 @@ start_subfile (char *name, char *dirname) for (subfile = subfiles; subfile; subfile = subfile->next) { - if (FILENAME_CMP (subfile->name, name) == 0) + char *subfile_name; + + /* If NAME is an absolute path, and this subfile is not, then + attempt to create an absolute path to compare. */ + if (IS_ABSOLUTE_PATH (name) + && !IS_ABSOLUTE_PATH (subfile->name) + && subfile->dirname != NULL) + subfile_name = concat (subfile->dirname, SLASH_STRING, + subfile->name, NULL); + else + subfile_name = subfile->name; + + if (FILENAME_CMP (subfile_name, name) == 0) { current_subfile = subfile; + if (subfile_name != subfile->name) + xfree (subfile_name); return; } + if (subfile_name != subfile->name) + xfree (subfile_name); } /* This subfile is not known. Add an entry for it. Make an entry