From: Vladimir Simonov <sv@sw.ru>
To: Kai Tietz <ktietz70@googlemail.com>
Cc: Pedro Alves <pedro@codesourcery.com>,
gdb-patches@sourceware.org,
Joel Brobecker <brobecker@adacore.com>,
Eli Zaretskii <eliz@gnu.org>
Subject: Re: [patch gdb]: Fix some DOS-path related issues in gdb
Date: Fri, 04 Mar 2011 07:23:00 -0000 [thread overview]
Message-ID: <4D708E58.6080702@sw.ru> (raw)
In-Reply-To: <AANLkTi=f7+fO8AE+biZKWvYAGqptLWP5tWo8GKrBX=Nc@mail.gmail.com>
On 03/03/2011 08:32 PM, Kai Tietz wrote:
> 2011/3/3 Pedro Alves<pedro@codesourcery.com>:
>> On Thursday 03 March 2011 16:19:41, Kai Tietz wrote:
>>
>>> 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.
>>
>> It's supposed to work, because the "dos-based" setting accepts
>> unix style paths as well. A Windows build of gdb doesn't have
>> problems with unix paths. It's a unix gdb that has trouble with
>> dos paths.
>
> That's right from perspective of scanning those file name proper. But
> well on windows boxes there is also the concept of those drive-letters
> for volumes.
>
> Also (as side-note) the UNC-stuff isn't handled proper for any OS by
> binutils/gdb/gcc, but well, this is a different story.
>
>>> This is caused by the fact, that debugging information always are
>>> using host's (and not target's) filename schema.
>>
>> The patch I pointed at is precisely supposed to help with
>> that scenario.
>
> Well, it will help just on Windows boxes, which use same
> directory-tree on current working drive. But well, it can help. For
> unix a D: will be still be unresolveable.
>
>>> So to have here a
>>> command-line switch won't solve anything AFAICS.
>>
>> The patches leaves gdb being lax in filename
>> comparisions by default, even on unix.
>>
>>> +/* Handle binaries compiled on DOS-based filesystems (e.g, Windows),
>>> + by default, even if GDB itself is not running on such a system.
>>> + Such binaries may contain debug info with source paths the native
>>> + path handling functions wouldn't understand (e.g., backslash as
>>> + directory separator, drive names, and case insensitivity). The
>>> + risk of this going wrong is very minor in practice, so it's more
>>> + useful to leave this as default. */
>>> +static const char *source_file_names_mode = source_file_names_dos_based;
>>
>> If you have a bizarre case where you really need strict case-sensitive
>> filename comparisions, and to handle `\' in filenames,
>> then you'd need to flip the switch. 99.9999999999% of
>> the users won't.
>>
>>> 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.
>>
>> This is likely to be more memory consuming, and likely to
>> introduce a hit in debug info read time. (haven't measured, of course).
>
> Well, it is more a matter how and where this filemapping would be
> handled. I thought about adding this filename layer into libiberty,
> which then provides the basic file-io routines for
> filename-conversion.
> As for relative paths (which are commonly the main-part to be found in
> debugging information) nothing needs to be done AFAICS. The tricky
> part are just the absolute paths/filenames. For the case host's and
> current path match each other (means on windows drive-letter colon,
> for unix path begins with slash) nothing needs to be done, too. Just
> the case that absolute-paths don't match needs some actions (and a
> mapping).
> This would be best handled on trying to operate on filenames
> (open,fopen, stat,& co) via a layer provided in libiberty So those
> mapping can be done on actual access and don't need to be
> special-cased by app itself.
> As this issue is present on binutils (bfd), gcc, and gdb, it would be
> reasonable IMHO to handle this at one common and shared place.
>
> By doing this (maybe with some small hashing for transformed names), I
> wouldn't assume real speed-impact and no serious memory regression.
>
> Regards,
> Kai
>
> PS: IA64 PE is another host for which this can occure (wince-arm too, but well).
>
>
Hi all,
If the main problem is in mapping absolute DOS paths to Linux ones then
the simplest solution is creation appropriate symbolic links
on Linux side. I mean that using symlink D: pointed on some directory
you can simulate any DOS path. I'm using this approach for many years...
Regards
Vladimir Simonov
next prev parent reply other threads:[~2011-03-04 7:23 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <AANLkTi=QoOiBg3XmMv+hRNe8DkT2YiVGZ=7NhaQwzCey@mail.gmail.com>
2011-03-03 12:10 ` Kai Tietz
2011-03-03 13:24 ` Eli Zaretskii
2011-03-03 13:48 ` Kai Tietz
2011-03-03 14:00 ` Eli Zaretskii
2011-03-03 14:58 ` Joel Brobecker
2011-03-03 15:25 ` Kai Tietz
2011-03-03 15:32 ` Pedro Alves
2011-03-03 15:41 ` Kai Tietz
2011-03-03 16:09 ` Pedro Alves
2011-03-03 16:19 ` Kai Tietz
2011-03-03 16:42 ` Pedro Alves
2011-03-03 17:32 ` Kai Tietz
2011-03-04 7:23 ` Vladimir Simonov [this message]
2011-03-04 8:23 ` Joel Brobecker
2011-03-07 19:28 ` Jan Kratochvil
2011-03-07 19:28 ` Pedro Alves
2011-03-07 19:34 ` Jan Kratochvil
2011-03-03 18:09 ` Eli Zaretskii
2011-03-04 5:12 ` Joel Brobecker
2011-03-04 13:05 ` André Pönitz
2011-03-04 9:48 ` Kai Tietz
2011-03-04 10:37 ` Mark Kettenis
2011-03-05 9:13 ` Kai Tietz
2011-03-05 11:38 ` Vladimir Simonov
2011-03-05 12:45 ` Kai Tietz
2011-03-23 11:16 ` Kai Tietz
2011-03-23 12:44 ` Mark Kettenis
2011-03-23 14:07 ` Kai Tietz
2011-03-23 14:16 ` Pedro Alves
2011-03-23 14:18 ` Kai Tietz
2011-03-23 14:29 ` Pierre Muller
[not found] ` <-544184502231544940@unknownmsgid>
2011-03-23 14:44 ` Kai Tietz
2011-03-23 15:29 ` Pedro Alves
2011-03-23 15:29 ` Kai Tietz
2011-03-23 18:24 ` Eli Zaretskii
2011-03-23 21:11 ` Kai Tietz
2011-03-03 17:02 ` Mark Kettenis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D708E58.6080702@sw.ru \
--to=sv@sw.ru \
--cc=brobecker@adacore.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=ktietz70@googlemail.com \
--cc=pedro@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox