aboutsummaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2001-12-21 22:32:37 +0000
committerTom Tromey <tromey@redhat.com>2001-12-21 22:32:37 +0000
commit58d370e0e6b0b1cc1df5b587ca39a14e975f5850 (patch)
treea9f4b92ec61a2199bbe1ee7d60063c67ce99263c /gdb/source.c
parenta532ca62825cc3e09712af03d0dfaaf4ae96ffbf (diff)
downloadgdb-58d370e0e6b0b1cc1df5b587ca39a14e975f5850.zip
gdb-58d370e0e6b0b1cc1df5b587ca39a14e975f5850.tar.gz
gdb-58d370e0e6b0b1cc1df5b587ca39a14e975f5850.tar.bz2
* configure, config.in: Rebuilt.
* configure.in: Check for realpath. * defs.h (gdb_realpath): Declare. * symtab.h (partial_symtab): Added fullname field. * source.c (openp): Use gdb_realpath. (forget_cached_source_info): Clear full name of each partial symtab. * utils.c (gdb_realpath): New function. * symtab.c (lookup_symtab): Removed. (lookup_symtab_1): Renamed to lookup_symtab. (lookup_symtab): Look for real path. (lookup_partial_symtab): Likewise.
Diffstat (limited to 'gdb/source.c')
-rw-r--r--gdb/source.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gdb/source.c b/gdb/source.c
index d04f886..dab794f 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -234,6 +234,7 @@ forget_cached_source_info (void)
{
register struct symtab *s;
register struct objfile *objfile;
+ struct partial_symtab *pst;
for (objfile = object_files; objfile != NULL; objfile = objfile->next)
{
@@ -250,6 +251,15 @@ forget_cached_source_info (void)
s->fullname = NULL;
}
}
+
+ ALL_OBJFILE_PSYMTABS (objfile, pst)
+ {
+ if (pst->fullname != NULL)
+ {
+ xfree (pst->fullname);
+ pst->fullname = NULL;
+ }
+ }
}
}
@@ -603,15 +613,17 @@ done:
if (fd < 0)
*filename_opened = NULL;
else if (IS_ABSOLUTE_PATH (filename))
- *filename_opened = savestring (filename, strlen (filename));
+ *filename_opened = gdb_realpath (filename);
else
{
/* Beware the // my son, the Emacs barfs, the botch that catch... */
- *filename_opened = concat (current_directory,
+ char *f = concat (current_directory,
IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1])
? "" : SLASH_STRING,
filename, NULL);
+ *filename_opened = gdb_realpath (f);
+ xfree (f);
}
}
/* OBSOLETE #ifdef MPW */