From patchwork Thu Oct 19 09:15:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 78145 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7BCDE3858428 for ; Thu, 19 Oct 2023 09:14:43 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 5C4233858D1E for ; Thu, 19 Oct 2023 09:14:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5C4233858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5C4233858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.220.29 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697706871; cv=none; b=oyPKkVJoz4h5Qxz3dCsAKl5L7/AZJ5AF68rw3+4qy4OhcUdo+3Ub75BJv0RbfGrxYq4Lt328v2wvmq1vcGHf7SI+6QYmZKRm14+fk6PW0SbGtGBkXuSHDVJ19JfIJ5+5HlPOYQi2ksWt1EToCmHzw3KZfZnlETp4wYyF5CdZhVM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697706871; c=relaxed/simple; bh=kpF4va6q+dVAsWr+WRJcq0rzxPVfS1GZH26E3IGYXag=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=Uhri/A+7y/CT5PIwGvGRGnA/nAzvCJBTWqZeryOGbc2u3U6Ep6Ans9RzfyqEEz4tFDio3OTi8u3iklz/Xs0iD9FPPmtNWWy8eDu9yBFXl+Hx+eRpsEqLMlH8zpIEnCfKDsIbvHVv+ftQMlmFibkvYNNlzJl/qfC1DF9+vyPWId0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7F6301F459 for ; Thu, 19 Oct 2023 09:14:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1697706868; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=aRjDlmdats8BZ2bRpZtQ/PHzsUm21ev5ui9C9AYfkCA=; b=x3WsgX7Jm28Wrv9QRmCOehISkGRwJ/fcj6JmixxpayzsnytVKfLi0lOU07sTNOueMc65ac JRlKqGsoLooOK9BiBqho00h6x3L5vnwoqYYWmZ2/1XmUVYYoqok5oagp4LnU8DOJj2sAJG LRqVYRFVoypHU9REhSENyxPWKHQZa9M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1697706868; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=aRjDlmdats8BZ2bRpZtQ/PHzsUm21ev5ui9C9AYfkCA=; b=WXYa5+ud+T4VoXZRX1lcRLIL2ZEqla72PHXbRpQ/jEakJCR43YoOVB9V3e8qVSzvUFq5Sd fPz65SqTqp5jr9CQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6A09C139C2 for ; Thu, 19 Oct 2023 09:14:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id AQHCGHTzMGUlVAAAMHmgww (envelope-from ) for ; Thu, 19 Oct 2023 09:14:28 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH] [gdb/symtab] Fix more style issues in v9 .gdb_index section support Date: Thu, 19 Oct 2023 11:15:03 +0200 Message-Id: <20231019091503.21850-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -2.10 X-Spamd-Result: default: False [-2.10 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; RCPT_COUNT_ONE(0.00)[1]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_LONG(-3.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org I noticed a few more style issues in commit 8b9c08eddac ("[gdb/symtab] Add name_of_main and language_of_main to the DWARF index"), after checking it with gcc's check_GNU_style.{sh,py}. Fix these. Build on x86_64-linux. Reviewed-By: Eli Zaretskii --- gdb/NEWS | 2 +- gdb/dwarf2/index-write.c | 2 +- gdb/dwarf2/read-gdb-index.c | 8 ++++---- gdb/dwarf2/read.c | 2 +- gdb/dwarf2/read.h | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) base-commit: d08515a68e5b44f5e0b045e371a996e4196226ed diff --git a/gdb/NEWS b/gdb/NEWS index 08d779010f0..30b8cadf825 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -3,7 +3,7 @@ *** Changes since GDB 14 -* GDB index now contains information about the main function. This speeds up +* GDB index now contains information about the main function. This speeds up startup when it is being used for some large binaries. * Python API diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c index bac4a6c6934..5ac7b10f89e 100644 --- a/gdb/dwarf2/index-write.c +++ b/gdb/dwarf2/index-write.c @@ -1193,7 +1193,7 @@ write_cooked_index (cooked_index *table, } } -/* Write shortcut information. */ +/* Write shortcut information. */ static void write_shortcuts_table (cooked_index *table, data_buf &shortcuts, diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c index 34c5dfd5803..e789e9c2654 100644 --- a/gdb/dwarf2/read-gdb-index.c +++ b/gdb/dwarf2/read-gdb-index.c @@ -88,7 +88,7 @@ struct mapped_gdb_index final : public mapped_index_base /* A pointer to the constant pool. */ gdb::array_view constant_pool; - /* The shortcut table data. */ + /* The shortcut table data. */ gdb::array_view shortcut_table; /* Return the index into the constant pool of the name of the IDXth @@ -771,7 +771,7 @@ create_addrmap_from_gdb_index (dwarf2_per_objfile *per_objfile, = new (&per_bfd->obstack) addrmap_fixed (&per_bfd->obstack, &mutable_map); } -/* Sets the name and language of the main function from the shortcut table. */ +/* Sets the name and language of the main function from the shortcut table. */ static void set_main_name_from_gdb_index (dwarf2_per_objfile *per_objfile, @@ -780,7 +780,7 @@ set_main_name_from_gdb_index (dwarf2_per_objfile *per_objfile, const auto expected_size = 2 * sizeof (offset_type); if (index->shortcut_table.size () < expected_size) /* The data in the section is not present, is corrupted or is in a version - we don't know about. Regardless, we can't make use of it. */ + we don't know about. Regardless, we can't make use of it. */ return; auto ptr = index->shortcut_table.data (); @@ -794,7 +794,7 @@ set_main_name_from_gdb_index (dwarf2_per_objfile *per_objfile, if (dw_lang == 0) { /* Don't bother if the language for the main symbol was not known or if - there was no main symbol at all when the index was built. */ + there was no main symbol at all when the index was built. */ return; } ptr += 4; diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index c85eaac3035..4b18c1efb6f 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -17819,7 +17819,7 @@ leb128_size (const gdb_byte *buf) } } -/* Converts DWARF language names to GDB language names. */ +/* Converts DWARF language names to GDB language names. */ enum language dwarf_lang_to_enum_language (unsigned int lang) diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h index c92474d8b9d..4acdcd5306f 100644 --- a/gdb/dwarf2/read.h +++ b/gdb/dwarf2/read.h @@ -246,11 +246,11 @@ struct dwarf2_per_cu_data std::vector *imported_symtabs = nullptr; /* The original DW_LANG_* value of the CU, as provided to us by - DW_AT_language. It is interesting to keep this value around in cases where + DW_AT_language. It is interesting to keep this value around in cases where we can't use the values from the language enum, as the mapping to them is lossy, and, while that is usually fine, things like the index have an understandable bias towards not exposing internal GDB structures to the - outside world, and so prefer to use DWARF constants in their stead. */ + outside world, and so prefer to use DWARF constants in their stead. */ dwarf_source_language dw_lang; /* Return true of IMPORTED_SYMTABS is empty or not yet allocated. */ @@ -772,7 +772,7 @@ struct dwarf2_per_objfile std::unique_ptr> m_dwarf2_cus; }; -/* Converts DWARF language names to GDB language names. */ +/* Converts DWARF language names to GDB language names. */ enum language dwarf_lang_to_enum_language (unsigned int lang);