From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26527 invoked by alias); 4 Jun 2013 00:32:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 26517 invoked by uid 89); 4 Jun 2013 00:32:53 -0000 X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 04 Jun 2013 00:32:52 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1UjfBC-00038n-DL from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Mon, 03 Jun 2013 17:32:50 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 3 Jun 2013 17:32:50 -0700 Received: from qiyao.dyndns.org.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Mon, 3 Jun 2013 17:32:50 -0700 From: Yao Qi To: Subject: [PATCH] Don't set dir separator if path has drive spec Date: Tue, 04 Jun 2013 00:32:00 -0000 Message-ID: <1370306007-877-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-06/txt/msg00028.txt.bz2 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 * 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