From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id EZpDA0xssWp49C0AWB0awg (envelope-from ) for ; Mon, 21 Sep 2026 13:41:32 -0400 Received: by simark.ca (Postfix, from userid 112) id 09F1F1E01F; Mon, 21 Sep 2026 13:41:32 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D39981E01F for ; Mon, 21 Sep 2026 13:41:30 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A84334BA79B3 for ; Mon, 21 Sep 2026 17:41:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A84334BA79B3 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 0E1EB4BA23E6; Mon, 21 Sep 2026 17:39:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0E1EB4BA23E6 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0E1EB4BA23E6 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790012393; cv=none; b=YkdjTS9MX2nsBW2IPLHfwd3PBcS8qcpqTorrmLjkVvr3YUBJ58yhK9OuoTapm7tvccMGkVyzK3tvD1z7BuWllaGgXRaJfhBN2BuP1HSkr9u6EIufjfg/VuJmahKSaXS7uJDuZB+AI5qOvwHICawlV4APyjjRT5C0QCq11mrygJs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790012393; c=relaxed/simple; bh=To1x25sblxDDHnNKLvkehXKtXxVVnxHxO21SchDSlwU=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=OtC+uK9cBSyJo/x1568dOZx6JVW4tAqyBDAZmks+ExJLRlGZAkWQdLEOoztliWYbK1In+uUb8Klbg6wBiwiq9oKCXt6BeorPxUWIr5abnQ1ZHX2RwBr+Bf7uLKgPVUnnbBDPI6rPismeuQx3coSwOCZEpBc7qp0/ExBeuzmzK0c= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0E1EB4BA23E6 Received: by simark.ca (Postfix) id 451911E01F; Mon, 21 Sep 2026 13:39:51 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org, binutils@sourceware.org Cc: Simon Marchi Subject: [PATCH v2 0/4] Fix reading DW_FORM_addrx with address size of 2 Date: Mon, 21 Sep 2026 13:39:40 -0400 Message-ID: <20260921173951.688121-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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~public-inbox=simark.ca@sourceware.org This is version 2 of this patch: https://inbox.sourceware.org/gdb-patches/af0e0cb7-b012-4e78-b567-c232eca8222d@polymtl.ca/T/#mb7baec6653460d149a84aa538dc6faa64c28d65b I split out the DWARF assembler changes in its own patch, since it's now a bit more substantial (patch 1). I added a patch that validates the address sizes read from DWARF against a set of known values (patch 2). I added a patch that removes an unnecessary segment_collector_size field (patch 3).. Finally, patch 4 is the actual new version of the original patch. The main change is the way to computation is done, to try to be more robust against various cases of overflow. Simon Marchi (4): gdb/testsuite: add support for DWARF 5 .debug_addr sections to DWARF assembler gdb/dwarf: validate address sizes when reading DWARF headers gdb/dwarf: don't store segment_collector_size (sic) gdb/dwarf: fix reading DW_FORM_addrx with address size of 2 gdb/dwarf2/aranges.c | 4 +- gdb/dwarf2/frame.c | 13 +- gdb/dwarf2/read.c | 54 +++++---- gdb/dwarf2/read.h | 4 + gdb/dwarf2/types.h | 8 ++ gdb/dwarf2/unit-head.c | 7 ++ gdb/dwarf2/unit-head.h | 5 + gdb/testsuite/gdb.dwarf2/dw2-addr-size-2.c | 22 ++++ gdb/testsuite/gdb.dwarf2/dw2-addr-size-2.exp | 75 ++++++++++++ gdb/testsuite/lib/dwarf.exp | 118 +++++++++++++++++-- 10 files changed, 274 insertions(+), 36 deletions(-) create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-addr-size-2.c create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-addr-size-2.exp base-commit: 3e5100fe3b15e2b3ece60f57b4c1ecc0c50cae53 -- 2.55.0