Index: source.c =================================================================== RCS file: /cvs/src/src/gdb/source.c,v retrieving revision 1.77 diff -u -p -r1.77 source.c --- source.c 9 Jan 2007 17:58:58 -0000 1.77 +++ source.c 12 Jan 2007 04:01:21 -0000 @@ -1001,6 +1001,18 @@ find_and_open_source (struct objfile *ob 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)