Re: [RFC] new substitute path when loading feature

Aleksandar Ristovski
2008-05-13T19:11:44Z

Daniel Jacobowitz wrote:
> On Tue, May 13, 2008 at 02:55:41PM -0400, Aleksandar Ristovski wrote:
>> Now without my change, this will sometimes work, sometimes it won't. For example, if the program was compiled on windows like this:
>>
>> C:\Temp\dirs\debug>gcc -g -O0 -c ../main.c -o main.o
>>
>> things would work. However if built like this:
>>
>> C:\Temp\dirs\debug>gcc -g -O0 -c c:\Temp\dirs\main.c -o main.o
>>
>> things would not work (as shown above).
>
> Is this just because of the slashes? I have a patch which makes
> Unix-configured GDB more tolerant of DOS paths and drive names. I
> can post it if you like; I've been meaning to.

No, this particular issue is not because of the slashes, but rather due to IS_ABSOLUTE_PATH returning false on a path like "c:/Temp...".

>
>> In any case, it seems right to be able to rewrite paths at readin and let
>> gdb "see" the binaries as if they were built locally.
>
> This means you have to have the source path mapping worked out before
> you know what files are in the program, so it's hard to fix up later
> if you see a new unrelocated path.
>

True and I was thinking further along these lines to enable rewriting existing paths in psymtabs/symtabs on demand (i.e. a command that would tell gdb: look through all psymtabs/symtabs and rewrite paths)... but wanted to get a feedback first :-)