From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0dkdH0H8eWnKvxkAWB0awg (envelope-from ) for ; Wed, 28 Jan 2026 07:08:33 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=lUu2NZbb; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=u+bICOQ+; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=lUu2NZbb; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=u+bICOQ+; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 7939D1E08D; Wed, 28 Jan 2026 07:08:33 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id ED2C01E08D for ; Wed, 28 Jan 2026 07:08:30 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 877CF4BA2E3E for ; Wed, 28 Jan 2026 12:08:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 877CF4BA2E3E Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=lUu2NZbb; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=u+bICOQ+; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=lUu2NZbb; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=u+bICOQ+ Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id 5353E4BAD148 for ; Wed, 28 Jan 2026 12:06:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5353E4BAD148 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5353E4BAD148 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1769601999; cv=none; b=BawgzKH2x0uTYuKvO5TlzKqbcMbvf0xlatBXjN0iUgZAW+pDgMoOWwR55bgT/mXC/3w3g3+JNu2MYeKMUwlA0iaGgMTLDUUvII7+8NS0wA9rhqPQ6JV98WbwogDt9tZJMM243aqblHkTf0j5pv5uXfQKSIS7Mw9VhNXj0+sqyJg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1769601999; c=relaxed/simple; bh=8tT7k660TuzYicbs2mzg6TUuZD41ZNml1QRljc39BJc=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=SzfLUOHV5cCQscgv9FKzpmlbNvalDq4XHa5SIBv+99o7fBPdocays5YN/uCc4bE1e6UFQzPI3tXf5Dl2KiY/OdOlr7Q+BZ99FfvWiR/ZOV0MjZj/BJL10yRoPybNw/LSI/41u209dxw4JTBYhJJscFuV2YPl9b5t52TCgf5gIAI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5353E4BAD148 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8961E33B7D for ; Wed, 28 Jan 2026 12:06:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1769601992; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2fqN1QGvuY9XP1mIeEzOIBVjJjbsFCBoZBANUaAzsUQ=; b=lUu2NZbbSQL1YRwiYTGUSiWuQY8Nvn9Fc7SVxkKfbKFUCTv5oitWnBFTvm5w7gu4+jQ3lF 5LvT9GU7eR1VCktgvOUIoxyGP0+QUism8+jzur1CrRaWoKSCMjgiafq9GPOaMaDf54DJCn 43CFFLiTEUz5eFmMs/5cqEvpejRpP8U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1769601992; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2fqN1QGvuY9XP1mIeEzOIBVjJjbsFCBoZBANUaAzsUQ=; b=u+bICOQ+XcPcRgO1vTJt9sA43UI4Rcp1XgzcZogTrJK8ya0ev/xC9AEOs5qkC76jO38HYV N4OFcig5rniuybDw== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=lUu2NZbb; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=u+bICOQ+ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1769601992; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2fqN1QGvuY9XP1mIeEzOIBVjJjbsFCBoZBANUaAzsUQ=; b=lUu2NZbbSQL1YRwiYTGUSiWuQY8Nvn9Fc7SVxkKfbKFUCTv5oitWnBFTvm5w7gu4+jQ3lF 5LvT9GU7eR1VCktgvOUIoxyGP0+QUism8+jzur1CrRaWoKSCMjgiafq9GPOaMaDf54DJCn 43CFFLiTEUz5eFmMs/5cqEvpejRpP8U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1769601992; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2fqN1QGvuY9XP1mIeEzOIBVjJjbsFCBoZBANUaAzsUQ=; b=u+bICOQ+XcPcRgO1vTJt9sA43UI4Rcp1XgzcZogTrJK8ya0ev/xC9AEOs5qkC76jO38HYV N4OFcig5rniuybDw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 60EFC3EA64 for ; Wed, 28 Jan 2026 12:06:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 8O4eFsj7eWmZbwAAD6G6ig (envelope-from ) for ; Wed, 28 Jan 2026 12:06:32 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH 3/5] [gdb/testsuite] Use valnum_re more often (part 2) Date: Wed, 28 Jan 2026 13:06:24 +0100 Message-ID: <20260128120626.1032047-4-tdevries@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260128120626.1032047-1-tdevries@suse.de> References: <20260128120626.1032047-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; MIME_TRACE(0.00)[0:+]; FUZZY_RATELIMITED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_TWO(0.00)[2]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_TLS_ALL(0.00)[]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:rdns, imap1.dmz-prg2.suse.org:helo, suse.de:dkim, suse.de:mid] X-Rspamd-Action: no action X-Rspamd-Queue-Id: 8961E33B7D X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Also transform '\\\$\[0-9\]*' into valnum_re, assuming that '\\\$\[0-9\]+' was meant. Done using these commands to cover '\\\$' vs '\\$' and '\[0-9\]' vs '\[0-9]': ... $ find gdb/testsuite/ -type f -name *.exp* \ | xargs sed -i 's/\\\\\\$\\\[0-9\\\]\*/${::valnum_re}/g' $ find gdb/testsuite/ -type f -name *.exp* \ | xargs sed -i 's/\\\\\\$\\\[0-9\]\*/${::valnum_re}/g' $ find gdb/testsuite/ -type f -name *.exp* \ | xargs sed -i 's/\\\\$\\\[0-9\\\]\*/${::valnum_re}/g' $ find gdb/testsuite/ -type f -name *.exp* \ | xargs sed -i 's/\\\\$\\\[0-9\]\*/${::valnum_re}/g' ... --- .../gdb.arch/powerpc-plxv-nonrel.exp | 2 +- .../gdb.base/break-main-file-remove-fail.exp | 2 +- gdb/testsuite/gdb.base/complex.exp | 4 +- gdb/testsuite/gdb.base/exprs.exp | 222 +++++++++--------- gdb/testsuite/gdb.base/gdb1090.exp | 4 +- gdb/testsuite/gdb.base/offsets.exp | 4 +- gdb/testsuite/gdb.base/readline.exp | 8 +- gdb/testsuite/gdb.cp/anon-union.exp | 30 +-- gdb/testsuite/gdb.cp/m-data.exp | 26 +- gdb/testsuite/gdb.cp/m-static.exp | 14 +- gdb/testsuite/gdb.cp/method.exp | 18 +- gdb/testsuite/gdb.cp/misc.exp | 42 ++-- gdb/testsuite/gdb.cp/namespace.exp | 16 +- gdb/testsuite/gdb.cp/pr-574.exp | 2 +- gdb/testsuite/gdb.cp/printmethod.exp | 4 +- gdb/testsuite/gdb.cp/rtti.exp | 14 +- gdb/testsuite/gdb.cp/templates.exp | 10 +- gdb/testsuite/gdb.cp/userdef.exp | 64 ++--- gdb/testsuite/gdb.opt/fortran-string.exp | 2 +- .../gdb.threads/continue-pending-status.exp | 2 +- gdb/testsuite/lib/gdb.exp | 6 +- gdb/testsuite/lib/mi-support.exp | 2 +- 22 files changed, 249 insertions(+), 249 deletions(-) diff --git a/gdb/testsuite/gdb.arch/powerpc-plxv-nonrel.exp b/gdb/testsuite/gdb.arch/powerpc-plxv-nonrel.exp index 9030e2c32e5..4f90080cf56 100644 --- a/gdb/testsuite/gdb.arch/powerpc-plxv-nonrel.exp +++ b/gdb/testsuite/gdb.arch/powerpc-plxv-nonrel.exp @@ -45,7 +45,7 @@ proc get_vector_hexadecimal_valueof { exp default {test ""} } { set test "get vector_hexadecimal valueof \"${exp}\"" } gdb_test_multiple "print $${exp}.uint128" $test { - -re -wrap "\\$\[0-9\]* = (0x\[0-9a-zA-Z\]+).*" { + -re -wrap "${::valnum_re} = (0x\[0-9a-zA-Z\]+).*" { set val $expect_out(1,string) pass "$test" } diff --git a/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp b/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp index 00610b71107..face6205da7 100644 --- a/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp +++ b/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp @@ -100,7 +100,7 @@ proc test_remove_bp { initial_load } { # get_integer_valueof. set munmap -1 gdb_test_multiple "print /d ${munmap_expr}" "get result of munmap call" { - -re -wrap "^(?:warning: error removing breakpoint $::decimal at $::hex\r\n)?\\$\[0-9\]* = (\[-\]*\[0-9\]*).*" { + -re -wrap "^(?:warning: error removing breakpoint $::decimal at $::hex\r\n)?${::valnum_re} = (\[-\]*\[0-9\]*).*" { set munmap $expect_out(1,string) pass $gdb_test_name } diff --git a/gdb/testsuite/gdb.base/complex.exp b/gdb/testsuite/gdb.base/complex.exp index 5096e585ee1..c4be874e376 100644 --- a/gdb/testsuite/gdb.base/complex.exp +++ b/gdb/testsuite/gdb.base/complex.exp @@ -25,11 +25,11 @@ if {[runto f2]} { if {[test_compiler_info gcc-2-*] && [test_debug_format "DWARF \[0-9\]"]} { setup_xfail "*-*-*" } - gdb_test "p *y" "\\\$\[0-9\]* = \{c = 42 '\\*', f = 1 \\+ 0i\}" \ + gdb_test "p *y" "${::valnum_re} = \{c = 42 '\\*', f = 1 \\+ 0i\}" \ "print complex packed value in C" } if {[runto f4]} { - gdb_test "p *y" "\\\$\[0-9\]* = \{c = 42 '\\*', f = 1 \\+ 0i\}" \ + gdb_test "p *y" "${::valnum_re} = \{c = 42 '\\*', f = 1 \\+ 0i\}" \ "print complex value in C" } diff --git a/gdb/testsuite/gdb.base/exprs.exp b/gdb/testsuite/gdb.base/exprs.exp index 32f7cc85149..ba5ce80a535 100644 --- a/gdb/testsuite/gdb.base/exprs.exp +++ b/gdb/testsuite/gdb.base/exprs.exp @@ -51,142 +51,142 @@ proc test_expr { args } { # # test expressions with "char" types # -test_expr "set variable v_char=127" "print v_char == 0" "\\$\[0-9\]* = $false" "print v_char == 127" "\\$\[0-9\]* = $true" "print char ==" -test_expr "set variable v_char=127" "print v_char != 0" "\\$\[0-9\]* = $true" "print v_char != 127" "\\$\[0-9\]* = $false" "print char !=" -test_expr "set variable v_char=127" "print v_char < 0" "\\$\[0-9\]* = $false" "print v_char < 127" "\\$\[0-9\]* = $false" "print char <" -test_expr "set variable v_char=127" "print v_char > 0" "\\$\[0-9\]* = $true" "print v_char > 127" "\\$\[0-9\]* = $false" "print char >" +test_expr "set variable v_char=127" "print v_char == 0" "${::valnum_re} = $false" "print v_char == 127" "${::valnum_re} = $true" "print char ==" +test_expr "set variable v_char=127" "print v_char != 0" "${::valnum_re} = $true" "print v_char != 127" "${::valnum_re} = $false" "print char !=" +test_expr "set variable v_char=127" "print v_char < 0" "${::valnum_re} = $false" "print v_char < 127" "${::valnum_re} = $false" "print char <" +test_expr "set variable v_char=127" "print v_char > 0" "${::valnum_re} = $true" "print v_char > 127" "${::valnum_re} = $false" "print char >" # # test expressions with "signed char" types # -test_expr "set variable v_signed_char=127" "print v_signed_char == 0" "\\$\[0-9\]* = $false" "print v_signed_char == 127" "\\$\[0-9\]* = $true" "print signed char ==" -test_expr "set variable v_signed_char=127" "print v_signed_char != 0" "\\$\[0-9\]* = $true" "print v_signed_char != 127" "\\$\[0-9\]* = $false" "print signed char !=" -test_expr "set variable v_signed_char=127" "print v_signed_char < 0" "\\$\[0-9\]* = $false" "print v_signed_char < 127" "\\$\[0-9\]* = $false" "print signed char <" -test_expr "set variable v_signed_char=127" "print v_signed_char > 0" "\\$\[0-9\]* = $true" "print v_signed_char > 127" "\\$\[0-9\]* = $false" "print signed char >" +test_expr "set variable v_signed_char=127" "print v_signed_char == 0" "${::valnum_re} = $false" "print v_signed_char == 127" "${::valnum_re} = $true" "print signed char ==" +test_expr "set variable v_signed_char=127" "print v_signed_char != 0" "${::valnum_re} = $true" "print v_signed_char != 127" "${::valnum_re} = $false" "print signed char !=" +test_expr "set variable v_signed_char=127" "print v_signed_char < 0" "${::valnum_re} = $false" "print v_signed_char < 127" "${::valnum_re} = $false" "print signed char <" +test_expr "set variable v_signed_char=127" "print v_signed_char > 0" "${::valnum_re} = $true" "print v_signed_char > 127" "${::valnum_re} = $false" "print signed char >" # make char a minus -test_expr "set variable v_signed_char=-1" "print v_signed_char == 0" "\\$\[0-9\]* = $false" "print v_signed_char == -1" "\\$\[0-9\]* = $true" "print signed char == (minus)" -test_expr "set variable v_signed_char=-1" "print v_signed_char != 0" "\\$\[0-9\]* = $true" "print v_signed_char != -1" "\\$\[0-9\]* = $false" "print signed char != (minus)" -test_expr "set variable v_signed_char=-1" "print v_signed_char < 0" "\\$\[0-9\]* = $true" "print v_signed_char < 127" "\\$\[0-9\]* = $true" "print signed char < (minus)" -test_expr "set variable v_signed_char=-1" "print v_signed_char > 0" "\\$\[0-9\]* = $false" "print v_signed_char > 127" "\\$\[0-9\]* = $false" "print signed char > (minus)" +test_expr "set variable v_signed_char=-1" "print v_signed_char == 0" "${::valnum_re} = $false" "print v_signed_char == -1" "${::valnum_re} = $true" "print signed char == (minus)" +test_expr "set variable v_signed_char=-1" "print v_signed_char != 0" "${::valnum_re} = $true" "print v_signed_char != -1" "${::valnum_re} = $false" "print signed char != (minus)" +test_expr "set variable v_signed_char=-1" "print v_signed_char < 0" "${::valnum_re} = $true" "print v_signed_char < 127" "${::valnum_re} = $true" "print signed char < (minus)" +test_expr "set variable v_signed_char=-1" "print v_signed_char > 0" "${::valnum_re} = $false" "print v_signed_char > 127" "${::valnum_re} = $false" "print signed char > (minus)" # # test expressions with "unsigned char" types # -test_expr "set variable v_unsigned_char=127" "print v_unsigned_char == 0" "\\$\[0-9\]* = $false" "print v_unsigned_char == 127" "\\$\[0-9\]* = $true" "print unsigned char ==" -test_expr "set variable v_unsigned_char=127" "print v_unsigned_char != 0" "\\$\[0-9\]* = $true" "print v_unsigned_char != 127" "\\$\[0-9\]* = $false" "print unsigned char !=" -test_expr "set variable v_unsigned_char=127" "print v_unsigned_char < 0" "\\$\[0-9\]* = $false" "print v_unsigned_char < 127" "\\$\[0-9\]* = $false" "print unsigned char <" -test_expr "set variable v_unsigned_char=127" "print v_unsigned_char > 0" "\\$\[0-9\]* = $true" "print v_unsigned_char > 127" "\\$\[0-9\]* = $false" "print unsigned char >" +test_expr "set variable v_unsigned_char=127" "print v_unsigned_char == 0" "${::valnum_re} = $false" "print v_unsigned_char == 127" "${::valnum_re} = $true" "print unsigned char ==" +test_expr "set variable v_unsigned_char=127" "print v_unsigned_char != 0" "${::valnum_re} = $true" "print v_unsigned_char != 127" "${::valnum_re} = $false" "print unsigned char !=" +test_expr "set variable v_unsigned_char=127" "print v_unsigned_char < 0" "${::valnum_re} = $false" "print v_unsigned_char < 127" "${::valnum_re} = $false" "print unsigned char <" +test_expr "set variable v_unsigned_char=127" "print v_unsigned_char > 0" "${::valnum_re} = $true" "print v_unsigned_char > 127" "${::valnum_re} = $false" "print unsigned char >" # make char a minus -test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char == 0" "\\$\[0-9\]* = $false" "print v_unsigned_char == ~0" "\\$\[0-9\]* = $false" "print v_unsigned_char == (unsigned char)~0" "\\$\[0-9\]* = $true" "print unsigned char == (~0)" -test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char != 0" "\\$\[0-9\]* = $true" "print v_unsigned_char != (unsigned char)~0" "\\$\[0-9\]* = $false" "print v_unsigned_char != ~0" "\\$\[0-9\]* = $true" "print unsigned char != (~0)" -test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char < 0" "\\$\[0-9\]* = $false" "print v_unsigned_char < 127" "\\$\[0-9\]* = $false" "print unsigned char < (~0)" -test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char > 0" "\\$\[0-9\]* = $true" "print v_unsigned_char > 127" "\\$\[0-9\]* = $true" "print unsigned char > (~0)" +test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char == 0" "${::valnum_re} = $false" "print v_unsigned_char == ~0" "${::valnum_re} = $false" "print v_unsigned_char == (unsigned char)~0" "${::valnum_re} = $true" "print unsigned char == (~0)" +test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char != 0" "${::valnum_re} = $true" "print v_unsigned_char != (unsigned char)~0" "${::valnum_re} = $false" "print v_unsigned_char != ~0" "${::valnum_re} = $true" "print unsigned char != (~0)" +test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char < 0" "${::valnum_re} = $false" "print v_unsigned_char < 127" "${::valnum_re} = $false" "print unsigned char < (~0)" +test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char > 0" "${::valnum_re} = $true" "print v_unsigned_char > 127" "${::valnum_re} = $true" "print unsigned char > (~0)" # # test expressions with "short" types # -test_expr "set variable v_short=0x7FFF" "print v_short == 0" "\\$\[0-9\]* = $false" "print v_short == 0x7FFF" "\\$\[0-9\]* = $true" "print signed short ==" -test_expr "set variable v_short=0x7FFF" "print v_short != 0" "\\$\[0-9\]* = $true" "print v_short != 0x7FFF" "\\$\[0-9\]* = $false" "print signed short !=" -test_expr "set variable v_short=0x7FFF" "print v_short < 0" "\\$\[0-9\]* = $false" "print v_short < 0x7FFF" "\\$\[0-9\]* = $false" "print signed short <" -test_expr "set variable v_short=0x7FFF" "print v_short > 0" "\\$\[0-9\]* = $true" "print v_short > 0x7FFF" "\\$\[0-9\]* = $false" "print signed short >" +test_expr "set variable v_short=0x7FFF" "print v_short == 0" "${::valnum_re} = $false" "print v_short == 0x7FFF" "${::valnum_re} = $true" "print signed short ==" +test_expr "set variable v_short=0x7FFF" "print v_short != 0" "${::valnum_re} = $true" "print v_short != 0x7FFF" "${::valnum_re} = $false" "print signed short !=" +test_expr "set variable v_short=0x7FFF" "print v_short < 0" "${::valnum_re} = $false" "print v_short < 0x7FFF" "${::valnum_re} = $false" "print signed short <" +test_expr "set variable v_short=0x7FFF" "print v_short > 0" "${::valnum_re} = $true" "print v_short > 0x7FFF" "${::valnum_re} = $false" "print signed short >" # make short a minus -test_expr "set variable v_short=-1" "print v_short == 0" "\\$\[0-9\]* = $false" "print v_short == -1" "\\$\[0-9\]* = $true" "print signed short == (minus)" -test_expr "set variable v_short=-1" "print v_short != 0" "\\$\[0-9\]* = $true" "print v_short != -1" "\\$\[0-9\]* = $false" "print signed short != (minus)" -test_expr "set variable v_short=-1" "print v_short < 0" "\\$\[0-9\]* = $true" "print v_short < 0x7FFF" "\\$\[0-9\]* = $true" "print signed short < (minus)" -test_expr "set variable v_short=-1" "print v_short > 0" "\\$\[0-9\]* = $false" "print v_short > 0x7FFF" "\\$\[0-9\]* = $false" "print signed short > (minus)" +test_expr "set variable v_short=-1" "print v_short == 0" "${::valnum_re} = $false" "print v_short == -1" "${::valnum_re} = $true" "print signed short == (minus)" +test_expr "set variable v_short=-1" "print v_short != 0" "${::valnum_re} = $true" "print v_short != -1" "${::valnum_re} = $false" "print signed short != (minus)" +test_expr "set variable v_short=-1" "print v_short < 0" "${::valnum_re} = $true" "print v_short < 0x7FFF" "${::valnum_re} = $true" "print signed short < (minus)" +test_expr "set variable v_short=-1" "print v_short > 0" "${::valnum_re} = $false" "print v_short > 0x7FFF" "${::valnum_re} = $false" "print signed short > (minus)" # # test expressions with "signed short" types # -test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short == 0" "\\$\[0-9\]* = $false" "print v_signed_short == 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed short ==" -test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short != 0" "\\$\[0-9\]* = $true" "print v_signed_short != 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed short !=" -test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short < 0" "\\$\[0-9\]* = $false" "print v_signed_short < 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed short <" -test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short > 0" "\\$\[0-9\]* = $true" "print v_signed_short > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed short >" +test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short == 0" "${::valnum_re} = $false" "print v_signed_short == 0x7FFF" "${::valnum_re} = $true" "print signed signed short ==" +test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short != 0" "${::valnum_re} = $true" "print v_signed_short != 0x7FFF" "${::valnum_re} = $false" "print signed signed short !=" +test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short < 0" "${::valnum_re} = $false" "print v_signed_short < 0x7FFF" "${::valnum_re} = $false" "print signed signed short <" +test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short > 0" "${::valnum_re} = $true" "print v_signed_short > 0x7FFF" "${::valnum_re} = $false" "print signed signed short >" # make short a minus -test_expr "set variable v_signed_short=-1" "print v_signed_short == 0" "\\$\[0-9\]* = $false" "print v_signed_short == -1" "\\$\[0-9\]* = $true" "print signed signed short == (minus)" -test_expr "set variable v_signed_short=-1" "print v_signed_short != 0" "\\$\[0-9\]* = $true" "print v_signed_short != -1" "\\$\[0-9\]* = $false" "print signed signed short != (minus)" -test_expr "set variable v_signed_short=-1" "print v_signed_short < 0" "\\$\[0-9\]* = $true" "print v_signed_short < 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed short < (minus)" -test_expr "set variable v_signed_short=-1" "print v_signed_short > 0" "\\$\[0-9\]* = $false" "print v_signed_short > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed short > (minus)" +test_expr "set variable v_signed_short=-1" "print v_signed_short == 0" "${::valnum_re} = $false" "print v_signed_short == -1" "${::valnum_re} = $true" "print signed signed short == (minus)" +test_expr "set variable v_signed_short=-1" "print v_signed_short != 0" "${::valnum_re} = $true" "print v_signed_short != -1" "${::valnum_re} = $false" "print signed signed short != (minus)" +test_expr "set variable v_signed_short=-1" "print v_signed_short < 0" "${::valnum_re} = $true" "print v_signed_short < 0x7FFF" "${::valnum_re} = $true" "print signed signed short < (minus)" +test_expr "set variable v_signed_short=-1" "print v_signed_short > 0" "${::valnum_re} = $false" "print v_signed_short > 0x7FFF" "${::valnum_re} = $false" "print signed signed short > (minus)" # # test expressions with "unsigned short" types # -test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short == 0" "\\$\[0-9\]* = $false" "print v_unsigned_short == 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned short ==" -test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short != 0" "\\$\[0-9\]* = $true" "print v_unsigned_short != 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short !=" -test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short < 0" "\\$\[0-9\]* = $false" "print v_unsigned_short < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short <" -test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short > 0" "\\$\[0-9\]* = $true" "print v_unsigned_short > 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short >" +test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short == 0" "${::valnum_re} = $false" "print v_unsigned_short == 0x7FFF" "${::valnum_re} = $true" "print unsigned short ==" +test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short != 0" "${::valnum_re} = $true" "print v_unsigned_short != 0x7FFF" "${::valnum_re} = $false" "print unsigned short !=" +test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short < 0" "${::valnum_re} = $false" "print v_unsigned_short < 0x7FFF" "${::valnum_re} = $false" "print unsigned short <" +test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short > 0" "${::valnum_re} = $true" "print v_unsigned_short > 0x7FFF" "${::valnum_re} = $false" "print unsigned short >" # make short a minus -test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short == 0" "\\$\[0-9\]* = $false" "print sizeof (v_unsigned_short) < sizeof (~0) && v_unsigned_short == ~0" "\\$\[0-9\]* = $false" "print v_unsigned_short == (unsigned short)~0" "\\$\[0-9\]* = $true" "print unsigned short == (~0)" -test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short != 0" "\\$\[0-9\]* = $true" "print v_unsigned_short != (unsigned short)~0" "\\$\[0-9\]* = $false" "print unsigned short != (~0)" -test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short < 0" "\\$\[0-9\]* = $false" "print v_unsigned_short < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short < (~0)" -test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short > 0" "\\$\[0-9\]* = $true" "print v_unsigned_short > 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned short > (~0)" +test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short == 0" "${::valnum_re} = $false" "print sizeof (v_unsigned_short) < sizeof (~0) && v_unsigned_short == ~0" "${::valnum_re} = $false" "print v_unsigned_short == (unsigned short)~0" "${::valnum_re} = $true" "print unsigned short == (~0)" +test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short != 0" "${::valnum_re} = $true" "print v_unsigned_short != (unsigned short)~0" "${::valnum_re} = $false" "print unsigned short != (~0)" +test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short < 0" "${::valnum_re} = $false" "print v_unsigned_short < 0x7FFF" "${::valnum_re} = $false" "print unsigned short < (~0)" +test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short > 0" "${::valnum_re} = $true" "print v_unsigned_short > 0x7FFF" "${::valnum_re} = $true" "print unsigned short > (~0)" # # test expressions with "int" types # -test_expr "set variable v_int=0x7FFF" "print v_int == 0" "\\$\[0-9\]* = $false" "print v_int == 0x7FFF" "\\$\[0-9\]* = $true" "print signed int ==" -test_expr "set variable v_int=0x7FFF" "print v_int != 0" "\\$\[0-9\]* = $true" "print v_int != 0x7FFF" "\\$\[0-9\]* = $false" "print signed int !=" -test_expr "set variable v_int=0x7FFF" "print v_int < 0" "\\$\[0-9\]* = $false" "print v_int < 0x7FFF" "\\$\[0-9\]* = $false" "print signed int <" -test_expr "set variable v_int=0x7FFF" "print v_int > 0" "\\$\[0-9\]* = $true" "print v_int > 0x7FFF" "\\$\[0-9\]* = $false" "print signed int >" +test_expr "set variable v_int=0x7FFF" "print v_int == 0" "${::valnum_re} = $false" "print v_int == 0x7FFF" "${::valnum_re} = $true" "print signed int ==" +test_expr "set variable v_int=0x7FFF" "print v_int != 0" "${::valnum_re} = $true" "print v_int != 0x7FFF" "${::valnum_re} = $false" "print signed int !=" +test_expr "set variable v_int=0x7FFF" "print v_int < 0" "${::valnum_re} = $false" "print v_int < 0x7FFF" "${::valnum_re} = $false" "print signed int <" +test_expr "set variable v_int=0x7FFF" "print v_int > 0" "${::valnum_re} = $true" "print v_int > 0x7FFF" "${::valnum_re} = $false" "print signed int >" # make int a minus -test_expr "set variable v_int=-1" "print v_int == 0" "\\$\[0-9\]* = $false" "print v_int == -1" "\\$\[0-9\]* = $true" "print signed int == (minus)" -test_expr "set variable v_int=-1" "print v_int != 0" "\\$\[0-9\]* = $true" "print v_int != -1" "\\$\[0-9\]* = $false" "print signed int != (minus)" -test_expr "set variable v_int=-1" "print v_int < 0" "\\$\[0-9\]* = $true" "print v_int < 0x7FFF" "\\$\[0-9\]* = $true" "print signed int < (minus)" -test_expr "set variable v_int=-1" "print v_int > 0" "\\$\[0-9\]* = $false" "print v_int > 0x7FFF" "\\$\[0-9\]* = $false" "print signed int > (minus)" +test_expr "set variable v_int=-1" "print v_int == 0" "${::valnum_re} = $false" "print v_int == -1" "${::valnum_re} = $true" "print signed int == (minus)" +test_expr "set variable v_int=-1" "print v_int != 0" "${::valnum_re} = $true" "print v_int != -1" "${::valnum_re} = $false" "print signed int != (minus)" +test_expr "set variable v_int=-1" "print v_int < 0" "${::valnum_re} = $true" "print v_int < 0x7FFF" "${::valnum_re} = $true" "print signed int < (minus)" +test_expr "set variable v_int=-1" "print v_int > 0" "${::valnum_re} = $false" "print v_int > 0x7FFF" "${::valnum_re} = $false" "print signed int > (minus)" # # test expressions with "signed int" types # -test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int == 0" "\\$\[0-9\]* = $false" "print v_signed_int == 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed int ==" -test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int != 0" "\\$\[0-9\]* = $true" "print v_signed_int != 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed int !=" -test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int < 0" "\\$\[0-9\]* = $false" "print v_signed_int < 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed int <" -test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int > 0" "\\$\[0-9\]* = $true" "print v_signed_int > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed int >" +test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int == 0" "${::valnum_re} = $false" "print v_signed_int == 0x7FFF" "${::valnum_re} = $true" "print signed signed int ==" +test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int != 0" "${::valnum_re} = $true" "print v_signed_int != 0x7FFF" "${::valnum_re} = $false" "print signed signed int !=" +test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int < 0" "${::valnum_re} = $false" "print v_signed_int < 0x7FFF" "${::valnum_re} = $false" "print signed signed int <" +test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int > 0" "${::valnum_re} = $true" "print v_signed_int > 0x7FFF" "${::valnum_re} = $false" "print signed signed int >" # make int a minus -test_expr "set variable v_signed_int=-1" "print v_signed_int == 0" "\\$\[0-9\]* = $false" "print v_signed_int == -1" "\\$\[0-9\]* = $true" "print signed signed int == (minus)" -test_expr "set variable v_signed_int=-1" "print v_signed_int != 0" "\\$\[0-9\]* = $true" "print v_signed_int != -1" "\\$\[0-9\]* = $false" "print signed signed int != (minus)" -test_expr "set variable v_signed_int=-1" "print v_signed_int < 0" "\\$\[0-9\]* = $true" "print v_signed_int < 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed int < (minus)" -test_expr "set variable v_signed_int=-1" "print v_signed_int > 0" "\\$\[0-9\]* = $false" "print v_signed_int > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed int > (minus)" +test_expr "set variable v_signed_int=-1" "print v_signed_int == 0" "${::valnum_re} = $false" "print v_signed_int == -1" "${::valnum_re} = $true" "print signed signed int == (minus)" +test_expr "set variable v_signed_int=-1" "print v_signed_int != 0" "${::valnum_re} = $true" "print v_signed_int != -1" "${::valnum_re} = $false" "print signed signed int != (minus)" +test_expr "set variable v_signed_int=-1" "print v_signed_int < 0" "${::valnum_re} = $true" "print v_signed_int < 0x7FFF" "${::valnum_re} = $true" "print signed signed int < (minus)" +test_expr "set variable v_signed_int=-1" "print v_signed_int > 0" "${::valnum_re} = $false" "print v_signed_int > 0x7FFF" "${::valnum_re} = $false" "print signed signed int > (minus)" # # test expressions with "unsigned int" types # -test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int == 0" "\\$\[0-9\]* = $false" "print v_unsigned_int == 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned int ==" -test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int != 0" "\\$\[0-9\]* = $true" "print v_unsigned_int != 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned int !=" -test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int < 0" "\\$\[0-9\]* = $false" "print v_unsigned_int < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned int <" -test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int > 0" "\\$\[0-9\]* = $true" "print v_unsigned_int > 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned int >" +test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int == 0" "${::valnum_re} = $false" "print v_unsigned_int == 0x7FFF" "${::valnum_re} = $true" "print unsigned int ==" +test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int != 0" "${::valnum_re} = $true" "print v_unsigned_int != 0x7FFF" "${::valnum_re} = $false" "print unsigned int !=" +test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int < 0" "${::valnum_re} = $false" "print v_unsigned_int < 0x7FFF" "${::valnum_re} = $false" "print unsigned int <" +test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int > 0" "${::valnum_re} = $true" "print v_unsigned_int > 0x7FFF" "${::valnum_re} = $false" "print unsigned int >" # make int a minus -test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int == 0" "\\$\[0-9\]* = $false" "print v_unsigned_int == ~0" "\\$\[0-9\]* = $true" "print v_unsigned_int == (unsigned int)~0" "\\$\[0-9\]* = $true" "print unsigned int == (~0)" -test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int != 0" "\\$\[0-9\]* = $true" "print v_unsigned_int != (unsigned int)~0" "\\$\[0-9\]* = $false" "print unsigned int != (~0)" -test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int < 0" "\\$\[0-9\]* = $false" "print v_unsigned_int < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned int < (~0)" -test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int > 0" "\\$\[0-9\]* = $true" "print v_unsigned_int > 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned int > (~0)" +test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int == 0" "${::valnum_re} = $false" "print v_unsigned_int == ~0" "${::valnum_re} = $true" "print v_unsigned_int == (unsigned int)~0" "${::valnum_re} = $true" "print unsigned int == (~0)" +test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int != 0" "${::valnum_re} = $true" "print v_unsigned_int != (unsigned int)~0" "${::valnum_re} = $false" "print unsigned int != (~0)" +test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int < 0" "${::valnum_re} = $false" "print v_unsigned_int < 0x7FFF" "${::valnum_re} = $false" "print unsigned int < (~0)" +test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int > 0" "${::valnum_re} = $true" "print v_unsigned_int > 0x7FFF" "${::valnum_re} = $true" "print unsigned int > (~0)" # # test expressions with "long" types # -test_expr "set variable v_long=0x7FFF" "print v_long == 0" "\\$\[0-9\]* = $false" "print v_long == 0x7FFF" "\\$\[0-9\]* = $true" "print signed long ==" -test_expr "set variable v_long=0x7FFF" "print v_long != 0" "\\$\[0-9\]* = $true" "print v_long != 0x7FFF" "\\$\[0-9\]* = $false" "print signed long !=" -test_expr "set variable v_long=0x7FFF" "print v_long < 0" "\\$\[0-9\]* = $false" "print v_long < 0x7FFF" "\\$\[0-9\]* = $false" "print signed long <" -test_expr "set variable v_long=0x7FFF" "print v_long > 0" "\\$\[0-9\]* = $true" "print v_long > 0x7FFF" "\\$\[0-9\]* = $false" "print signed long >" +test_expr "set variable v_long=0x7FFF" "print v_long == 0" "${::valnum_re} = $false" "print v_long == 0x7FFF" "${::valnum_re} = $true" "print signed long ==" +test_expr "set variable v_long=0x7FFF" "print v_long != 0" "${::valnum_re} = $true" "print v_long != 0x7FFF" "${::valnum_re} = $false" "print signed long !=" +test_expr "set variable v_long=0x7FFF" "print v_long < 0" "${::valnum_re} = $false" "print v_long < 0x7FFF" "${::valnum_re} = $false" "print signed long <" +test_expr "set variable v_long=0x7FFF" "print v_long > 0" "${::valnum_re} = $true" "print v_long > 0x7FFF" "${::valnum_re} = $false" "print signed long >" # make long a minus -test_expr "set variable v_long=-1" "print v_long == 0" "\\$\[0-9\]* = $false" "print v_long == -1" "\\$\[0-9\]* = $true" "print signed long == (minus)" -test_expr "set variable v_long=-1" "print v_long != 0" "\\$\[0-9\]* = $true" "print v_long != -1" "\\$\[0-9\]* = $false" "print signed long != (minus)" -test_expr "set variable v_long=-1" "print v_long < 0" "\\$\[0-9\]* = $true" "print v_long < 0x7FFF" "\\$\[0-9\]* = $true" "print signed long < (minus)" -test_expr "set variable v_long=-1" "print v_long > 0" "\\$\[0-9\]* = $false" "print v_long > 0x7FFF" "\\$\[0-9\]* = $false" "print signed long > (minus)" +test_expr "set variable v_long=-1" "print v_long == 0" "${::valnum_re} = $false" "print v_long == -1" "${::valnum_re} = $true" "print signed long == (minus)" +test_expr "set variable v_long=-1" "print v_long != 0" "${::valnum_re} = $true" "print v_long != -1" "${::valnum_re} = $false" "print signed long != (minus)" +test_expr "set variable v_long=-1" "print v_long < 0" "${::valnum_re} = $true" "print v_long < 0x7FFF" "${::valnum_re} = $true" "print signed long < (minus)" +test_expr "set variable v_long=-1" "print v_long > 0" "${::valnum_re} = $false" "print v_long > 0x7FFF" "${::valnum_re} = $false" "print signed long > (minus)" # # test expressions with "signed long" types # -test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long == 0" "\\$\[0-9\]* = $false" "print v_signed_long == 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed long ==" -test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long != 0" "\\$\[0-9\]* = $true" "print v_signed_long != 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed long !=" -test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long < 0" "\\$\[0-9\]* = $false" "print v_signed_long < 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed long <" -test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long > 0" "\\$\[0-9\]* = $true" "print v_signed_long > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed long >" +test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long == 0" "${::valnum_re} = $false" "print v_signed_long == 0x7FFF" "${::valnum_re} = $true" "print signed signed long ==" +test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long != 0" "${::valnum_re} = $true" "print v_signed_long != 0x7FFF" "${::valnum_re} = $false" "print signed signed long !=" +test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long < 0" "${::valnum_re} = $false" "print v_signed_long < 0x7FFF" "${::valnum_re} = $false" "print signed signed long <" +test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long > 0" "${::valnum_re} = $true" "print v_signed_long > 0x7FFF" "${::valnum_re} = $false" "print signed signed long >" # make long a minus -test_expr "set variable v_signed_long=-1" "print v_signed_long == 0" "\\$\[0-9\]* = $false" "print v_signed_long == -1" "\\$\[0-9\]* = $true" "print signed signed long == (minus)" -test_expr "set variable v_signed_long=-1" "print v_signed_long != 0" "\\$\[0-9\]* = $true" "print v_signed_long != -1" "\\$\[0-9\]* = $false" "print signed signed long != (minus)" -test_expr "set variable v_signed_long=-1" "print v_signed_long < 0" "\\$\[0-9\]* = $true" "print v_signed_long < 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed long < (minus)" -test_expr "set variable v_signed_long=-1" "print v_signed_long > 0" "\\$\[0-9\]* = $false" "print v_signed_long > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed long > (minus)" +test_expr "set variable v_signed_long=-1" "print v_signed_long == 0" "${::valnum_re} = $false" "print v_signed_long == -1" "${::valnum_re} = $true" "print signed signed long == (minus)" +test_expr "set variable v_signed_long=-1" "print v_signed_long != 0" "${::valnum_re} = $true" "print v_signed_long != -1" "${::valnum_re} = $false" "print signed signed long != (minus)" +test_expr "set variable v_signed_long=-1" "print v_signed_long < 0" "${::valnum_re} = $true" "print v_signed_long < 0x7FFF" "${::valnum_re} = $true" "print signed signed long < (minus)" +test_expr "set variable v_signed_long=-1" "print v_signed_long > 0" "${::valnum_re} = $false" "print v_signed_long > 0x7FFF" "${::valnum_re} = $false" "print signed signed long > (minus)" # # test expressions with "unsigned long" types # -test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long == 0" "\\$\[0-9\]* = $false" "print v_unsigned_long == 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned long ==" -test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long != 0" "\\$\[0-9\]* = $true" "print v_unsigned_long != 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned long !=" -test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long < 0" "\\$\[0-9\]* = $false" "print v_unsigned_long < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned long <" -test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long > 0" "\\$\[0-9\]* = $true" "print v_unsigned_long > 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned long >" +test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long == 0" "${::valnum_re} = $false" "print v_unsigned_long == 0x7FFF" "${::valnum_re} = $true" "print unsigned long ==" +test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long != 0" "${::valnum_re} = $true" "print v_unsigned_long != 0x7FFF" "${::valnum_re} = $false" "print unsigned long !=" +test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long < 0" "${::valnum_re} = $false" "print v_unsigned_long < 0x7FFF" "${::valnum_re} = $false" "print unsigned long <" +test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long > 0" "${::valnum_re} = $true" "print v_unsigned_long > 0x7FFF" "${::valnum_re} = $false" "print unsigned long >" # make long a minus -test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long == 0" "\\$\[0-9\]* = $false" "print v_unsigned_long == ~0" "\\$\[0-9\]* = $true" "print v_unsigned_long == (unsigned long)~0" "\\$\[0-9\]* = $true" "print unsigned long == (~0)" -test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long != 0" "\\$\[0-9\]* = $true" "print v_unsigned_long != (unsigned long)~0" "\\$\[0-9\]* = $false" "print unsigned long != (~0)" -test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long < 0" "\\$\[0-9\]* = $false" "print v_unsigned_long < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned long < (~0)" -test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long > 0" "\\$\[0-9\]* = $true" "print v_unsigned_long > 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned long > (~0)" +test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long == 0" "${::valnum_re} = $false" "print v_unsigned_long == ~0" "${::valnum_re} = $true" "print v_unsigned_long == (unsigned long)~0" "${::valnum_re} = $true" "print unsigned long == (~0)" +test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long != 0" "${::valnum_re} = $true" "print v_unsigned_long != (unsigned long)~0" "${::valnum_re} = $false" "print unsigned long != (~0)" +test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long < 0" "${::valnum_re} = $false" "print v_unsigned_long < 0x7FFF" "${::valnum_re} = $false" "print unsigned long < (~0)" +test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long > 0" "${::valnum_re} = $true" "print v_unsigned_long > 0x7FFF" "${::valnum_re} = $true" "print unsigned long > (~0)" # # Test expressions with casts to a pointer. # NB: Some architectures convert a ``NULL'' pointer into @@ -194,14 +194,14 @@ test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long > 0" "\\$\[0- # Prevent symbol on address 0x0 being printed. gdb_test_no_output "set print symbol off" -test_expr "set variable v_signed_char = 0" "print (void*)v_signed_char" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_signed_char" -test_expr "set variable v_signed_short = 0" "print (void*)v_signed_short" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_signed_short" -test_expr "set variable v_signed_int = 0" "print (void*)v_signed_int" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_signed_int" -test_expr "set variable v_signed_long = 0" "print (void*)v_signed_long" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_signed_long" -test_expr "set variable v_unsigned_char = 0" "print (void*)v_unsigned_char" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_unsigned_char" -test_expr "set variable v_unsigned_short = 0" "print (void*)v_unsigned_short" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_unsigned_short" -test_expr "set variable v_unsigned_int = 0" "print (void*)v_unsigned_int" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_unsigned_int" -test_expr "set variable v_unsigned_long = 0" "print (void*)v_unsigned_long" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_unsigned_long" +test_expr "set variable v_signed_char = 0" "print (void*)v_signed_char" "${::valnum_re} = .void \\*. $hex" "print (void*)v_signed_char" +test_expr "set variable v_signed_short = 0" "print (void*)v_signed_short" "${::valnum_re} = .void \\*. $hex" "print (void*)v_signed_short" +test_expr "set variable v_signed_int = 0" "print (void*)v_signed_int" "${::valnum_re} = .void \\*. $hex" "print (void*)v_signed_int" +test_expr "set variable v_signed_long = 0" "print (void*)v_signed_long" "${::valnum_re} = .void \\*. $hex" "print (void*)v_signed_long" +test_expr "set variable v_unsigned_char = 0" "print (void*)v_unsigned_char" "${::valnum_re} = .void \\*. $hex" "print (void*)v_unsigned_char" +test_expr "set variable v_unsigned_short = 0" "print (void*)v_unsigned_short" "${::valnum_re} = .void \\*. $hex" "print (void*)v_unsigned_short" +test_expr "set variable v_unsigned_int = 0" "print (void*)v_unsigned_int" "${::valnum_re} = .void \\*. $hex" "print (void*)v_unsigned_int" +test_expr "set variable v_unsigned_long = 0" "print (void*)v_unsigned_long" "${::valnum_re} = .void \\*. $hex" "print (void*)v_unsigned_long" # # Test expressions with pointers out of range # @@ -211,11 +211,11 @@ test_expr "set variable v_unsigned_long = 0" "print (void*)v_unsigned_long" "\\$ # gdb_test_multiple "print sizeof (long long) > sizeof (long)" \ "sizeof long long > sizeof long" { - -re "\\$\[0-9\]* = $true.*$gdb_prompt" { + -re "${::valnum_re} = $true.*$gdb_prompt" { set ok 1 pass "sizeof (long long) > sizeof (long) (true)" } - -re "\\$\[0-9\]* = $false.*$gdb_prompt" { + -re "${::valnum_re} = $false.*$gdb_prompt" { set ok 0 pass "sizeof (long long) > sizeof (long) (false)" } @@ -228,24 +228,24 @@ gdb_test "print (void*) (~((long long)(unsigned long) -1) - 1)" \ "warning: value truncated.*" "truncate (void*) 0xffffffff00000000 - 1" # String concatentation. -test_expr "print \"x\" \"y\"" "\\$\[0-9\]* = \"xy\"" -test_expr "print \"x\" \"y\" \"z\"" "\\$\[0-9\]* = \"xyz\"" +test_expr "print \"x\" \"y\"" "${::valnum_re} = \"xy\"" +test_expr "print \"x\" \"y\" \"z\"" "${::valnum_re} = \"xyz\"" # Enum formatting tests. -test_expr "print red" "\\$\[0-9\]* = red" +test_expr "print red" "${::valnum_re} = red" with_test_prefix "output-radix 8" { gdb_test "set output-radix 8" ".*" - test_expr "print red" "\\$\[0-9\]* = red" - test_expr "print/d red" "\\$\[0-9\]* = 0" + test_expr "print red" "${::valnum_re} = red" + test_expr "print/d red" "${::valnum_re} = 0" gdb_test "set output-radix 10" ".*" } # Pre-/post in-/decrement tests. gdb_test "set variable v_int = 1" "" -gdb_test "print v_int++" "\\$\[0-9\]* = 1" -gdb_test "print ++v_int" "\\$\[0-9\]* = 3" -gdb_test "print v_int--" "\\$\[0-9\]* = 3" -gdb_test "print --v_int" "\\$\[0-9\]* = 1" +gdb_test "print v_int++" "${::valnum_re} = 1" +gdb_test "print ++v_int" "${::valnum_re} = 3" +gdb_test "print v_int--" "${::valnum_re} = 3" +gdb_test "print --v_int" "${::valnum_re} = 1" gdb_test "print v_int++ = 5" "Left operand of assignment is not an lvalue." gdb_test "print v_int-- = 5" "Left operand of assignment is not an lvalue." diff --git a/gdb/testsuite/gdb.base/gdb1090.exp b/gdb/testsuite/gdb.base/gdb1090.exp index ffa6d13bbcc..5e0e6e1047b 100644 --- a/gdb/testsuite/gdb.base/gdb1090.exp +++ b/gdb/testsuite/gdb.base/gdb1090.exp @@ -36,10 +36,10 @@ gdb_breakpoint [gdb_get_line_number "break-here"] gdb_continue_to_breakpoint "break-here" ".* break-here .*" gdb_test_multiple "print s24" "print s24" { - -re "\\\$\[0-9\]* = \\{field_0 = 1170, field_1 = 64701\\}\r\n$gdb_prompt $" { + -re "${::valnum_re} = \\{field_0 = 1170, field_1 = 64701\\}\r\n$gdb_prompt $" { pass "print s24" } - -re "\\\$\[0-9\]* = \\{field_0 = 1170, field_1 = .*\\}\r\n$gdb_prompt $" { + -re "${::valnum_re} = \\{field_0 = 1170, field_1 = .*\\}\r\n$gdb_prompt $" { # happens with gcc 2.95.3, which actually puts s24 in registers. # gdb cannot find the second register and prints garbage. kfail "gdb/1090" "print s24" diff --git a/gdb/testsuite/gdb.base/offsets.exp b/gdb/testsuite/gdb.base/offsets.exp index 13283ccca92..2286f0c2276 100644 --- a/gdb/testsuite/gdb.base/offsets.exp +++ b/gdb/testsuite/gdb.base/offsets.exp @@ -24,7 +24,7 @@ if { [prepare_for_testing "failed to prepare for testing large offsets" \ set test "print &big_struct test" gdb_test_multiple "print &big_struct" "$test" { - -re "\\$\[0-9\]* = .* (0x\[0-9a-fA-F\]*) .*\[\r\n\]*$gdb_prompt $" { + -re "${::valnum_re} = .* (0x\[0-9a-fA-F\]*) .*\[\r\n\]*$gdb_prompt $" { set addr1 $expect_out(1,string) pass "$test ($addr1)" } @@ -32,7 +32,7 @@ gdb_test_multiple "print &big_struct" "$test" { set test "print &big_struct.second test" gdb_test_multiple "print &big_struct.second" "$test" { - -re "\\$\[0-9\]* = .* (0x\[0-9a-fA-F\]*) .*\[\r\n\]*$gdb_prompt $" { + -re "${::valnum_re} = .* (0x\[0-9a-fA-F\]*) .*\[\r\n\]*$gdb_prompt $" { set addr2 $expect_out(1,string) if {[expr {$addr2 - $addr1}] == [expr {0x10000000 + 16}]} { diff --git a/gdb/testsuite/gdb.base/readline.exp b/gdb/testsuite/gdb.base/readline.exp index 5f75b70e7e4..f8f9adecf8f 100644 --- a/gdb/testsuite/gdb.base/readline.exp +++ b/gdb/testsuite/gdb.base/readline.exp @@ -174,10 +174,10 @@ save_vars { env(TERM) } { # Verify that arrow keys work in secondary prompts. The control # sequence is a hard-coded VT100 up arrow. - gdb_test "print 42" "\\\$\[0-9\]* = 42" + gdb_test "print 42" "${::valnum_re} = 42" set msg "arrow keys with secondary prompt" gdb_test_multiple "if 1 > 0\n\033\[A\033\[A\nend" $msg { - -re ".*\\\$\[0-9\]* = 42\r\n$gdb_prompt $" { + -re ".*${::valnum_re} = 42\r\n$gdb_prompt $" { pass $msg } -re ".*Undefined command:.*$gdb_prompt $" { @@ -188,9 +188,9 @@ save_vars { env(TERM) } { # Use the up arrow to select a previous command. Check that # no unexpected output is added between the previously # selected command, and the output of that command. - gdb_test "print 123" "\\\$\[0-9\]* = 123" + gdb_test "print 123" "${::valnum_re} = 123" gdb_test_multiple "\033\[A" "use up arrow" { - -re -wrap "print 123\r\n\\\$\[0-9\]* = 123" { + -re -wrap "print 123\r\n${::valnum_re} = 123" { pass $gdb_test_name } } diff --git a/gdb/testsuite/gdb.cp/anon-union.exp b/gdb/testsuite/gdb.cp/anon-union.exp index ae66c2374b8..5b26f7a848d 100644 --- a/gdb/testsuite/gdb.cp/anon-union.exp +++ b/gdb/testsuite/gdb.cp/anon-union.exp @@ -62,7 +62,7 @@ gdb_test "next" "40\[ \t\]*foo.paper = 33;" "next 1" # Print out the big anon union. gdb_test "print foo" \ - "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 0, x = \{rock = 0, rock2 = 0\}, \{qux = 0, mux = 0\}, boulder = 0\}, \{paper = 0, cloth = 0\}, num2 = \{two = 0, three = 0\}\}" \ + "${::valnum_re} = \{num1 = \{zero = 0, one = 0\}, \{pebble = 0, x = \{rock = 0, rock2 = 0\}, \{qux = 0, mux = 0\}, boulder = 0\}, \{paper = 0, cloth = 0\}, num2 = \{two = 0, three = 0\}\}" \ "print foo 1" # Step over assignment to member @@ -71,7 +71,7 @@ gdb_test "next" "41\[ \t\]*foo.pebble = 44;" "next 2" # Now print out anon union again gdb_test "print foo" \ - "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 0, x = \{rock = 0, rock2 = 0\}, \{qux = 0, mux = 0\}, boulder = 0\}, \{paper = 33, cloth = 33\}, num2 = \{two = 0, three = 0\}\}" \ + "${::valnum_re} = \{num1 = \{zero = 0, one = 0\}, \{pebble = 0, x = \{rock = 0, rock2 = 0\}, \{qux = 0, mux = 0\}, boulder = 0\}, \{paper = 33, cloth = 33\}, num2 = \{two = 0, three = 0\}\}" \ "print foo 2" # Modify the member just set @@ -79,7 +79,7 @@ gdb_test_no_output "set var foo.cloth = 35" "set var foo.cloth" # Now print out anon union again to see if the right member was set gdb_test "print foo" \ - "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 0, x = \{rock = 0, rock2 = 0\}, \{qux = 0, mux = 0\}, boulder = 0\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \ + "${::valnum_re} = \{num1 = \{zero = 0, one = 0\}, \{pebble = 0, x = \{rock = 0, rock2 = 0\}, \{qux = 0, mux = 0\}, boulder = 0\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \ "print foo 3" # Step over next assignment to member @@ -88,7 +88,7 @@ gdb_test "next" "42\[ \t\]*foo.mux = 55;" "next 3" # Now print out anon union again gdb_test "print foo" \ - "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 44, x = \{rock = 44, rock2 = 0\}, \{qux = 44, mux = 44\}, boulder = 44\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \ + "${::valnum_re} = \{num1 = \{zero = 0, one = 0\}, \{pebble = 44, x = \{rock = 44, rock2 = 0\}, \{qux = 44, mux = 44\}, boulder = 44\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \ "print foo 4" # Modify the member just set @@ -96,7 +96,7 @@ gdb_test_no_output "set var foo.pebble = 45" "set var foo.pebble" # Now print out anon union again to see if the right member was set gdb_test "print foo" \ - "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 45, x = \{rock = 45, rock2 = 0\}, \{qux = 45, mux = 45\}, boulder = 45\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \ + "${::valnum_re} = \{num1 = \{zero = 0, one = 0\}, \{pebble = 45, x = \{rock = 45, rock2 = 0\}, \{qux = 45, mux = 45\}, boulder = 45\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \ "print foo 5" # Modify another member at a different level @@ -104,7 +104,7 @@ gdb_test_no_output "set var foo.qux = 46" "set var foo.qux" # Now print out anon union again to see if the right member was set gdb_test "print foo" \ - "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 46, x = \{rock = 46, rock2 = 0\}, \{qux = 46, mux = 46\}, boulder = 46\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \ + "${::valnum_re} = \{num1 = \{zero = 0, one = 0\}, \{pebble = 46, x = \{rock = 46, rock2 = 0\}, \{qux = 46, mux = 46\}, boulder = 46\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \ "print foo 6" # Modify the member at another level, but not the first one in the union @@ -112,7 +112,7 @@ gdb_test_no_output "set var foo.mux = 47" "set var foo.mux" # Now print out anon union again to see if things worked gdb_test "print foo" \ - "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 47, x = \{rock = 47, rock2 = 0\}, \{qux = 47, mux = 47\}, boulder = 47\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \ + "${::valnum_re} = \{num1 = \{zero = 0, one = 0\}, \{pebble = 47, x = \{rock = 47, rock2 = 0\}, \{qux = 47, mux = 47\}, boulder = 47\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \ "print foo 7" # Modify a member of a struct in an anon union @@ -120,7 +120,7 @@ gdb_test_no_output "set var foo.x.rock = 48" "set var foo.x.rock" # Now print out anon union again to see if things worked gdb_test "print foo" \ - "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 48, x = \{rock = 48, rock2 = 0\}, \{qux = 48, mux = 48\}, boulder = 48\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \ + "${::valnum_re} = \{num1 = \{zero = 0, one = 0\}, \{pebble = 48, x = \{rock = 48, rock2 = 0\}, \{qux = 48, mux = 48\}, boulder = 48\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \ "print foo 8" # Modify a member of a struct in an anon union, but something @@ -129,7 +129,7 @@ gdb_test_no_output "set var foo.x.rock2 = 49" "set var foo.x.rock2" # Now print out anon union again to see if things worked gdb_test "print foo" \ - "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 48, x = \{rock = 48, rock2 = 49\}, \{qux = 48, mux = 48\}, boulder = 48\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \ + "${::valnum_re} = \{num1 = \{zero = 0, one = 0\}, \{pebble = 48, x = \{rock = 48, rock2 = 49\}, \{qux = 48, mux = 48\}, boulder = 48\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}" \ "print foo 9" # Step over next four assignments @@ -137,24 +137,24 @@ gdb_test "next 4" "53\[ \t\]*w = 45;" # Tests for anon unions that are not members of a class or struct -gdb_test "print w" "\\$\[0-9\]* = 0" "print w 1" +gdb_test "print w" "${::valnum_re} = 0" "print w 1" -gdb_test "print z" "\\$\[0-9\]* = 0" "print z 1" +gdb_test "print z" "${::valnum_re} = 0" "print z 1" # Step over next assignment to w gdb_test "next" "55\[ \t\]*int j = 0;" "next 5" # See if the change in value is noticed -gdb_test "print w" "\\$\[0-9\]* = 45" "print w 2" +gdb_test "print w" "${::valnum_re} = 45" "print w 2" # See if z shows the same value -gdb_test "print z" "\\$\[0-9\]* = 45" "print z 2" +gdb_test "print z" "${::valnum_re} = 45" "print z 2" # Set the anon union member gdb_test_no_output "set var z = 27" "set var z" # See if the change in value is noticed -gdb_test "print w" "\\$\[0-9\]* = 27" "print w 3" +gdb_test "print w" "${::valnum_re} = 27" "print w 3" # See if z shows the same value -gdb_test "print z" "\\$\[0-9\]* = 27" "print z 3" +gdb_test "print z" "${::valnum_re} = 27" "print z 3" diff --git a/gdb/testsuite/gdb.cp/m-data.exp b/gdb/testsuite/gdb.cp/m-data.exp index 528df376e26..7b67d78d55b 100644 --- a/gdb/testsuite/gdb.cp/m-data.exp +++ b/gdb/testsuite/gdb.cp/m-data.exp @@ -42,47 +42,47 @@ gdb_continue_to_breakpoint "end of first constructors" # One. # simple object, const bool -gdb_test "print test1.test" "\\$\[0-9\]* = true" "simple object, const bool" +gdb_test "print test1.test" "${::valnum_re} = true" "simple object, const bool" # simple object, const int -gdb_test "print test1.key1" "\\$\[0-9\]* = 5" "simple object, const int" +gdb_test "print test1.key1" "${::valnum_re} = 5" "simple object, const int" # simple object, long -gdb_test "print test1.key2" "\\$\[0-9\]* = 4589" "simple object, long" +gdb_test "print test1.key2" "${::valnum_re} = 4589" "simple object, long" # simple object, enum -gdb_test "print test1.value" "\\$\[0-9\]* = egyptian" "simple object, enum" +gdb_test "print test1.value" "${::valnum_re} = egyptian" "simple object, enum" # Two. # derived template object, base const bool -gdb_test "print test2.test" "\\$\[0-9\]* = true" "derived template object, base const bool" +gdb_test "print test2.test" "${::valnum_re} = true" "derived template object, base const bool" # derived template object, base const int -gdb_test "print test2.key1" "\\$\[0-9\]* = 5" "derived template object, base const int" +gdb_test "print test2.key1" "${::valnum_re} = 5" "derived template object, base const int" # derived template object, base long -gdb_test "print test2.key2" "\\$\[0-9\]* = 7" "derived template object, base long" +gdb_test "print test2.key2" "${::valnum_re} = 7" "derived template object, base long" # derived template object, base enum -gdb_test "print test2.value" "\\$\[0-9\]* = oriental" "derived template object, base enum" +gdb_test "print test2.value" "${::valnum_re} = oriental" "derived template object, base enum" # derived template object, enum -gdb_test "print test2.value_derived" "\\$\[0-9\]* = roman" "derived template object, derived enum" +gdb_test "print test2.value_derived" "${::valnum_re} = roman" "derived template object, derived enum" # Three. # template object, derived template data member's base const bool -gdb_test "print test3.data.test" "\\$\[0-9\]* = true" "template object, const bool" +gdb_test "print test3.data.test" "${::valnum_re} = true" "template object, const bool" # template object, derived template data member's base const int -gdb_test "print test3.data.key1" "\\$\[0-9\]* = 5" "template object, const int" +gdb_test "print test3.data.key1" "${::valnum_re} = 5" "template object, const int" # template object, derived template data member's base long -gdb_test "print test3.data.key2" "\\$\[0-9\]* = 7" "template object, long" +gdb_test "print test3.data.key2" "${::valnum_re} = 7" "template object, long" # template object, derived template data member's base enum -gdb_test "print test3.data.value" "\\$\[0-9\]* = oriental" "template object, base enum" +gdb_test "print test3.data.value" "${::valnum_re} = oriental" "template object, base enum" # template object, derived template data member's enum gdb_test "print test3.data.value_derived" "\\$\[0-9]\* = etruscan" "template object, derived enum" diff --git a/gdb/testsuite/gdb.cp/m-static.exp b/gdb/testsuite/gdb.cp/m-static.exp index 437a69053a9..05516d918ac 100644 --- a/gdb/testsuite/gdb.cp/m-static.exp +++ b/gdb/testsuite/gdb.cp/m-static.exp @@ -56,16 +56,16 @@ gdb_continue_to_breakpoint "end of constructors" # One. # simple object, static const bool -gdb_test "print test1.test" "\\$\[0-9\]* = true" "simple object, static const bool" +gdb_test "print test1.test" "${::valnum_re} = true" "simple object, static const bool" # simple object, static const int -gdb_test "print test1.key1" "\\$\[0-9\]* = 5" "simple object, static const int" +gdb_test "print test1.key1" "${::valnum_re} = 5" "simple object, static const int" # simple object, static long -gdb_test "print test1.key2" "\\$\[0-9\]* = 77" "simple object, static long" +gdb_test "print test1.key2" "${::valnum_re} = 77" "simple object, static long" # simple object, static enum -gdb_test "print test1.value" "\\$\[0-9\]* = oriental" "simple object, static enum" +gdb_test "print test1.value" "${::valnum_re} = oriental" "simple object, static enum" if { [is_aarch32_target] } { gdb_test "print test5.single_constructor" \ @@ -130,13 +130,13 @@ if { [is_aarch32_target] } { # Two. # derived template object, base static const bool -gdb_test "print test2.test" "\\$\[0-9\]* = true" "derived template object, base static const bool" +gdb_test "print test2.test" "${::valnum_re} = true" "derived template object, base static const bool" # derived template object, base static const int -gdb_test "print test2.key1" "\\$\[0-9\]* = 5" "derived template object, base static const int" +gdb_test "print test2.key1" "${::valnum_re} = 5" "derived template object, base static const int" # derived template object, base static long -gdb_test "print test2.key2" "\\$\[0-9\]* = 77" "derived template object, base static long" +gdb_test "print test2.key2" "${::valnum_re} = 77" "derived template object, base static long" # derived template object, base static enum gdb_test "print test2.value" "\\$\[0-9\].* = oriental" "derived template object, base static enum" diff --git a/gdb/testsuite/gdb.cp/method.exp b/gdb/testsuite/gdb.cp/method.exp index 4f05e5c0efa..d890be1df9e 100644 --- a/gdb/testsuite/gdb.cp/method.exp +++ b/gdb/testsuite/gdb.cp/method.exp @@ -57,13 +57,13 @@ gdb_test "continue" \ # Check ability to access this-relative stuff. gdb_test "print x" \ - "\\$\[0-9\]* = 20" \ + "${::valnum_re} = 20" \ "print x in A::foo" # Check access to this pointer gdb_test "print this" \ - "\\$\[0-9\]* = \\((class |)A *\\* *(const|)\\) $hex" \ + "${::valnum_re} = \\((class |)A *\\* *(const|)\\) $hex" \ "print this in A::foo" # Now do everything over again for A::bar, because sometimes processing one method @@ -79,7 +79,7 @@ gdb_test "continue" \ # Check ability to access this-relative stuff. gdb_test "print x" \ - "\\$\[0-9\]* = 33" \ + "${::valnum_re} = 33" \ "print x in A::bar" # Check access to this pointer @@ -87,17 +87,17 @@ gdb_test "print x" \ get_debug_format gdb_test_multiple "print this" "print this in A::bar" { - -re "\\$\[0-9\]* = \\(const (class |)A *\\* *(const|)\\) $hex\r\n$gdb_prompt $" { + -re "${::valnum_re} = \\(const (class |)A *\\* *(const|)\\) $hex\r\n$gdb_prompt $" { pass "print this in A::bar" } - -re "\\$\[0-9\]* = \\((class |)A *\\* *(const|)\\) $hex\r\n$gdb_prompt $" { + -re "${::valnum_re} = \\((class |)A *\\* *(const|)\\) $hex\r\n$gdb_prompt $" { # gcc versions up to 3.0.4 with -gstabs+ do not emit "const" # indicators, so the output is "A *". It should be "const A # *" or "const A * const". setup_xfail_format "stabs" fail "print this in A::bar (missing const)" } - -re "\\$\[0-9\]* = \\(const (class |)\{\\.\\.\\.\} *\\* *(const|)\\) $hex\r\n$gdb_prompt $" { + -re "${::valnum_re} = \\(const (class |)\{\\.\\.\\.\} *\\* *(const|)\\) $hex\r\n$gdb_prompt $" { # gcc versions gcc-3_1-branch%20020404 and HEAD%20020404 with -gstabs+ # produce good stabs, but gdb prints "const class {...} *" const. # This is PR gdb/277. @@ -120,19 +120,19 @@ gdb_test "continue" \ # Check ability to access this-relative stuff. gdb_test "print data_" \ - "\\$\[0-9\]* = 33" \ + "${::valnum_re} = 33" \ "print data_ in funk::getFunky" # Check access to this pointer gdb_test "print this" \ - "\\$\[0-9\]* = \\((class |)funk *\\* *(const|)\\) $hex" \ + "${::valnum_re} = \\((class |)funk *\\* *(const|)\\) $hex" \ "print this in funk::getFunky" # Check access to local variable gdb_test "print res" \ - "\\$\[0-9\]* = -30" \ + "${::valnum_re} = -30" \ "print res in funk::getFunky" # Check ptype of class -- should show const/volatile methods diff --git a/gdb/testsuite/gdb.cp/misc.exp b/gdb/testsuite/gdb.cp/misc.exp index c0de6b7a041..974ad1a550c 100644 --- a/gdb/testsuite/gdb.cp/misc.exp +++ b/gdb/testsuite/gdb.cp/misc.exp @@ -67,52 +67,52 @@ proc do_tests {} { do_tests test_expr "set language c++" \ - "print 1 == 1" "print.*\\$\[0-9\]* = true" \ - "print 1 == 2" "print.*\\$\[0-9\]* = false" \ + "print 1 == 1" "print.*${::valnum_re} = true" \ + "print 1 == 2" "print.*${::valnum_re} = false" \ "print as bool" # Test bool type printing, etc. # Note: Language is already set to C++ above! -gdb_test "print v_bool" "\\$\[0-9\]* = false" "print a bool var" +gdb_test "print v_bool" "${::valnum_re} = false" "print a bool var" # set a bool variable test_expr "set variable v_bool = true" \ - "print v_bool" "\\$\[0-9\]* = true" \ + "print v_bool" "${::valnum_re} = true" \ "set a bool var" # next print an array of bool -gdb_test "print v_bool_array" "\\$\[0-9\]* = \\{false, false\\}" "print a bool array" +gdb_test "print v_bool_array" "${::valnum_re} = \\{false, false\\}" "print a bool array" # set elements of a bool array test_expr "set variable v_bool_array\[1\] = true" \ - "print v_bool_array" "\\$\[0-9\]* = \\{false, true\\}" \ + "print v_bool_array" "${::valnum_re} = \\{false, true\\}" \ "set a bool array elem" # bool constants -gdb_test "print true" "\\$\[0-9\]* = true" -gdb_test "print false" "\\$\[0-9\]* = false" +gdb_test "print true" "${::valnum_re} = true" +gdb_test "print false" "${::valnum_re} = false" # arithmetic conversions -gdb_test "print 1 + true" "\\$\[0-9\]* = 2" "1 + true" -gdb_test "print 3 + false" "\\$\[0-9\]* = 3" "3 + false" -gdb_test "print 1 < 2 < 3" "\\$\[0-9\]* = true" "1 < 2 < 3" -gdb_test "print 2 < 1 > 4" "\\$\[0-9\]* = false" "2 < 1 > 4" -gdb_test "print (bool)43" "\\$\[0-9\]* = true" "(bool)43" -gdb_test "print (bool)0" "\\$\[0-9\]* = false" "(bool)0" -gdb_test "print (bool)17.93" "\\$\[0-9\]* = true" "(bool)17.93" -gdb_test "print (bool)0.0" "\\$\[0-9\]* = false" "(bool)0.0" -gdb_test "print (int)true" "\\$\[0-9\]* = 1" "(int)true" -gdb_test "print (int)false" "\\$\[0-9\]* = 0" "(int)false" +gdb_test "print 1 + true" "${::valnum_re} = 2" "1 + true" +gdb_test "print 3 + false" "${::valnum_re} = 3" "3 + false" +gdb_test "print 1 < 2 < 3" "${::valnum_re} = true" "1 < 2 < 3" +gdb_test "print 2 < 1 > 4" "${::valnum_re} = false" "2 < 1 > 4" +gdb_test "print (bool)43" "${::valnum_re} = true" "(bool)43" +gdb_test "print (bool)0" "${::valnum_re} = false" "(bool)0" +gdb_test "print (bool)17.93" "${::valnum_re} = true" "(bool)17.93" +gdb_test "print (bool)0.0" "${::valnum_re} = false" "(bool)0.0" +gdb_test "print (int)true" "${::valnum_re} = 1" "(int)true" +gdb_test "print (int)false" "${::valnum_re} = 0" "(int)false" gdb_test "print 'misc.cc'::v_bool" " = true" \ "expression using block qualifier" # pointer arithmetic -gdb_test "print *(v_bool_array + number_ref)" "\\$\[0-9\]* = false" \ +gdb_test "print *(v_bool_array + number_ref)" "${::valnum_re} = false" \ "pointer addition with integer reference" -gdb_test "print *(number_ref + v_bool_array)" "\\$\[0-9\]* = false" \ +gdb_test "print *(number_ref + v_bool_array)" "${::valnum_re} = false" \ "integer reference addition with pointer" -gdb_test "print *(v_bool_array - number_ref)" "\\$\[0-9\]* = false" \ +gdb_test "print *(v_bool_array - number_ref)" "${::valnum_re} = false" \ "pointer subtraction with integer reference" # C++14 digit separator. diff --git a/gdb/testsuite/gdb.cp/namespace.exp b/gdb/testsuite/gdb.cp/namespace.exp index 5e9bee31239..50fa4c843b1 100644 --- a/gdb/testsuite/gdb.cp/namespace.exp +++ b/gdb/testsuite/gdb.cp/namespace.exp @@ -65,10 +65,10 @@ gdb_test "up" ".*main.*" "up from marker1" # shouldn't work with quotes, I'm only including one version. gdb_test "print 'AAA::c'" \ - "\\$\[0-9\]* = 0 '\\\\(0|000)'" + "${::valnum_re} = 0 '\\\\(0|000)'" gdb_test "print AAA::c" \ - "\\$\[0-9\]* = 0 '\\\\(0|000)'" + "${::valnum_re} = 0 '\\\\(0|000)'" # An object declared using "using". @@ -98,10 +98,10 @@ gdb_test_multiple "info func xyzq" "info func xyzq" { # Call a function in a namespace gdb_test "print 'AAA::xyzq'('x')" \ - "\\$\[0-9\]* = 97 'a'" + "${::valnum_re} = 97 'a'" gdb_test "print AAA::xyzq('x')" \ - "\\$\[0-9\]* = 97 'a'" + "${::valnum_re} = 97 'a'" # Break on a function in a namespace @@ -116,10 +116,10 @@ gdb_test "break -qualified ::ensureOtherRefs" \ # Call a function in a nested namespace gdb_test "print 'BBB::CCC::xyzq'('x')" \ - "\\$\[0-9\]* = 122 'z'" + "${::valnum_re} = 122 'z'" gdb_test "print BBB::CCC::xyzq('x')" \ - "\\$\[0-9\]* = 122 'z'" + "${::valnum_re} = 122 'z'" # Break on a function in a nested namespace @@ -134,10 +134,10 @@ gdb_test "break ::BBB::CCC::xyzq" \ # Print address of a function in a class in a namespace gdb_test "print 'BBB::Class::xyzq'" \ - "\\$\[0-9\]* = \{char \\((BBB::|)Class \\*( const|), (char|int)\\)\} $hex " + "${::valnum_re} = \{char \\((BBB::|)Class \\*( const|), (char|int)\\)\} $hex " gdb_test "print BBB::Class::xyzq" \ - "\\$\[0-9\]* = \{char \\((BBB::|)Class \\*( const|), (char|int)\\)\} $hex " + "${::valnum_re} = \{char \\((BBB::|)Class \\*( const|), (char|int)\\)\} $hex " # Break on a function in a class in a namespace diff --git a/gdb/testsuite/gdb.cp/pr-574.exp b/gdb/testsuite/gdb.cp/pr-574.exp index 1fb3e741407..1952463063f 100644 --- a/gdb/testsuite/gdb.cp/pr-574.exp +++ b/gdb/testsuite/gdb.cp/pr-574.exp @@ -52,6 +52,6 @@ gdb_continue_to_breakpoint "end of constructors" # Different compilers order the data for differently, so I'm not # matching the result exactly. -gdb_test "print *theB" "\\$\[0-9\]* = { = {\[^}\]*}, static b = }" "PR gdb/574" +gdb_test "print *theB" "${::valnum_re} = { = {\[^}\]*}, static b = }" "PR gdb/574" gdb_exit diff --git a/gdb/testsuite/gdb.cp/printmethod.exp b/gdb/testsuite/gdb.cp/printmethod.exp index 8e28233238a..bad147b874d 100644 --- a/gdb/testsuite/gdb.cp/printmethod.exp +++ b/gdb/testsuite/gdb.cp/printmethod.exp @@ -43,10 +43,10 @@ gdb_continue_to_breakpoint "end of constructors" # The first of these is for PR gdb/653. gdb_test "print theA->virt" \ - "\\$\[0-9\]* = {void \\(A \\* const\\)} $hex " \ + "${::valnum_re} = {void \\(A \\* const\\)} $hex " \ "print virtual method." gdb_test "print theA->nonvirt" \ - "\\$\[0-9\]* = {void \\(A \\* const\\)} $hex " \ + "${::valnum_re} = {void \\(A \\* const\\)} $hex " \ "print nonvirtual method." gdb_exit diff --git a/gdb/testsuite/gdb.cp/rtti.exp b/gdb/testsuite/gdb.cp/rtti.exp index 8a7d02d2730..b694ab935e3 100644 --- a/gdb/testsuite/gdb.cp/rtti.exp +++ b/gdb/testsuite/gdb.cp/rtti.exp @@ -59,10 +59,10 @@ gdb_test_multiple "print *e1" "print *e1" { # gdb 6.0 kfail "gdb/488" "print *e1" } - -re "\\$\[0-9\]* = { = .*}\r\n$gdb_prompt $" { + -re "${::valnum_re} = { = .*}\r\n$gdb_prompt $" { pass "print *e1" } - -re "\\$\[0-9\]* = { = .*}\r\n$gdb_prompt $" { + -re "${::valnum_re} = { = .*}\r\n$gdb_prompt $" { # NOTE: carlton/2003-05-16: If code is compiled by GCC2, we # don't print the warning (for no particular reason), but we # still call the class via the wrong name; PR gdb/57 is our @@ -89,13 +89,13 @@ gdb_test_multiple "print *e2" "print *e2" { # gdb 6.0 kfail "gdb/488" "print *e2" } - -re "\\$\[0-9\]* = \r\n$gdb_prompt $" { + -re "${::valnum_re} = \r\n$gdb_prompt $" { kfail "gdb/1511" "print *e2" } - -re "\\$\[0-9\]* = { = .*}\r\n$gdb_prompt $" { + -re "${::valnum_re} = { = .*}\r\n$gdb_prompt $" { pass "print *e2" } - -re "\\$\[0-9\]* = { = .*}\r\n$gdb_prompt $" { + -re "${::valnum_re} = { = .*}\r\n$gdb_prompt $" { kfail "gdb/57" "print *e2" } } @@ -106,11 +106,11 @@ gdb_test_multiple "print *e2" "print *e2" { gdb_breakpoint [gdb_get_line_number "func-constructs-done" "$srcfile"] gdb_continue_to_breakpoint "end of constructors in func" -gdb_test "print *obj" "\\$\[0-9\]* = { = .*}" +gdb_test "print *obj" "${::valnum_re} = { = .*}" gdb_breakpoint [gdb_get_line_number "func3-constructs-done" "$srcfile"] gdb_continue_to_breakpoint "end of constructors in func3" -gdb_test "print *obj3" "\\$\[0-9\]* = { = .*}" +gdb_test "print *obj3" "${::valnum_re} = { = .*}" gdb_exit diff --git a/gdb/testsuite/gdb.cp/templates.exp b/gdb/testsuite/gdb.cp/templates.exp index 6598df34425..3531b231e5d 100644 --- a/gdb/testsuite/gdb.cp/templates.exp +++ b/gdb/testsuite/gdb.cp/templates.exp @@ -279,12 +279,12 @@ gdb_breakpoint [gdb_get_line_number "Final breakpoint"] gdb_continue_to_breakpoint "Final breakpoint" gdb_test "print fint" \ - "\\$\[0-9\]* = \\{x = 0, t = 0\\}" + "${::valnum_re} = \\{x = 0, t = 0\\}" # Prevent symbol on address 0x0 being printed. gdb_test_no_output "set print symbol off" gdb_test "print fvpchar" \ - "\\$\[0-9\]* = \\{x = 0, t = 0x0\\}" + "${::valnum_re} = \\{x = 0, t = 0x0\\}" # Template Foo @@ -356,7 +356,7 @@ gdb_test_multiple "ptype/r fvpchar" "ptype fvpchar" { # varying the spacing, because of PR gdb/7138. gdb_test_multiple "print Foo::foo" "print Foo::foo" { - -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<(volatile char|char volatile) ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex ::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { + -re "${::valnum_re} = \\{.*char \\*\\((class |)Foo<(volatile char|char volatile) ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex ::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo::foo" } -re "No symbol \"Foo\" in current context.\r\n$gdb_prompt $" { @@ -366,7 +366,7 @@ gdb_test_multiple "print Foo::foo" "print Foo: } gdb_test_multiple "print Foo::foo" "print Foo::foo" { - -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<(volatile char|char volatile) ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex ::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { + -re "${::valnum_re} = \\{.*char \\*\\((class |)Foo<(volatile char|char volatile) ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex ::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo::foo" } -re "No symbol \"Foo\" in current context.\r\n$gdb_prompt $" { @@ -601,7 +601,7 @@ gdb_test_multiple "ptype/r Garply >" "ptype Garply >" # print out a function from a nested template name gdb_test "print Garply >::garply" \ - "\\$\[0-9\]* = \\{(class |)Garply \\((class |)Garply > \\*(| const), int, (class |)Garply\\)\\} $hex \[ \t\]*>::garply\\(int, (class |)Garply\\)>" + "${::valnum_re} = \\{(class |)Garply \\((class |)Garply > \\*(| const), int, (class |)Garply\\)\\} $hex \[ \t\]*>::garply\\(int, (class |)Garply\\)>" # djb - 06-03-2000 # Now should work fine diff --git a/gdb/testsuite/gdb.cp/userdef.exp b/gdb/testsuite/gdb.cp/userdef.exp index 4a7fa0304f2..68362fed2b0 100644 --- a/gdb/testsuite/gdb.cp/userdef.exp +++ b/gdb/testsuite/gdb.cp/userdef.exp @@ -40,7 +40,7 @@ gdb_test "cont" \ gdb_test "up" " in main .*" "up from marker1" -gdb_test "print one + two" "\\\$\[0-9\]* = {x = 6, y = 8}" +gdb_test "print one + two" "${::valnum_re} = {x = 6, y = 8}" # If GDB fails to restore the selected frame properly after the # inferior function call above (see GDB PR 1155 for an explanation of @@ -59,74 +59,74 @@ gdb_test_multiple "frame" "re-selected 'main' frame after inferior call" { } } -gdb_test "print one - two" "\\\$\[0-9\]* = {x = -2, y = -2}" +gdb_test "print one - two" "${::valnum_re} = {x = -2, y = -2}" -gdb_test "print one * two" "\\\$\[0-9\]* = {x = 8, y = 15}" +gdb_test "print one * two" "${::valnum_re} = {x = 8, y = 15}" -gdb_test "print one / two" "\\\$\[0-9\]* = {x = 0, y = 0}" +gdb_test "print one / two" "${::valnum_re} = {x = 0, y = 0}" -gdb_test "print one % two" "\\\$\[0-9\]* = {x = 2, y = 3}" +gdb_test "print one % two" "${::valnum_re} = {x = 2, y = 3}" -gdb_test "print one && two" "\\\$\[0-9\]* = 1" +gdb_test "print one && two" "${::valnum_re} = 1" -gdb_test "print one || two" "\\\$\[0-9\]* = 1" +gdb_test "print one || two" "${::valnum_re} = 1" -gdb_test "print one & two" "\\\$\[0-9\]* = {x = 0, y = 1}" +gdb_test "print one & two" "${::valnum_re} = {x = 0, y = 1}" -gdb_test "print one | two" "\\\$\[0-9\]* = {x = 6, y = 7}" +gdb_test "print one | two" "${::valnum_re} = {x = 6, y = 7}" -gdb_test "print one ^ two" "\\\$\[0-9\]* = {x = 6, y = 6}" +gdb_test "print one ^ two" "${::valnum_re} = {x = 6, y = 6}" -gdb_test "print one < two" "\\\$\[0-9\]* = 1" +gdb_test "print one < two" "${::valnum_re} = 1" -gdb_test "print one <= two" "\\\$\[0-9\]* = 1" +gdb_test "print one <= two" "${::valnum_re} = 1" -gdb_test "print one > two" "\\\$\[0-9\]* = 0" +gdb_test "print one > two" "${::valnum_re} = 0" -gdb_test "print one >= two" "\\\$\[0-9\]* = 0" +gdb_test "print one >= two" "${::valnum_re} = 0" -gdb_test "print one == two" "\\\$\[0-9\]* = 0" -gdb_test "print one.operator== (two)" "\\\$\[0-9\]* = 0" +gdb_test "print one == two" "${::valnum_re} = 0" +gdb_test "print one.operator== (two)" "${::valnum_re} = 0" -gdb_test "print one != two" "\\\$\[0-9\]* = 1" +gdb_test "print one != two" "${::valnum_re} = 1" # Can't really check the output of this one without knowing # target integer width. Make sure we don't try to call # the iostreams operator instead, though. -gdb_test "print one << 31" "\\\$\[0-9\]* = {x = -?\[0-9\]*, y = -?\[0-9\]*}" +gdb_test "print one << 31" "${::valnum_re} = {x = -?\[0-9\]*, y = -?\[0-9\]*}" # Should be fine even on < 32-bit targets. -gdb_test "print one >> 31" "\\\$\[0-9\]* = {x = 0, y = 0}" +gdb_test "print one >> 31" "${::valnum_re} = {x = 0, y = 0}" -gdb_test "print !one" "\\\$\[0-9\]* = 0" +gdb_test "print !one" "${::valnum_re} = 0" # Assumes 2's complement. So does everything... -gdb_test "print +one" "\\\$\[0-9\]* = {x = 2, y = 3}" +gdb_test "print +one" "${::valnum_re} = {x = 2, y = 3}" -gdb_test "print ~one" "\\\$\[0-9\]* = {x = -3, y = -4}" +gdb_test "print ~one" "${::valnum_re} = {x = -3, y = -4}" -gdb_test "print -one" "\\\$\[0-9\]* = {x = -2, y = -3}" +gdb_test "print -one" "${::valnum_re} = {x = -2, y = -3}" -gdb_test "print one++" "\\\$\[0-9\]* = {x = 2, y = 4}" +gdb_test "print one++" "${::valnum_re} = {x = 2, y = 4}" -gdb_test "print ++one" "\\\$\[0-9\]* = {x = 3, y = 4}" +gdb_test "print ++one" "${::valnum_re} = {x = 3, y = 4}" -gdb_test "print one--" "\\\$\[0-9\]* = {x = 3, y = 3}" +gdb_test "print one--" "${::valnum_re} = {x = 3, y = 3}" -gdb_test "print --one" "\\\$\[0-9\]* = {x = 2, y = 3}" +gdb_test "print --one" "${::valnum_re} = {x = 2, y = 3}" -gdb_test "print one += 7" "\\\$\[0-9\]* = {x = 9, y = 10}" +gdb_test "print one += 7" "${::valnum_re} = {x = 9, y = 10}" -gdb_test "print two = one" "\\\$\[0-9\]* = {x = 9, y = 10}" +gdb_test "print two = one" "${::valnum_re} = {x = 9, y = 10}" # Check that GDB tolerates whitespace in operator names. gdb_test "break A2::operator+" ".*Breakpoint $decimal at.*" gdb_test "break A2::operator +" ".*Breakpoint $decimal at.*" # Check that GDB handles operator* correctly. -gdb_test "print c" "\\\$\[0-9\]* = {m = {z = .*}}" -gdb_test "print *c" "\\\$\[0-9\]* = \\(Member &\\) @$hex: {z = .*}" -gdb_test "print &*c" "\\\$\[0-9\]* = \\(Member \\*\\) $hex" +gdb_test "print c" "${::valnum_re} = {m = {z = .*}}" +gdb_test "print *c" "${::valnum_re} = \\(Member &\\) @$hex: {z = .*}" +gdb_test "print &*c" "${::valnum_re} = \\(Member \\*\\) $hex" gdb_test "ptype &*c" "type = (struct|class) Member {(\[\r\n \]+public:)?\[\r\n \]+int z;\[\r\n\].*} \\*" gdb_test "print operator== (mem1, mem2)" " = false" diff --git a/gdb/testsuite/gdb.opt/fortran-string.exp b/gdb/testsuite/gdb.opt/fortran-string.exp index 9025f090927..ac0e6f31802 100644 --- a/gdb/testsuite/gdb.opt/fortran-string.exp +++ b/gdb/testsuite/gdb.opt/fortran-string.exp @@ -34,4 +34,4 @@ if {![runto f]} { gdb_test_no_output "set print frame-arguments all" gdb_test "frame" ".*s='foo'.*" gdb_test "ptype s" "type = character\\*3" -gdb_test "p s" "\\$\[0-9\]* = 'foo'" +gdb_test "p s" "${::valnum_re} = 'foo'" diff --git a/gdb/testsuite/gdb.threads/continue-pending-status.exp b/gdb/testsuite/gdb.threads/continue-pending-status.exp index 843835d22f2..1ffa6fd3242 100644 --- a/gdb/testsuite/gdb.threads/continue-pending-status.exp +++ b/gdb/testsuite/gdb.threads/continue-pending-status.exp @@ -39,7 +39,7 @@ proc get_current_thread {} { set thread "" set msg "get thread number" gdb_test_multiple "print /x \$_thread" $msg { - -re "\\$\[0-9\]* = (0x\[0-9a-zA-Z\]+).*$gdb_prompt $" { + -re "${::valnum_re} = (0x\[0-9a-zA-Z\]+).*$gdb_prompt $" { set thread $expect_out(1,string) pass "$msg" } diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index f6bdfcdb60c..594cb115fe3 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -9418,7 +9418,7 @@ proc get_valueof { fmt exp default {test ""} } { set val ${default} gdb_test_multiple "print${fmt} ${exp}" "$test" { - -re -wrap "^\\$\[0-9\]* = (\[^\r\n\]*)" { + -re -wrap "^${::valnum_re} = (\[^\r\n\]*)" { set val $expect_out(1,string) pass "$test" } @@ -9467,7 +9467,7 @@ proc get_integer_valueof { exp default {test ""} } { set val ${default} gdb_test_multiple "print /d ${exp}" "$test" { - -re -wrap "^\\$\[0-9\]* = (\[-\]*\[0-9\]*).*" { + -re -wrap "^${::valnum_re} = (\[-\]*\[0-9\]*).*" { set val $expect_out(1,string) pass "$test" } @@ -9492,7 +9492,7 @@ proc get_hexadecimal_valueof { exp default {test ""} } { set val ${default} gdb_test_multiple "print /x ${exp}" $test { - -re "\\$\[0-9\]* = (0x\[0-9a-zA-Z\]+).*$gdb_prompt $" { + -re "${::valnum_re} = (0x\[0-9a-zA-Z\]+).*$gdb_prompt $" { set val $expect_out(1,string) pass "$test" } diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index 1dc389dea71..2e3a61d484b 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -2897,7 +2897,7 @@ proc mi_get_valueof { fmt exp default {test ""} } { set val ${default} gdb_test_multiple "print${fmt} ${exp}" "$test" -prompt "$::mi_gdb_prompt$" { - -re "~\"\\$\[0-9\]* = (\[^\r\n\]*)\\\\n\"\r\n\\^done\r\n$mi_gdb_prompt$" { + -re "~\"${::valnum_re} = (\[^\r\n\]*)\\\\n\"\r\n\\^done\r\n$mi_gdb_prompt$" { set val $expect_out(1,string) pass "$test" } -- 2.51.0