Re: [patch gdb]: Fix some DOS-path related issues in gdb

Kai Tietz
2011-03-03T16:19:53Z

2011/3/3 Pedro Alves <pedro@codesourcery.com>:
> On Thursday 03 March 2011 15:41:27, Kai Tietz wrote:
>> 2011/3/3 Pedro Alves <pedro@codesourcery.com>:
>> > On Thursday 03 March 2011 14:58:32, Joel Brobecker wrote:
>> >> > I didn't know that the Windows 64bit target can use ELF debug info.
>> >> > Can it?  With what toolchains?
>> >> >
>> >> > As for mdebugread.c, I always thought it was MIPS specific.  What
>> >> > other platforms use it?
>> >>
>> >> These would still be pertinent in the case of cross debugging, no?
>> >> If the files were cross-compiled on Windows, the debug info would
>> >> contain file paths that follow the Windows convention...
>> >
>> > And then if you try to debug that on GNU/Linux, things still
>> > won't work, because filename_cmp changes behavior depending on host,
>> > not target or context.  That's why I believe there should be a clear
>> > distinction between what's a source path, and a host path.  I think
>> > Kai's bfd changes affect host paths, so they're fine. (haven't really
>> > checked, but that's what I imagine).  For source paths, I'd rather
>> > have this patch resurected...
>> >
>> >  <http://sourceware.org/ml/gdb-patches/2010-12/msg00343.html>
>> >
>> > I haven't looked at Kai's patch to see if it affects host
>> > paths or source paths.
>> >
>> > --
>> > Pedro Alves
>> >
>>
>> Well Pedro,
>>
>> this is exactly the point I described in my reply to Eli. The
>> debugging of cross-compiled binaries via systems with different
>> filename/path representation was and is still not operating. Here it
>> would be necessary to provide host<->creator information for doing a
>> mapping. And this isn't handled by this patch.
>> But at least this patch takes care that stuff compiled on a host with
>> host-compiler using DOS-paths is able to operate correct. And ELF is
>> an object-file format and has in principle nothing to do with unix and
>> can be used (with loader-support) on any specifc OS.
>
> It sounds like you didn't follow the url I pointed at?
>
> --
> Pedro Alves
>

Yes, sorry. I read it now. Well, this flag sounds on first hand
proper, but by rethinking it a bit, it is not working.
If you have compiled your application via cross-compiler on unix for a
target with a different file-system schema (like windows), and then
try to debug it via an native debugger, you will see that filenames
and paths won't work at all.
This is caused by the fact, that debugging information always are
using host's (and not target's) filename schema. So to have here a
command-line switch won't solve anything AFAICS.
IMHO the only valid approach to solve this is:
a) Assume that gbd uses internally always its host-filename-schema
(this is my patch about)
b) Introduce a mapping of foreign file-systems to host's, which can be
setuped by user. Sadly this can't be detected by debugging-information
as AFAIK it lacks this information to tell on what host it was build.

Regards,
Kai

--
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination