diff options
author | Joel Brobecker <brobecker@gnat.com> | 2007-01-24 00:03:15 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2007-01-24 00:03:15 +0000 |
commit | 56163ce1d3a08ade22d84d366dc9066df789914a (patch) | |
tree | 1fb836b57f01df4ed1df618f142c13f41fb4b020 | |
parent | 3ba257ccb2c0fe5fc0021c0592c75db7fd7a8d5f (diff) | |
download | gdb-56163ce1d3a08ade22d84d366dc9066df789914a.zip gdb-56163ce1d3a08ade22d84d366dc9066df789914a.tar.gz gdb-56163ce1d3a08ade22d84d366dc9066df789914a.tar.bz2 |
* source.c (find_and_open_source): Try rewriting the source
path inside filename if dirname is NULL.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/source.c | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 27db1d3..52025a7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2007-01-24 Joel Brobecker <brobecker@adacore.com> + * source.c (find_and_open_source): Try rewriting the source + path inside filename if dirname is NULL. + +2007-01-24 Joel Brobecker <brobecker@adacore.com> + * dwarf2read.c (add_partial_symbol): Create an extra partial symbol in the VAR_DOMAIN for Ada structures, unions or enums. (new_symbol): Likewise for symbols. diff --git a/gdb/source.c b/gdb/source.c index fa7dd5c..a142b32 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -1001,6 +1001,18 @@ find_and_open_source (struct objfile *objfile, strcat (path + len, source_path + len + cdir_len); /* After $cdir */ } } + else + { + /* If dirname is NULL, chances are the path is embedded in + the filename. Try the source path substitution on it. */ + char *rewritten_filename = rewrite_source_path (filename); + + if (rewritten_filename != NULL) + { + make_cleanup (xfree, rewritten_filename); + filename = rewritten_filename; + } + } result = openp (path, OPF_SEARCH_IN_PATH, filename, OPEN_MODE, 0, fullname); if (result < 0) |