From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Cc: jimw@sifive.com, palmer@sifive.com, jhb@FreeBSD.org,
Andrew Burgess <andrew.burgess@embecosm.com>
Subject: [PATCH 2/2] gdb/riscv: Update test to support targets without FP hardware
Date: Mon, 05 Nov 2018 23:10:00 -0000 [thread overview]
Message-ID: <14c76a92c6491376e3a3829a2316ca8311a50b28.1541459121.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <cover.1541459121.git.andrew.burgess@embecosm.com>
In-Reply-To: <cover.1541459121.git.andrew.burgess@embecosm.com>
Update gdb.arch/riscv-reg-aliases.exp test to support targets without
floating point registers.
gdb/testsuite/ChangeLog:
* gdb.arch/riscv-reg-aliases.exp: Handle targets without floating
point hardware.
---
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/gdb.arch/riscv-reg-aliases.exp | 24 ++++++++++++++++++------
2 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/gdb/testsuite/gdb.arch/riscv-reg-aliases.exp b/gdb/testsuite/gdb.arch/riscv-reg-aliases.exp
index b4a2c982897..746ba7dda5d 100644
--- a/gdb/testsuite/gdb.arch/riscv-reg-aliases.exp
+++ b/gdb/testsuite/gdb.arch/riscv-reg-aliases.exp
@@ -151,17 +151,23 @@ check_zero_register_value "after write to \$x0"
# we should access the register using 'REG_NAME.float'. In the following we
# figure out if the field name is needed or not by looking at how GDB prints
# on register.
+set skip_freg_tests 0
set freg_extension "INVALID"
set message "check format of float registers"
-gdb_test_multiple "p \$ft0" $message {
- -re " = {float = \[^\r\n\]+}\r\n$gdb_prompt $" {
- set freg_extension ".float"
+gdb_test_multiple "info registers \$ft0" $message {
+ -re "Invalid register `ft0'\r\n$gdb_prompt $" {
+ set skip_freg_tests 1
+ set freg_extension "NONE"
pass $message
}
- -re " = \[^{}\r\n\]+\r\n$gdb_prompt $" {
+ -re "ft0 \+\[0-9\]\+.*\r\n$gdb_prompt $" {
set freg_extension ""
pass $message
}
+ -re "ft0 \+\{float = .*\r\n$gdb_prompt $" {
+ set freg_extension ".float"
+ pass $message
+ }
}
gdb_assert ![string eq "${freg_extension}" "INVALID"] \
"check that floating point format has been understood"
@@ -169,7 +175,10 @@ gdb_assert ![string eq "${freg_extension}" "INVALID"] \
# Now check that we can write zero, and read zero back to all of the integer
# and floating point registers.
check_setting_registers_to_zero ${xreg_names} ""
-check_setting_registers_to_zero ${freg_names} ${freg_extension}
+
+if { ! $skip_freg_tests } {
+ check_setting_registers_to_zero ${freg_names} ${freg_extension}
+}
# Set each register in turn to a new value, and confirm that the new value can
# be read back from the primary name, and from all of the alias names. The
@@ -177,4 +186,7 @@ check_setting_registers_to_zero ${freg_names} ${freg_extension}
# significantly different so that the float tests don't reuse value from the
# integer tests.
check_setting_registers_to_value ${xreg_names} "" 100
-check_setting_registers_to_value ${freg_names} ${freg_extension} 500
+
+if { ! $skip_freg_tests } {
+ check_setting_registers_to_value ${freg_names} ${freg_extension} 500
+}
--
2.14.5
next prev parent reply other threads:[~2018-11-05 23:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-05 23:10 [PATCH 0/2] RISC-V Prologue Scan And Test Improvement Andrew Burgess
2018-11-05 23:10 ` Andrew Burgess [this message]
2018-11-05 23:10 ` [PATCH 1/2] gdb/riscv: Stop prologue scan if instruction fetch/decode fails Andrew Burgess
2018-11-05 23:37 ` Jim Wilson
2018-11-06 11:18 ` Andrew Burgess
2018-11-06 19:40 ` Jim Wilson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=14c76a92c6491376e3a3829a2316ca8311a50b28.1541459121.git.andrew.burgess@embecosm.com \
--to=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
--cc=jhb@FreeBSD.org \
--cc=jimw@sifive.com \
--cc=palmer@sifive.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox