From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10289 invoked by alias); 27 Apr 2019 16:39:35 -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 9989 invoked by uid 89); 27 Apr 2019 16:39:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1738 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 27 Apr 2019 16:39:33 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKQMN-0002ni-Ga; Sat, 27 Apr 2019 12:39:31 -0400 Received: from [176.228.60.248] (port=4009 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hKQMM-0006IQ-Qr; Sat, 27 Apr 2019 12:39:31 -0400 Date: Sat, 27 Apr 2019 16:39:00 -0000 Message-Id: <83ftq3v1vv.fsf@gnu.org> From: Eli Zaretskii To: Simon Marchi CC: gdb-patches@sourceware.org In-reply-to: <491fba49-4be5-ef4e-c75e-8b8845673360@simark.ca> (message from Simon Marchi on Sat, 27 Apr 2019 12:16:23 -0400) Subject: Re: Fix lookup of separate debug file on MS-Windows References: <83ef5ze84y.fsf@gnu.org> <03da9895-5136-1da6-8c37-c4be0d06b608@gmail.com> <8336mfdumf.fsf@gnu.org> <831s1va7h8.fsf@gnu.org> <2697b965-e108-5e7c-75d3-9baa7493141c@simark.ca> <835zr68kiw.fsf@gnu.org> <491fba49-4be5-ef4e-c75e-8b8845673360@simark.ca> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes X-SW-Source: 2019-04/txt/msg00604.txt.bz2 > Cc: gdb-patches@sourceware.org > From: Simon Marchi > Date: Sat, 27 Apr 2019 12:16:23 -0400 > > I think we should consider the case where we build GDB on GNU/Linux, to remotely > debug a Windows program. When building on GNU/Linux, HAS_DRIVE_SPEC always return false, > since it's defined as (see include/filenames.h): > > #define HAS_DRIVE_SPEC(f) (0) > > Let's suppose DEBUGDIR is "D:/my/debug", DIR is "target:E:/the/directory/" and DEBUGLINK > is "program.debug". On GNU/Linux, we would build the path > > target:D:/my/debug/E:/the/directory/program.debug > > And I suppose that the "E:" would result in the debug file not being found. When debugging remotely, is the debug info on a Windows or on a GNU/Linux filesystem? If the latter, the above will work. I always thought that in remote debugging, GDB itself runs on the local host, i.e. on GNU/Linux in this case, and the part that runs on the remote is gdbserver. Isn't that correct? > So I think we should be using HAS_DRIVE_SPEC_1, which allows us to do the same check. We > just need to pass to the macro whether the target filesystem id DOS-based. The only problem > is, how do we know whether the target filesystem is DOS-based? We wouldn't want > HAS_DRIVE_SPEC_1 to do this stripping erroneously when debugging natively on GNU/Linux... But if we do that, how do we distinguish between the use case you describe above and a use case where the we debug locally and the file names just happen to include colons? Are we willing to restrict file names on GNU/Linux to support the remote debugging on Windows? Thanks for the other comments, I will implement them when we agree about the above issue.