Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org, gcc-patches@gcc.gnu.org
Subject: Re: [gdb/libiberty] Improve support for cross debugging shared libraries with DOS style pathnames (from Unix hosts)
Date: Fri, 23 Apr 2010 08:54:00 -0000	[thread overview]
Message-ID: <83y6ge35xi.fsf@gnu.org> (raw)
In-Reply-To: <201004221824.27019.pedro@codesourcery.com>

> From: Pedro Alves <pedro@codesourcery.com>
> Date: Thu, 22 Apr 2010 18:24:26 +0100
> 
> The fix is to teach GDB about the distintion between host
> paths and target paths, and make the target file system
> "kind" selectable at run time.  See the new target_lbasename,
> IS_TARGET_DIR_SEPARATOR, IS_TARGET_ABSOLUTE_PATH,
> HAS_TARGET_DRIVE_SPEC in the patch (gdb side).
> 
> For that, the patch introduces a new set/show command pair
> so the user can tweak the target's file system flavour, in
> case GDB gets it wrong:

Thanks!

>  (gdb) help set target-file-system-kind
>  Set assumed file system kind for target reported paths

Please don't use "path" when you really mean "file name".  It's
confusing; "path" should be reserved for lists of directories such as
PATH or INFOPATH.

> --- src.orig/gdb/solib.c	2010-04-22 17:19:42.000000000 +0100
> +++ src/gdb/solib.c	2010-04-22 17:22:34.000000000 +0100
> @@ -104,6 +104,76 @@ The search path for loading non-absolute
>  		    value);
>  }
>  
> +/* Handle DOS-like target reported paths, that is for example, DLL
> +   paths like c:\sys\bin\foo.dll (drive name, backslash as dir
> +   separator), even if GDB itself is not running on such a system.  */
> +
> +static const char target_file_system_kind_auto[] = "auto";
> +static const char target_file_system_kind_unix[] = "unix";
> +static const char target_file_system_kind_dos_based[] = "dos-based";
> +static const char *target_file_system_kinds[] =
> +{
> +  target_file_system_kind_auto,
> +  target_file_system_kind_unix,
> +  target_file_system_kind_dos_based
> +};

Is it wise to define these in solib.c?  What about ports that don't
link solib.c into the binary?

I'd suggest to move this (and the related functions) to some more
general source file, even if for now these facilities are used only
for shared library lookup.

> +  /* If the search in gdb_sysroot failed, and the path name has a
> +     drive spec (e.g, c:/foo), try stripping ':' from the drive spec,
> +     and retrying in the sysroot:
> +       c:/foo/bar.dll ==> /sysroot/c/foo/bar.dll.  */

Why not /sysroot/foo/bar, without the "c" part?  What systems are set
up the way this code expects?

> Index: src/gdb/i386-cygwin-tdep.c
> ===================================================================
> --- src.orig/gdb/i386-cygwin-tdep.c	2010-04-22 17:19:42.000000000 +0100
> +++ src/gdb/i386-cygwin-tdep.c	2010-04-22 17:22:34.000000000 +0100
> @@ -235,6 +235,10 @@ i386_cygwin_init_abi (struct gdbarch_inf
>      (gdbarch, windows_core_xfer_shared_libraries);
>  
>    set_gdbarch_auto_wide_charset (gdbarch, i386_cygwin_auto_wide_charset);
> +
> +  /* Canonical paths on this target look like `c:\Program Files\Foo App\mydso.dll',
> +     for example.  */
> +  set_gdbarch_has_dos_based_file_system (gdbarch, 1);
>  }

Any reasons not to provide similar settings for MinGW and DJGPP?

> +* Support for remote debugging Windows and SymbianOS shared libraries
> +  from Unix hosts has been improved.

Is this feature really used only for remote debugging?  Doesn't it
affect native debugging as well?

> +@smallexample
> +  c:\foo\bar.dll ==> c:/foo/bar.dll
> +@end smallexample

Please use @result{} instead of the ASCII art.

> +@kindex set target-file-system-kind (unix|dos-based|auto)
> +@kindex show target-file-system-kind
> +@item set target-file-system-kind @var{kind}
> +Set assumed file system kind for target reported paths.

This warrants some @cindex entry, preferably including "dos" as its
substring.  Something like

  @cindex DOS file-name semantics if file names.

Again, please don't use "path" instead of "file name" (here and
elsewhere).

The NEWS entry and the patch for the manual are okay with the above
changes.

Thanks.


  parent reply	other threads:[~2010-04-23  8:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-22 17:24 Pedro Alves
2010-04-22 17:46 ` Daniel Jacobowitz
2010-04-23  8:54 ` Eli Zaretskii [this message]
2010-04-23 10:46   ` Pedro Alves
2010-04-23 11:15     ` Mark Kettenis
2010-04-23 14:30       ` Eli Zaretskii
2010-04-23 15:41         ` Mark Kettenis
2010-04-23 14:35     ` Eli Zaretskii
2010-04-24 11:18       ` Pedro Alves
2010-04-24 11:40         ` Eli Zaretskii
2010-04-24 13:13           ` Pedro Alves

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=83y6ge35xi.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdb-patches@sourceware.org \
    --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