From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 3D9453858D28; Thu, 26 Jan 2023 20:54:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D9453858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674766441; bh=3dLflw5MaeCXespBBih93YxE40meCrdPnHMyipV0ooQ=; h=From:To:Subject:Date:From; b=RrKurjvUkY/txu/hcidrG2c7uZgiHzgpGopVGI8GD/wAkFRyUylPmCkzYKhHM8a94 jIoXmynHORROr4o/qyOtf3Fw3UbjOUmK35JlLe4nAZWxLuDl0RR0dFr51EPQaXsXI9 Wma2aL6Zexhsb1hhlZXhXzThp2aBPXdbhjs+gcQg= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/testsuite: initialize "correct" variable in gdb.cp/cpexprs.exp.tcl X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: d4c4ea75838091b6bf52d97208bd2fa4021951db X-Git-Newrev: 4707199bd760f26cbc32614dd9f7c6ed7d2efdda Message-Id: <20230126205401.3D9453858D28@sourceware.org> Date: Thu, 26 Jan 2023 20:54:01 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D4707199bd760= f26cbc32614dd9f7c6ed7d2efdda commit 4707199bd760f26cbc32614dd9f7c6ed7d2efdda Author: Simon Marchi Date: Thu Jan 26 15:46:51 2023 -0500 gdb/testsuite: initialize "correct" variable in gdb.cp/cpexprs.exp.tcl =20 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: =20 ERROR: can't read "correct": no such variable =20 Avoid the TCL error by initializing the "correct" variable to a dummy value. =20 Change-Id: I828968d9b2d105ef47f8da2ef598aa16a518c059 Diff: --- 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/cp= exprs.exp.tcl index 3df149bf6a3..462cf16dcd1 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 "( =3D {.*} 0x\[0-9a-f\]+ )\r\n$gdb_prompt $" { # =3D {void (CV * const, CV::t)} 0x400944