diff options
author | Daniel Jacobowitz <drow@false.org> | 2007-05-14 14:10:35 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2007-05-14 14:10:35 +0000 |
commit | 84ba0adf42e55d24e3656fc0b0dbcff5eb1e0bbc (patch) | |
tree | 298102eebcc8ed4a5adc4498cda4c8c476602605 /gdb/buildsym.c | |
parent | 24471d420951f088fe188f7e7db8941d26f39c51 (diff) | |
download | gdb-84ba0adf42e55d24e3656fc0b0dbcff5eb1e0bbc.zip gdb-84ba0adf42e55d24e3656fc0b0dbcff5eb1e0bbc.tar.gz gdb-84ba0adf42e55d24e3656fc0b0dbcff5eb1e0bbc.tar.bz2 |
* buildsym.c (start_subfile): Handle absolute pathnames
while comparing subfile names.
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r-- | gdb/buildsym.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c index 94800bd..69d11e5 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 |