gdb/riscv: Improve support for matching against target descriptions
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.arch / e500-regs.exp
index 02c085c528e036d74afea338f8ca1fc04bb038e6..fa8e590e02738f698f06ca4fbc0de9bf1c372c33 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2003-2004, 2007-2012 Free Software Foundation, Inc.
+# Copyright 2003-2020 Free Software Foundation, Inc.
 # 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -32,7 +32,7 @@ set binfile ${objdir}/${subdir}/${testfile}
 set src1 ${srcdir}/${subdir}/${testfile}.c
 
 if  { [gdb_compile ${src1} ${binfile} executable {debug nowarnings}] != "" } {
-     untested e500-regs.exp
+     untested "failed to compile"
      return -1
 }
 
@@ -45,7 +45,8 @@ gdb_load ${binfile}
 #
 
 if ![runto_main] then {
-    gdb_suppress_tests
+    fail "can't run to main"
+    return 0
 }
 
 # set all the registers integer portions to 1
@@ -59,17 +60,7 @@ for {set i 0} {$i < 32} {incr i 1} {
 
 #gdb_test "next" "" ""
 
-send_gdb "show endian\n"
-gdb_expect {
-    -re "(The target endianness is set automatically .currently )(big|little)( endian.*)$gdb_prompt $" {
-        pass "endianness"
-       set endianness $expect_out(2,string)
-    }
-    -re ".*$gdb_prompt $" {
-       fail "couldn't get endianness"
-    }
-    timeout            { fail "(timeout) endianness" }
-}
+set endianness [get_endianness]
 
 # And then read the E500 registers back, to see that
 # a) the register write above worked, and
@@ -155,17 +146,18 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 if ![runto_main] then {
-    gdb_suppress_tests
+    fail "can't run to main"
+    return 0
 }
 
 gdb_test "break vector_fun" \
  "Breakpoint 2 at.*e500-regs.c, line \[0-9\]+\\." \
- "Set breakpoint at vector_fun"
+ "set breakpoint at vector_fun"
 
 # Actually it is nuch easier to see these results printed in hex.
 # gdb_test "set output-radix 16" \
 #   "Output radix now set to decimal 16, hex 10, octal 20." \
-#   "Set output radix to hex"
+#   "set output radix to hex"
 
 gdb_test "continue" \
   "Breakpoint 2, vector_fun .a=.-2, -2., b=.1, 1.*e500-regs.c.*ev_create_s32 .2, 2.;" \
This page took 0.026471 seconds and 4 git commands to generate.