]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Explicitly expand CUs in dw2-inline-with-lexical-scope.exp
authorTom Tromey <tom@tromey.com>
Thu, 7 Dec 2023 19:18:00 +0000 (12:18 -0700)
committerTom Tromey <tom@tromey.com>
Thu, 18 Jan 2024 15:20:17 +0000 (08:20 -0700)
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.

gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp

index 2eca2833fc5201ceda38ce714f2ab21339f2313f..20836e0e63f2773e157e29d219fe5ee8bbeaec14 100644 (file)
@@ -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 = <optimized out>".
 gdb_test "info locals" "value = 42\r\nnum = 42"