Re: Should "dir" override the full path encoded in debug info?

Joel Brobecker
2006-06-24T07:08:50Z

> It is quite likely that what you really want is not "dir", but this:
>
> http://sourceware.org/ml/gdb/2006-03/msg00189.html
>
> Hey, Paul...

Indeed, that would solve the proble entirely. I wonder how this should
be implemented... Should the command store the rewriting rule, and have
find_and_open_source() use it when trying to locate source files?

> This might be a bug, or it might not. But generally "dir" is used only
> for files which could not be found; first try the normal location, then
> try the search path. This is the same thing we do for shared libraries
> (which implies that the new command would be sort-of an analog for set
> solib-absolute-prefix). Changing anything here is tricky, because of
> the case of multiple directories with files with the same name...

Indeed, same file name used more than once in a project is an issue.
Perhaps the argument I was making saying that it "works" in most cases
is backwards, and it actually "works" in my coworker's case while it's
broken for most cases. I'm not sure I would thrilled at the prospect
of fixing this, knowing how delicate this can be.

--
Joel