This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Don't set dir separator if path has drive spec


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]