From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 6CF3E3858420; Thu, 18 Jan 2024 20:37:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6CF3E3858420 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1705610278; bh=Qv1OO1QUjNUw9l4LaRR0IQ6qBleUeudrCy66Wryw908=; h=From:To:Subject:Date:From; b=OFOrQS9AunP5+sUwbcS1GazgsrPoTw7UHQert1YfFXIaZHzJVdtEYSgPLbnd//lN9 5aW8uUfFEyQuWM4U6qVwYe5Ff6xBnw5YPKB3kcT2k1jSQEGmHjddlV64yDgMAX5zcU C29pjLFxVDKqMzX25GODK0xieiyzKaHHRpl1L18c= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Allow other results in DW_TAG_entry_point test X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: f8c024dcefce0f7f8867f6bfc44b500d998738fd X-Git-Newrev: 9b63bc4644da4c91bf93a2332f6701250abec7e2 Message-Id: <20240118203758.6CF3E3858420@sourceware.org> Date: Thu, 18 Jan 2024 20:37:58 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D9b63bc4644da= 4c91bf93a2332f6701250abec7e2 commit 9b63bc4644da4c91bf93a2332f6701250abec7e2 Author: Tom Tromey Date: Wed Jan 17 09:15:22 2024 -0700 Allow other results in DW_TAG_entry_point test =20 DW_TAG_entry_point is implemented by adding a new LOC_BLOCK symbol -- that is, another function symbol. However, the test case assumes that "bt" will never pick this symbol. =20 This assumption seems unwarranted to me, and in fact this test will regress with the debug-names target board after the .debug_names rewrite. =20 This patch changes the test to allow either answer in the backtrace. If only the main entry point is desired, then it seems that more work must be done to handle DW_TAG_entry_point properly, as nothing currently guarantees this property. Diff: --- gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp b/gdb/testsuite/= gdb.dwarf2/dw2-entry-points.exp index c0c7a7ca542..632a31111a2 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp @@ -207,7 +207,10 @@ if ![runto_main] { gdb_breakpoint "*fooso" gdb_continue_to_breakpoint "foo_so" =20 +# Note that because DW_TAG_entry_point is entered as a LOC_BLOCK +# symbol, exactly which symbol is shown in the stack trace depends on +# which symbol gdb happens to find first in the lookup. gdb_test "bt" [multi_line \ - "#0.*${hex} in foo \\(J=3D1, K=3D0\\).*" \ + "#0.*${hex} in (foo|fooso) \\(J=3D1, K=3D0\\).*" \ "#1.*${hex} in prog \\(\\).*" \ ] "bt fooso"