From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 2BF2F3858D33 for ; Sat, 1 Jul 2023 05:46:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2BF2F3858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFTRT-0005Ta-MA; Sat, 01 Jul 2023 01:46:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=DqcgtR7jL6J0praMGCIhyjPNy9wVMMjaK8tSWXbWIoE=; b=WyqlDOst3sE+ eJCQAp/PUqU5poyNxJpUBcrfGRu87bg4PF6woT9VhGKaC0SKILM5SYMhsbxN7wdErm5yhFybGyap3 fMTzkfsFpmjDWrS8xDM1rPbqGX5nz9h4R7xVMiTYLPPeG/LxHFGvuFIaxFjjaX7cQ8iqwTZYkFhSd cbzmS6gWrbn6pbLuM5T5dXvlmqPcf5KoI1ogXhWKLqvPxElLEASCa2vn5AdD6wJ7rKlgDuOkXjVGr ZsUzVkUR7z7HUtAw1+fQD6eAzFGhlAIP4EXNmq+a//U5pLLZNvBiuKysqRF6VCJxs+hyUf4OxcayR wyTgPU2HqBi6+N/YF6DcLA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFTRR-0007MT-ST; Sat, 01 Jul 2023 01:46:43 -0400 Date: Sat, 01 Jul 2023 08:47:14 +0300 Message-Id: <83bkgwrxnh.fsf@gnu.org> From: Eli Zaretskii To: Matheus Branco Borella Cc: gdb-patches@sourceware.org In-Reply-To: <20230630203642.83819-1-dark.ryu.550@gmail.com> (message from Matheus Branco Borella via Gdb-patches on Fri, 30 Jun 2023 17:36:43 -0300) Subject: Re: [PATCH] Add name_of_main and language_of_main to the DWARF index References: <87cz247exd.fsf@tromey.com> <20230630203642.83819-1-dark.ryu.550@gmail.com> X-Spam-Status: No, score=1.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Cc: Matheus Branco Borella > Date: Fri, 30 Jun 2023 17:36:43 -0300 > From: Matheus Branco Borella via Gdb-patches > > Alright, this one should incorporate all of the changes you suggested. And, now > that I've sorted out my copyright assignment, this should be good to go now? > Unless I missed something. Your assignment is not on file yet, AFAICT. Was the paperwork completed, i.e. did you get a copy of the assignment signed by you and by the FSF? If not, you need to wait some more. > This patch adds a new section to the DWARF index containing the name > and the language of the main function symbol, gathered from > `cooked_index::get_main`, if available. Currently, for lack of a better name, > this section is called the "shortcut table". The way this name is both saved and > applied upon an index being loaded in mirrors how it is done in > `cooked_index_functions`, more specifically, the full name of the main function > symbol is saved and `set_objfile_main_name` is used to apply it after it is > loaded. > > The main use case for this patch is in improving startup times when dealing with > large binaries. Currently, when an index is used, GDB has to expand symtabs > until it finds out what the language of the main function symbol is. For some > large executables, this may take a considerable amount of time to complete, > slowing down startup. This patch bypasses that operation by having both the name > and language of the main function symbol be provided ahead of time by the index. > > In my testing (a binary with about 1.8GB worth of DWARF data) this change brings > startup time down from about 34 seconds to about 1.5 seconds. > --- > gdb/NEWS | 2 ++ > gdb/doc/gdb.texinfo | 23 +++++++++++++-- > gdb/dwarf2/index-write.c | 47 +++++++++++++++++++++++++++---- > gdb/dwarf2/read-gdb-index.c | 56 +++++++++++++++++++++++++++++++++++-- > gdb/dwarf2/read.c | 13 +++++++-- > gdb/dwarf2/read.h | 12 ++++++++ > 6 files changed, 142 insertions(+), 11 deletions(-) Thanks. The documentation parts are OK, but please fix the text to leave two spaces between sentences, not one. Reviewed-By: Eli Zaretskii