diff mbox

[nios2] fix type of "fp" and other registers

Message ID 53322976.1040804@codesourcery.com
State Committed
Headers show

Commit Message

Sandra Loosemore March 26, 2014, 1:12 a.m. UTC
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

Comments

Yao Qi March 26, 2014, 1:49 a.m. UTC | #1
On 03/26/2014 09:12 AM, Sandra Loosemore wrote:
> OK for mainline?
> 
> 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.

It is OK.  Thanks.
diff mbox

Patch

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");