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 /gdb/source.c | |
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.
Diffstat (limited to 'gdb/source.c')
-rw-r--r-- | gdb/source.c | 12 |
1 files changed, 12 insertions, 0 deletions
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) |