From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73149 invoked by alias); 27 Jul 2018 21:25:12 -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 73068 invoked by uid 89); 27 Jul 2018 21:25:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,SPF_PASS autolearn=ham version=3.3.2 spammy=Indeed, simonmarchipolymtlca, simon.marchi@polymtl.ca, D*polymtl.ca X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Jul 2018 21:25:04 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fjAEM-0003rc-Ml for gdb-patches@sourceware.org; Fri, 27 Jul 2018 17:25:02 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39110) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fjAEM-0003rT-ID; Fri, 27 Jul 2018 17:24:58 -0400 Received: from [176.228.60.248] (port=4005 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fjAEM-00040V-0x; Fri, 27 Jul 2018 17:24:58 -0400 Date: Fri, 27 Jul 2018 21:25:00 -0000 Message-Id: <83sh44qslw.fsf@gnu.org> From: Eli Zaretskii To: Simon Marchi CC: simon.marchi@ericsson.com, gdb-patches@sourceware.org In-reply-to: (message from Simon Marchi on Fri, 27 Jul 2018 10:01:43 -0400) Subject: Re: [PATCH v2 3/4] Add DWARF index cache References: <1532558824-829-1-git-send-email-simon.marchi@ericsson.com> <1532558824-829-4-git-send-email-simon.marchi@ericsson.com> <83o9etrqsj.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg00751.txt.bz2 > Date: Fri, 27 Jul 2018 10:01:43 -0400 > From: Simon Marchi > Cc: Simon Marchi , gdb-patches@sourceware.org > > On 2018-07-27 05:06, Eli Zaretskii wrote: > >> From: Simon Marchi > >> CC: Simon Marchi > >> Date: Wed, 25 Jul 2018 18:47:03 -0400 > >> > >> GDB can generate indexes for DWARF debug information, which, when > >> integrated in the original binary, can speed up loading object files. > >> This can be done using the gdb-add-index script or directly by the > >> linker itself. > > > > The information in the last sentence is not mentioned in the > > documentation patch you provided. I think we should mention that. > > I think this is already well covered by the rest of the "18.5 Index > Files Speed Up GDB" section, just before the content I added, isn't it? Ah, yes, you are right. > >> - The saved index file is exactly the same as the output of the "save > >> gdb-index" command. It is therefore the exact same content that > >> would > >> be found in the .gdb_index or .debug_names section. We just leave > >> it > >> as a standalone file instead of merging it in the binary. > > > > This should be mentioned in the documentation, IMO. > > Ok, I thought this was an internal GDB implementation detail (which > could be subject to change), but I can add it if you think it is > important. If we think this details is likely to change, or have other good reasons not divulge this, I'm okay with keeping silent about it. But if chances are this will stay forever (or thereabouts), I think the details is important enough to tell the users. > >> + /* If we get EEXIST and the existing path is a directory, then > >> we're > >> + happy. If it exists, but it's a regular file and this is > >> not the last > >> + component, we'll fail at the next component. If this is the > >> last > >> + component, the caller will fail with ENOTDIR when trying to > >> + open/create a file under that path. */ > >> + if (mkdir (start, 0700) != 0) > > > > This will not work on Windows. > > Which part of it? mkdir accepts only one argument, not 2. > > Does this mean this feature will only work on systems with mmap? > > Indeed. There is an equivalent API for Windows though I think: > > https://docs.microsoft.com/en-us/windows/desktop/Memory/file-mapping > > I can't really do the Windows bits, because I just don't have the > competence to write software for Windows. Every time I tried to build > GDB for Windows, I failed miserably (do we have a guide for that?). So > my thought (including for the mkdir_recursive function) was that > somebody who used Windows could later implement the missing parts. Fair enough. > Also, I guess that somebody debugging native executables on Windows > wouldn't have a use for the cache, because indices only work for DWARF > debug info. MinGW uses DWARF debug info for quite a few years now, so caching will definitely be useful. Thanks.