Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Don't set dir separator if path has drive spec
@ 2013-06-04  0:32 Yao Qi
  2013-06-04  0:48 ` Doug Evans
  2013-09-27 12:58 ` [PATCH] Fix regular /path/to/directory sysroots and target reported dll paths with drive specs. (was: Re: [PATCH] Don't set dir separator if path has drive spec) Pedro Alves
  0 siblings, 2 replies; 6+ messages in thread
From: Yao Qi @ 2013-06-04  0:32 UTC (permalink / raw)
  To: gdb-patches

Hi,
When I debug a remote Windows program on Linux host, set sysroot to
"remote:", find GDB can't load these dlls from the remote.  If the dll
name is "C:/Windows/system32/ntdll.dll" and GDB add "remote:" prefix
to the path.  The dll name becomes "remote:/C:/Windows/system32/ntdll.dll"
and GDBserver is confused by the name.  The first slash shouldn't be
added.  In solib.c:solib_find,

      need_dir_separator = !IS_DIR_SEPARATOR (in_pathname[0]);

it controls whether to insert dir separator after sysroot.  It works
for UNIX-like file path, but it doesn't work for the DOS-like absolute
path.  This patch is to fix this problem.  Is it OK?

gdb:

2013-06-04  Yao Qi  <yao@codesourcery.com>

	* solib.c (solib_find): Don't need dir separator if path has
	drive spec.
---
 gdb/solib.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/gdb/solib.c b/gdb/solib.c
index a3479c5..d0392b4 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -230,7 +230,8 @@ solib_find (char *in_pathname, int *fd)
     {
       int need_dir_separator;
 
-      need_dir_separator = !IS_DIR_SEPARATOR (in_pathname[0]);
+      need_dir_separator = (!IS_DIR_SEPARATOR (in_pathname[0])
+			    && !HAS_TARGET_DRIVE_SPEC (fskind, in_pathname));
 
       /* Cat the prefixed pathname together.  */
       temp_pathname = concat (sysroot,
-- 
1.7.7.6


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-09-27 15:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-04  0:32 [PATCH] Don't set dir separator if path has drive spec Yao Qi
2013-06-04  0:48 ` Doug Evans
2013-06-04  1:33   ` Yao Qi
2013-09-27 12:58 ` [PATCH] Fix regular /path/to/directory sysroots and target reported dll paths with drive specs. (was: Re: [PATCH] Don't set dir separator if path has drive spec) Pedro Alves
2013-09-27 14:18   ` [PATCH] Fix regular /path/to/directory sysroots and target reported dll paths with drive specs Yao Qi
2013-09-27 15:29     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox