From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from progateway7-pub.mail.pro1.eigbox.com (gproxy5-pub.mail.unifiedlayer.com [67.222.38.55]) by sourceware.org (Postfix) with ESMTPS id 4D1EA3858D32 for ; Fri, 7 Apr 2023 15:25:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4D1EA3858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from cmgw10.mail.unifiedlayer.com (unknown [10.0.90.125]) by progateway7.mail.pro1.eigbox.com (Postfix) with ESMTP id 9453D1004741A for ; Fri, 7 Apr 2023 15:25:40 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id kny8poKEqFhsVkny8pK5pK; Fri, 07 Apr 2023 15:25:40 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=ELjDb3VC c=1 sm=1 tr=0 ts=643035f4 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10:nop_charset_1 a=dKHAf1wccvYA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=zstS-IiYAAAA:8 a=Wbp1zMlJv4lhXT3toE4A:9 a=QEXdDO2ut3YA:10:nop_charset_2 a=4G6NA9xxw8l3yy4pmD5M:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=To:Content-Transfer-Encoding:Content-Type:MIME-Version: Message-Id:Date:Subject:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=NQsILY/2potCo5R4DKylOpCHgjyUCfOQY4VYpsMG0qI=; b=ugxwOgr2eOB6K6G9ohM8mvLwLL R+9poPKNQeO+gRKMxcmKkqs3M+rSQuux89CfG9nRbDr6Tflr0EWu/z0Jq9nOZ1VRQDwVxCO3Xwkm1 Ji7RZEVoryDoOxuJqPQitOg7x; Received: from 75-166-159-36.hlrn.qwest.net ([75.166.159.36]:60392 helo=[192.168.0.21]) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pkny8-001hDU-EQ for gdb-patches@sourceware.org; Fri, 07 Apr 2023 09:25:40 -0600 From: Tom Tromey Subject: [PATCH 00/19] Add hash table to gdbsupport Date: Fri, 07 Apr 2023 09:25:32 -0600 Message-Id: <20230407-t-robin-hood-hash-v1-0-900d93ef1510@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAOw1MGQC/x2N0QrCMAwAf2Xk2UC3ygR/RXxI22zJg60kQ4Sxf 7fz8TiO28HZlB3uww7GH3VttcN4GSAL1ZVRS2eYwhTDNdxwQ2tJK0prBYVckMOYU6S5xDJD7xI 5YzKqWc7yRb6xneJtvOj3P3s8j+MHcIaSynwAAAA= To: gdb-patches@sourceware.org X-Mailer: b4 0.12.1 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.159.36 X-Source-L: No X-Exim-ID: 1pkny8-001hDU-EQ X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-159-36.hlrn.qwest.net ([192.168.0.21]) [75.166.159.36]:60392 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3020.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: I recently read an article about hash tables and was inspired to write a new one for gdb. I haven't converted all the libiberty htab uses in gdb, but this series does change enough of them to, I think, show that the new implementation is workable. The benefits of this approach are explained in the first patch. Regression tested on x86-64 Fedora 36. This found a latent bug in one use of htab_t, see the typedefs patch. Let me know what you think. --- Tom Tromey (19): Add a hash table to gdbsupport Convert compile-c-symbols.c to new hash table Convert filename-seen-cache.h to new hash table Convert linespec.c to new hash table Convert target-descriptions.c to new hash table Convert dwarf2/macro.c to new hash table Convert breakpoint.c to new hash table Convert py-framefilter.c to new hash table Convert disasm.c to new hash table Convert compile/compile.c to new hash table Convert type copying to new hash table Convert static links to new hash table Convert gnu-v3-abi.c to new hash table Convert abbrev cache to new hash table Convert abbrevs to new hash table Convert typedef hash to new hash table Convert all_bfds to new hash table Convert more DWARF code to new hash table Convert gdb_bfd.c to new hash table gdb/Makefile.in | 2 +- gdb/breakpoint.c | 16 +- gdb/compile/compile-c-symbols.c | 54 ++-- gdb/compile/compile-object-run.c | 4 +- gdb/compile/compile.c | 151 +-------- gdb/compile/compile.h | 10 +- gdb/disasm.c | 72 ++--- gdb/dwarf2/abbrev-cache.c | 35 +- gdb/dwarf2/abbrev-cache.h | 37 ++- gdb/dwarf2/abbrev.c | 46 --- gdb/dwarf2/abbrev.h | 54 +++- gdb/dwarf2/cu.c | 50 +-- gdb/dwarf2/cu.h | 10 +- gdb/dwarf2/macro.c | 21 +- gdb/dwarf2/read.c | 55 ++-- gdb/extension-priv.h | 3 +- gdb/extension.c | 3 +- gdb/extension.h | 4 +- gdb/filename-seen-cache.c | 59 ---- gdb/filename-seen-cache.h | 35 +- gdb/gdb_bfd.c | 137 +++----- gdb/gdbtypes.c | 59 +--- gdb/gdbtypes.h | 7 +- gdb/gnu-v3-abi.c | 101 +++--- gdb/guile/guile-internal.h | 2 +- gdb/guile/scm-type.c | 9 +- gdb/guile/scm-value.c | 3 +- gdb/linespec.c | 53 +-- gdb/objfiles.c | 74 +---- gdb/objfiles.h | 4 +- gdb/python/py-framefilter.c | 25 +- gdb/python/py-type.c | 6 +- gdb/python/py-value.c | 3 +- gdb/python/python-internal.h | 2 +- gdb/symfile.c | 2 +- gdb/target-descriptions.c | 17 +- gdb/testsuite/gdb.cp/ptype-flags.exp | 25 +- gdb/testsuite/gdb.gdb/python-helper.exp | 3 +- gdb/typeprint.c | 89 +----- gdb/typeprint.h | 29 +- gdb/unittests/hash-table-selftests.c | 128 ++++++++ gdb/value.c | 17 +- gdb/value.h | 4 +- gdbsupport/Makefile.am | 1 + gdbsupport/Makefile.in | 19 +- gdbsupport/hash-table.cc | 75 +++++ gdbsupport/hash-table.h | 551 ++++++++++++++++++++++++++++++++ 47 files changed, 1199 insertions(+), 967 deletions(-) --- base-commit: 929a05081ec2ca6448927b96f673b0cd9633a342 change-id: 20230407-t-robin-hood-hash-e01cb3a6d3d6 Best regards, -- Tom Tromey