]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Allow other results in DW_TAG_entry_point test
authorTom Tromey <tom@tromey.com>
Wed, 17 Jan 2024 16:15:22 +0000 (09:15 -0700)
committerTom Tromey <tom@tromey.com>
Thu, 18 Jan 2024 15:20:17 +0000 (08:20 -0700)
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.

This assumption seems unwarranted to me, and in fact this test will
regress with the debug-names target board after the .debug_names
rewrite.

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.

gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp

index c0c7a7ca54245396a143adf1c4c6d1ffa4ce030b..632a31111a2455e89585dd1e0739083b851af3f5 100644 (file)
@@ -207,7 +207,10 @@ if ![runto_main] {
 gdb_breakpoint "*fooso"
 gdb_continue_to_breakpoint "foo_so"
 
+# 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=1, K=0\\).*" \
+                   "#0.*${hex} in (foo|fooso) \\(J=1, K=0\\).*" \
                    "#1.*${hex} in prog \\(\\).*" \
 ] "bt fooso"