summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/examine-backward.exp
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2020-09-17 23:33:40 +0100
committerPedro Alves <pedro@palves.net>2020-09-18 00:04:47 +0100
commit11fac33796f43a177c1836bf8fb1f7cc60e3875e (patch)
treeda989c8ffb85e2f0cf2a3506747e25e54285252e /gdb/testsuite/gdb.base/examine-backward.exp
parent52626c58267233b0e6a9807a80945467a019013b (diff)
downloadbinutils-gdb-11fac33796f43a177c1836bf8fb1f7cc60e3875e.tar.gz
gdb.base/examine-backward.exp C++ify and Clang
Adjust gdb.base/examine-backward.exp to let the testcase build and run as a C++ program, built with either G++ or Clang++. The change to use unsigned char instead of plain char is to avoid narrowing warnings: gdb compile failed, src/gdb/testsuite/gdb.base/examine-backward.c:55:1: error: narrowing conversion of '227' from 'int' to 'char' [-Wnarrowing] 55 | }; | ^ gdb/testsuite/ChangeLog: * gdb.base/examine-backward.c (Barrier, TestStrings): Now unsigned char array. (main): Add references to Barrier, TestStrings, TestStringsH and TestStringsW. * gdb.base/examine-backward.exp: Issue "set print asm-demangle on" and expect a full prototype in C++.
Diffstat (limited to 'gdb/testsuite/gdb.base/examine-backward.exp')
-rw-r--r--gdb/testsuite/gdb.base/examine-backward.exp7
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.base/examine-backward.exp b/gdb/testsuite/gdb.base/examine-backward.exp
index c1ab4d1ce8d..b2d9fc1e1b2 100644
--- a/gdb/testsuite/gdb.base/examine-backward.exp
+++ b/gdb/testsuite/gdb.base/examine-backward.exp
@@ -345,9 +345,12 @@ with_test_prefix "backward disassemble general" {
set length_to_examine {1 2 3 4 10}
set disassmbly {}
- gdb_test "x/i main" "0x\[0-9a-fA-F\]+ <main>:\t.*" \
+ gdb_test_no_output "set print asm-demangle on"
+ set main_re "main(\\(\\))?"
+
+ gdb_test "x/i main" "0x\[0-9a-fA-F\]+ <$main_re>:\t.*" \
"move the current position to main (x/i)"
- gdb_test "x/-i" "0x\[0-9a-fA-F\]+ <main>:\t.*" \
+ gdb_test "x/-i" "0x\[0-9a-fA-F\]+ <$main_re>:\t.*" \
"move the current position to main (x/-i)"
for {set i 0} {$i < [llength $length_to_examine]} {incr i} {
set len [lindex $length_to_examine $i]