Message ID | 20230404175915.288558-2-thiago.bauermann@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> 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 40B88385B506 for <patchwork@sourceware.org>; Tue, 4 Apr 2023 17:59:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 40B88385B506 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1680631192; bh=7zcMBQhg0YYjZgVqlY/NprXOclZnbxTZzwSQyQCSVKo=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=ddLwNhBHMHO/5h8geFuvlqwZe11uHut33V/iPZbVNLkCEj8vakdcry0qgKr7b3IRp jlLaQFlf+CRTtv0+ITaUK/NnyS5jTGBPHBDCjPucz+sEuJ0CfymZgrjI/vZGmYyMwS cQTXI/B340l3GifGAmg+EN2z1+1u+OmvH8IraDlY= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) by sourceware.org (Postfix) with ESMTPS id 04BD13858C2C for <gdb-patches@sourceware.org>; Tue, 4 Apr 2023 17:59:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 04BD13858C2C Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-17fcc07d6c4so21474751fac.8 for <gdb-patches@sourceware.org>; Tue, 04 Apr 2023 10:59:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680631168; x=1683223168; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7zcMBQhg0YYjZgVqlY/NprXOclZnbxTZzwSQyQCSVKo=; b=gk4z4ddvLBFObMCD2rWdUjeHVjmaJ9+F1iKdClLi/1uxTRn+qAXTYbJ/2cXCORqij8 1GjuGY+gJCCOvauxGFvjDdLOhH/n/OhG5JmBPQyNUdtWUlicF/dipGCfreg/hYaJ7PxJ zS7NTlA5/rjl4Hvyd/3GwuujwQIJlUbbAHhNMnOojy1Vdtf+e0tLO63olvnGo1NWiFRl 5d3A86B0U6J6lgcgerblC5LLdMvqLojPIOC3//yqfsgKBw7p5ViRSNSlYPiYZfXBAVFY BdClerpifHtfr+UaVK428by42cs3LNklm09o9SKoa3D2d9fOypknoPnbVMWrsA+UvpGv FMMg== X-Gm-Message-State: AAQBX9c6iZYUbuDHwveYMVfHUwlWpt7q3ZKYT+9oCh2CDkUGkTQ7j6ag KWE7KodF1R9NiUnxzS6jaTZmfuqaG3oOWItKxUc= X-Google-Smtp-Source: AKy350bNhuvd8HBm52c65RsOsJF3qdDxj+3KFe8HXIM3o4xwpG4hqSNiuIwynETA0CMDdDmwHYJ0IQ== X-Received: by 2002:a05:6870:e74c:b0:177:81bb:1b23 with SMTP id t12-20020a056870e74c00b0017781bb1b23mr2052122oak.38.1680631168309; Tue, 04 Apr 2023 10:59:28 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8470:d038:6863:874f:ebaa]) by smtp.gmail.com with ESMTPSA id bd27-20020a056871b31b00b00177be9585desm2626807oac.1.2023.04.04.10.59.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 10:59:27 -0700 (PDT) To: gdb-patches@sourceware.org Cc: Thiago Jung Bauermann <thiago.bauermann@linaro.org> Subject: [PATCH 1/2] gdb: Fix reading of partial symtabs in dbxread.c Date: Tue, 4 Apr 2023 17:59:14 +0000 Message-Id: <20230404175915.288558-2-thiago.bauermann@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230404175915.288558-1-thiago.bauermann@linaro.org> References: <20230404175915.288558-1-thiago.bauermann@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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.29 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: Thiago Jung Bauermann via Gdb-patches <gdb-patches@sourceware.org> Reply-To: Thiago Jung Bauermann <thiago.bauermann@linaro.org> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
Fix regression in stabs debug info
|
|
Commit Message
Thiago Jung Bauermann
April 4, 2023, 5:59 p.m. UTC
After commit 9675da25357c ("Use unrelocated_addr in minimal symbols"), aarch64-linux started failing gdb.asm/asm-source.exp: Running /home/thiago.bauermann/src/binutils-gdb/gdb/testsuite/gdb.asm/asm-source.exp ... PASS: gdb.asm/asm-source.exp: f at main PASS: gdb.asm/asm-source.exp: n at main PASS: gdb.asm/asm-source.exp: next over macro FAIL: gdb.asm/asm-source.exp: step into foo2 PASS: gdb.asm/asm-source.exp: info target PASS: gdb.asm/asm-source.exp: info symbol PASS: gdb.asm/asm-source.exp: list PASS: gdb.asm/asm-source.exp: search FAIL: gdb.asm/asm-source.exp: f in foo2 FAIL: gdb.asm/asm-source.exp: n in foo2 (the program exited) FAIL: gdb.asm/asm-source.exp: bt ALL in foo2 FAIL: gdb.asm/asm-source.exp: bt 2 in foo2 PASS: gdb.asm/asm-source.exp: s 2 PASS: gdb.asm/asm-source.exp: n 2 FAIL: gdb.asm/asm-source.exp: bt 3 in foo3 PASS: gdb.asm/asm-source.exp: info source asmsrc1.s FAIL: gdb.asm/asm-source.exp: finish from foo3 (the program is no longer running) FAIL: gdb.asm/asm-source.exp: info source asmsrc2.s PASS: gdb.asm/asm-source.exp: info sources FAIL: gdb.asm/asm-source.exp: info line FAIL: gdb.asm/asm-source.exp: next over foo3 (the program is no longer running) FAIL: gdb.asm/asm-source.exp: return from foo2 PASS: gdb.asm/asm-source.exp: look at global variable PASS: gdb.asm/asm-source.exp: x/i &globalvar PASS: gdb.asm/asm-source.exp: disassem &globalvar, (int *) &globalvar+1 PASS: gdb.asm/asm-source.exp: look at static variable PASS: gdb.asm/asm-source.exp: x/i &staticvar PASS: gdb.asm/asm-source.exp: disassem &staticvar, (int *) &staticvar+1 PASS: gdb.asm/asm-source.exp: look at static function The problem is simple: a pair of parentheses was removed from the expression calculating text_end and thus text_size was only added if lowest_text_address wasn't equal to -1. This patch restores the previous behaviour and fixes the testcase. Tested on native aarch64-linux. --- gdb/dbxread.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gdb/dbxread.c b/gdb/dbxread.c index f7c44c14ae2e..73371edd8412 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -1950,9 +1950,9 @@ read_dbx_symtab (minimal_symbol_reader &reader, is. */ unrelocated_addr text_end = (unrelocated_addr - (lowest_text_address == (unrelocated_addr) -1 - ? text_addr - : CORE_ADDR (lowest_text_address) + ((lowest_text_address == (unrelocated_addr) -1 + ? text_addr + : CORE_ADDR (lowest_text_address)) + text_size)); dbx_end_psymtab (objfile, partial_symtabs,