From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 93842385843A; Tue, 5 Mar 2024 23:38:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 93842385843A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1709681927; bh=WvtmUthoKwfOXDJKcpQLNNFSvLysVms2WD4gDjQTusA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UPjxbHZM/aH9B9t1MKPJQRaGoW3wVeLl/C8L96PpHRv37LupJ0FQLe4RI+ymr9dHi NhWfngOOPd+Hnzga9Wb//6h0V5hgdn34/6CYGO3hxh0tXkQojcEB4sbUSi/KAjrVN+ MYuMJ72sjAQ/rbkIUEUlDdJPXe5ERpbF8AUogokI= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug testsuite/31452] [gdb/testsuite] FAIL: gdb.python/py-format-address.exp: symbol_filename=on: gdb.format_address, result should have an offset Date: Tue, 05 Mar 2024 23:38:47 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: testsuite X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31452 --- Comment #1 from Tom de Vries --- Tentative patch: ... diff --git a/gdb/testsuite/gdb.python/py-format-address.c b/gdb/testsuite/gdb.python/py-format-address.c index 2a0e9163db5..626bb41a220 100644 --- a/gdb/testsuite/gdb.python/py-format-address.c +++ b/gdb/testsuite/gdb.python/py-format-address.c @@ -28,5 +28,6 @@ FUNCTION_NAME (void) int main (void) { - return FUNCTION_NAME (); + int res =3D 0; + return res + FUNCTION_NAME (); } diff --git a/gdb/testsuite/gdb.python/py-format-address.exp b/gdb/testsuite/gdb.python/py-format-address.exp index 8e7cf47e03a..0fd1e63b13f 100644 --- a/gdb/testsuite/gdb.python/py-format-address.exp +++ b/gdb/testsuite/gdb.python/py-format-address.exp @@ -40,7 +40,9 @@ if ![runto_main] { # for the program space and architecture (these will be selected based # on the current inferior). set main_addr [get_hexadecimal_valueof "&main" "UNKNOWN"] -set next_addr [format 0x%x [expr $main_addr + 1]] + +gdb_test "next" "$decimal\[ \t\]+return .*" +set next_addr [get_hexadecimal_valueof {$pc} "UNKNOWN"] foreach_with_prefix symbol_filename { on off } { gdb_test_no_output "set print symbol-filename ${symbol_filename}" @@ -56,7 +58,7 @@ foreach_with_prefix symbol_filename { on off } { "gdb.format_address, result should have no offset" gdb_test "python print(\"Got: \" + gdb.format_address($next_addr))" \ - "Got: $next_addr " \ + "Got: $next_addr " \ "gdb.format_address, result should have an offset" } ... --=20 You are receiving this mail because: You are on the CC list for the bug.=