public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] gdb/testsuite: initialize "correct" variable in gdb.cp/cpexprs.exp.tcl
@ 2023-01-26 20:54 Simon Marchi
  0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2023-01-26 20:54 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

Due to a GDB bug (visible when building with -D_GLIBCXX_DEBUG), GDB
crashes somewhere in the middle of gdb.cp/cpexprs.exp, and thus fails to
read the string, at gdb.cp/cpexprs.exp.tcl:725.  The "correct" variable
doesn't get set, and I then see this TCL error:

  ERROR: can't read "correct": no such variable

Avoid the TCL error by initializing the "correct" variable to a dummy
value.

Change-Id: I828968d9b2d105ef47f8da2ef598aa16a518c059
---
 gdb/testsuite/gdb.cp/cpexprs.exp.tcl | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gdb/testsuite/gdb.cp/cpexprs.exp.tcl b/gdb/testsuite/gdb.cp/cpexprs.exp.tcl
index 3df149bf6a3e..462cf16dcd1c 100644
--- a/gdb/testsuite/gdb.cp/cpexprs.exp.tcl
+++ b/gdb/testsuite/gdb.cp/cpexprs.exp.tcl
@@ -722,6 +722,8 @@ foreach name [get_functions list] {
 # Test c/v gets recognized even without quoting.
 foreach cv {{} { const} { volatile} { const volatile}} {
   set test "p 'CV::m(int)$cv'"
+  set correct dummy_value
+
   gdb_test_multiple $test $test {
       -re "( = {.*} 0x\[0-9a-f\]+ <CV::m.*>)\r\n$gdb_prompt $" {
 	  # = {void (CV * const, CV::t)} 0x400944 <CV::m(int)>
-- 
2.39.1


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

only message in thread, other threads:[~2023-01-26 20:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-26 20:54 [pushed] gdb/testsuite: initialize "correct" variable in gdb.cp/cpexprs.exp.tcl Simon Marchi

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).