From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8589 invoked by alias); 30 Jul 2018 15:33:30 -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 7408 invoked by uid 89); 30 Jul 2018 15:33:29 -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,KAM_SHORT,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=desktop, silent, realistic, chances X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 30 Jul 2018 15:33:28 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w6UFXLia021210 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 30 Jul 2018 11:33:26 -0400 Received: by simark.ca (Postfix, from userid 112) id B3D411EF29; Mon, 30 Jul 2018 11:33:21 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 316B81E08D; Mon, 30 Jul 2018 11:33:20 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 30 Jul 2018 15:33:00 -0000 From: Simon Marchi To: Eli Zaretskii Cc: simon.marchi@ericsson.com, gdb-patches@sourceware.org Subject: Re: [PATCH v2 3/4] Add DWARF index cache In-Reply-To: <83sh44qslw.fsf@gnu.org> 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> <83sh44qslw.fsf@gnu.org> Message-ID: <329544a9d729cbf659887269a4ba4a06@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg00769.txt.bz2 On 2018-07-27 17:24, Eli Zaretskii wrote: > 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 you see a realistic use case where this information would be useful to users, I am fine with including it. But I can't really think of any, and mentioning it would more or less paint us into a corner should we need to change it. Cache files are meant to be written and read by GDB, not to be interoperable with other programs. >> >> + /* 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. It builds fine with x86_64-w64-mingw32-g++ on Linux here. It looks like gnulib offers a compatibility fix, so I guess it's ok: https://www.gnu.org/software/gnulib/manual/html_node/mkdir.html Did you see an actual failure? >> > 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. Ah, I didn't know that, thanks. So it produces DWARF embedded in the PE executable? Then yes, it would be useful. Thanks, Simon