public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Explicitly expand CUs in dw2-inline-with-lexical-scope.exp
@ 2024-01-18 20:37 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2024-01-18 20:37 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=07e98a5ad3fe00d3327a64b91d50d7a05c607556

commit 07e98a5ad3fe00d3327a64b91d50d7a05c607556
Author: Tom Tromey <tom@tromey.com>
Date:   Thu Dec 7 12:18:00 2023 -0700

    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:
---
 gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp | 4 ++++
 1 file changed, 4 insertions(+)

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 = <optimized out>".
 gdb_test "info locals" "value = 42\r\nnum = 42"

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-18 20:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-18 20:37 [binutils-gdb] Explicitly expand CUs in dw2-inline-with-lexical-scope.exp Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).