From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 884 invoked by alias); 4 Jun 2013 00:48:09 -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 875 invoked by uid 89); 4 Jun 2013 00:48:09 -0000 X-Spam-SWARE-Status: No, score=-4.2 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.1 Received: from mail-ve0-f175.google.com (HELO mail-ve0-f175.google.com) (209.85.128.175) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 04 Jun 2013 00:48:08 +0000 Received: by mail-ve0-f175.google.com with SMTP id da11so3318753veb.6 for ; Mon, 03 Jun 2013 17:48:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=X5PvBrK2lLNtuY/mlFyF2YsSTZVHnzMjX5zjaKJpUAs=; b=YjXM+jqOeNs606LhA/HKZQMKjCnU1wEAic9OQv2a1IMOGDogyCxfwj5+it82+uc2Io LcKS/Gsje2i4iZJswxRA8BBLjm9mBkPnAQ7jiHJH6Ypp3vSCeQ+xskEK5D8zw49Jojps WNsQgPRmr5A+paaef6Gf22KFE5OBH22NkUdx/9tV2Ld7sEfrjBoaruxFxFKku5qjpfs6 ntVPi2bfAVrIxosF2IWBFYpIMq7+2KGNJKL5bHaD+5uhNPFBN7Qa+zG7F2I2mwuAwMJn RLn6+kl3BlFx/Vgak3Xh+v2F18shIKarQtlI23+4zYFaSBpWpvS1MkYHaZl0vuGdwAxu IGNQ== MIME-Version: 1.0 X-Received: by 10.58.6.141 with SMTP id b13mr17906523vea.45.1370306886868; Mon, 03 Jun 2013 17:48:06 -0700 (PDT) Received: by 10.220.189.74 with HTTP; Mon, 3 Jun 2013 17:48:06 -0700 (PDT) In-Reply-To: <1370306007-877-1-git-send-email-yao@codesourcery.com> References: <1370306007-877-1-git-send-email-yao@codesourcery.com> Date: Tue, 04 Jun 2013 00:48:00 -0000 Message-ID: Subject: Re: [PATCH] Don't set dir separator if path has drive spec From: Doug Evans To: Yao Qi Cc: gdb-patches Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQnDJZ2lOjbz3DxlmEQP6EIBsHJrqrIgZa5saLW6JZPmSrrNZVgjPMzujSZch3DF4L0dPRX2VexAblzZp7KvRPCHacsm4OPdMCriSyO+1MV/oNqwPlxQIV+k+yhxXZ3B4nEnPdJB7SEIgln9cO5WHGq4S7Wq93hYwy6GGdWG/unycmqdpUl6h9MOst/SZ4TI6rgeMTU68LUcrlvw3POaOsscUd+vTQ== X-SW-Source: 2013-06/txt/msg00029.txt.bz2 On Mon, Jun 3, 2013 at 5:33 PM, Yao Qi wrote: > 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, Hi. Looks right to me.