From: Sandra Loosemore <sandra@codesourcery.com>
To: <gdb-patches@sourceware.org>, Yao Qi <yao@codesourcery.com>
Subject: [patch, nios2] fix type of "fp" and other registers
Date: Wed, 26 Mar 2014 01:12:00 -0000 [thread overview]
Message-ID: <53322976.1040804@codesourcery.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 451 bytes --]
I noticed that the test "gdb.base/pc-fp.exp: info register pc fp" was
failing on Nios II targets because fp prints in decimal format while the
test is expecting hex. The attached patch fixes that by
giving register "fp" type "data_ptr" rather than "uint32". While I was
at it, I've made similar corrections to "gp", "ea", and "ra"
(respectively, the global pointer, exception address, and return address
registers).
OK for mainline?
-Sandra
[-- Attachment #2: gdb.log --]
[-- Type: text/x-log, Size: 220 bytes --]
2014-03-25 Sandra Loosemore <sandra@codesourcery.com>
gdb/
* features/nios2-cpu.xml: Correct types of "gp", "fp", "ea", and
"ra" registers.
* features/nios2-linux.c: Regenerated.
* features/nios2.c: Regenerated.
[-- Attachment #3: gdb.patch --]
[-- Type: text/x-patch, Size: 3478 bytes --]
diff --git a/gdb/features/nios2-cpu.xml b/gdb/features/nios2-cpu.xml
index 7f0d449..8fb5246 100644
--- a/gdb/features/nios2-cpu.xml
+++ b/gdb/features/nios2-cpu.xml
@@ -33,12 +33,12 @@
<reg name="r23" bitsize="32" type="uint32"/>
<reg name="et" bitsize="32" type="uint32"/>
<reg name="bt" bitsize="32" type="uint32"/>
- <reg name="gp" bitsize="32" type="uint32"/>
+ <reg name="gp" bitsize="32" type="data_ptr"/>
<reg name="sp" bitsize="32" type="data_ptr"/>
- <reg name="fp" bitsize="32" type="uint32"/>
- <reg name="ea" bitsize="32" type="uint32"/>
+ <reg name="fp" bitsize="32" type="data_ptr"/>
+ <reg name="ea" bitsize="32" type="code_ptr"/>
<reg name="sstatus" bitsize="32" type="uint32"/>
- <reg name="ra" bitsize="32" type="uint32"/>
+ <reg name="ra" bitsize="32" type="code_ptr"/>
<reg name="pc" bitsize="32" type="code_ptr"/>
<reg name="status" bitsize="32" type="uint32"/>
<reg name="estatus" bitsize="32" type="uint32"/>
diff --git a/gdb/features/nios2-linux.c b/gdb/features/nios2-linux.c
index ea61cf8..3288f79 100644
--- a/gdb/features/nios2-linux.c
+++ b/gdb/features/nios2-linux.c
@@ -43,12 +43,12 @@ initialize_tdesc_nios2_linux (void)
tdesc_create_reg (feature, "r23", 23, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "et", 24, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "bt", 25, 1, NULL, 32, "uint32");
- tdesc_create_reg (feature, "gp", 26, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "gp", 26, 1, NULL, 32, "data_ptr");
tdesc_create_reg (feature, "sp", 27, 1, NULL, 32, "data_ptr");
- tdesc_create_reg (feature, "fp", 28, 1, NULL, 32, "uint32");
- tdesc_create_reg (feature, "ea", 29, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "fp", 28, 1, NULL, 32, "data_ptr");
+ tdesc_create_reg (feature, "ea", 29, 1, NULL, 32, "code_ptr");
tdesc_create_reg (feature, "sstatus", 30, 1, NULL, 32, "uint32");
- tdesc_create_reg (feature, "ra", 31, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "ra", 31, 1, NULL, 32, "code_ptr");
tdesc_create_reg (feature, "pc", 32, 1, NULL, 32, "code_ptr");
tdesc_create_reg (feature, "status", 33, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "estatus", 34, 1, NULL, 32, "uint32");
diff --git a/gdb/features/nios2.c b/gdb/features/nios2.c
index 8e0049d..0cedc12 100644
--- a/gdb/features/nios2.c
+++ b/gdb/features/nios2.c
@@ -41,12 +41,12 @@ initialize_tdesc_nios2 (void)
tdesc_create_reg (feature, "r23", 23, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "et", 24, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "bt", 25, 1, NULL, 32, "uint32");
- tdesc_create_reg (feature, "gp", 26, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "gp", 26, 1, NULL, 32, "data_ptr");
tdesc_create_reg (feature, "sp", 27, 1, NULL, 32, "data_ptr");
- tdesc_create_reg (feature, "fp", 28, 1, NULL, 32, "uint32");
- tdesc_create_reg (feature, "ea", 29, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "fp", 28, 1, NULL, 32, "data_ptr");
+ tdesc_create_reg (feature, "ea", 29, 1, NULL, 32, "code_ptr");
tdesc_create_reg (feature, "sstatus", 30, 1, NULL, 32, "uint32");
- tdesc_create_reg (feature, "ra", 31, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "ra", 31, 1, NULL, 32, "code_ptr");
tdesc_create_reg (feature, "pc", 32, 1, NULL, 32, "code_ptr");
tdesc_create_reg (feature, "status", 33, 1, NULL, 32, "uint32");
tdesc_create_reg (feature, "estatus", 34, 1, NULL, 32, "uint32");
next reply other threads:[~2014-03-26 1:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-26 1:12 Sandra Loosemore [this message]
2014-03-26 1:52 ` Yao Qi
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=53322976.1040804@codesourcery.com \
--to=sandra@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=yao@codesourcery.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