From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122014 invoked by alias); 25 Jul 2018 20:20:00 -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 122001 invoked by uid 89); 25 Jul 2018 20:19:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=upgrading 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; Wed, 25 Jul 2018 20:19:58 +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 w6PKJpiP009893 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 25 Jul 2018 16:19:56 -0400 Received: by simark.ca (Postfix, from userid 112) id BE0701EF2A; Wed, 25 Jul 2018 16:19:51 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 2BDCE1E077; Wed, 25 Jul 2018 16:19:49 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 25 Jul 2018 20:20:00 -0000 From: Simon Marchi To: Tom Tromey Cc: Simon Marchi , gdb-patches@sourceware.org Subject: Re: [PATCH 3/3] Add DWARF index cache In-Reply-To: <87in5317b1.fsf@tromey.com> References: <1531173351-6351-1-git-send-email-simon.marchi@ericsson.com> <1531173351-6351-4-git-send-email-simon.marchi@ericsson.com> <87in5317b1.fsf@tromey.com> Message-ID: <0f83c762eff29bd89fe5f5a5f83dbe3a@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg00712.txt.bz2 On 2018-07-25 14:47, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> - The cache is disabled by default. I think once it's been out > there > Simon> and tested for a while, it could be turned on by default, so > that > Simon> everybody can enjoy it. > > I think the patch to enable it should also come with a patch to disable > it in the test suite, since otherwise "make check" is going to fill up > the cache and maybe have other unintended consequences. Indeed, the default behavior should probably be to test without the index cache. I also made a board file to test using the index cache. It overrides the gdb_load proc to load the binary file twice in GDB (the first time to populate the cache, the second time to read from it). I don't think it's very useful, so I didn't include in this series. > Simon> +static void > Simon> +set_index_cache_command (const char *arg, int from_tty) > Simon> +{ > Simon> + printf_unfiltered ("\ > Simon> +Missing arguments. See \"help set index-cache\" for help.\n"); > > This probably needs _(). I think there were a couple other > (non-debug-print) cases of this as well. Right, will fix. > Simon> + printf_unfiltered ("The index cache is currently %s.\n", > Simon> + global_index_cache.enabled () ? "enabled" : "disabled"); > > Like here. > > Simon> +static void > Simon> +test_mkdir_recursive () > Simon> +{ > Simon> + char base[] = "/tmp/gdb-selftests-XXXXXX"; > Simon> + > Simon> + if (mkdtemp (base) == NULL) > Simon> + perror_with_name ("mkdtemp"); > Simon> + > Simon> + std::string dir = string_printf ("%s/a/b", base); > Simon> + SELF_CHECK (create_dir_and_check (dir.c_str ())); > Simon> + > Simon> + dir = string_printf ("%s/a/b/c//d/e/", base); > Simon> + SELF_CHECK (create_dir_and_check (dir.c_str ())); > > It would be nice to clean up afterward. I'll try to do that. > Simon> diff --git a/gdb/dwarf-index-write.h b/gdb/dwarf-index-write.h > [...] > Simon> +void write_psymtabs_to_index (struct dwarf2_per_objfile > *dwarf2_per_objfile, > Simon> + const char *dir, const char *basename, > Simon> + dw_index_kind index_kind); > > I tend to prefer the explicit "extern" but I don't know if there's an > official style. Actually, the official style is to use extern (I still don't know why). I can add it. > This patch seems fine to me and I like this feature -- I would use it > for sure. > > I think it needs a doc + NEWS patch. Oh you're right. I forgot it when "upgrading" the patchset from RFC to RFA. > I think it would be good to file bugs for the future features you > mentioned in the email. Ok. Thanks for the review, I'll work on a v2. Simon