From: Tom Tromey Date: Thu, 7 Dec 2023 19:18:00 +0000 (-0700) Subject: Explicitly expand CUs in dw2-inline-with-lexical-scope.exp X-Git-Tag: gdb-15-branchpoint~1221 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=07e98a5ad3fe00d3327a64b91d50d7a05c607556;p=thirdparty%2Fbinutils-gdb.git Explicitly expand CUs in dw2-inline-with-lexical-scope.exp dw2-inline-with-lexical-scope.exp relies on the main CU being expanded. However, it doesn't guarantee that this actually happens, and with the new .debug_names reader, it won't, because the "main" program will be found in the index without requiring CU expansion. This patch fixes the problem by explicitly expanding the CU in question. Note that this is an artificial bug -- it occurs because the generated .debug_aranges isn't correct. --- diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp index 2eca2833fc5..20836e0e63f 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp @@ -133,5 +133,9 @@ if {[prepare_for_testing "failed to prepare" ${testfile} \ runto breakpoint_label +# When using cc-with-debug-names, nothing will force the CU to be +# expanded. Do it manually. +gdb_test_no_output "maint expand-symtabs [file tail $srcfile]" + # Bad GDB was printing an additional "value = ". gdb_test "info locals" "value = 42\r\nnum = 42"