This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit, arm] Fix incorrect "fpscr" register number


Hello,

since Pedro's unavailable-register patches went in, I'm seeing this on ARM:
FAIL: gdb.base/callfuncs.exp: gdb function calls preserve register contents

However, it turns out that the patch just exposed a pre-existing bug in
the ARM back-end: if the "fpscr" register is defined by a target description,
it is not forced to its fixed register number ARM_FPSCR_REGNUM.

Since the Linux native target supplies the value to that fixed number,
the register -using its arbitrarily assigned number- will now show
up as unavailable.

Fixed by using tdesc_numbered_register for fpscr as well.

Tested on armv7l-unknown-linux-gnueabi, committed to mainline.

Bye,
Ulrich


ChangeLog:

	* arm-tdep.c (arm_gdbarch_init): Enfore correct register number
	for "fpscr" in target description.

Index: gdb/arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.340
diff -u -p -r1.340 arm-tdep.c
--- gdb/arm-tdep.c	1 Apr 2011 11:57:02 -0000	1.340
+++ gdb/arm-tdep.c	1 Apr 2011 18:41:32 -0000
@@ -8387,8 +8387,13 @@ arm_gdbarch_init (struct gdbarch_info in
 	      if (!valid_p)
 		break;
 	    }
+	  if (!valid_p && i == 16)
+	    valid_p = 1;
 
-	  if (!valid_p && i != 16)
+	  /* Also require FPSCR.  */
+	  valid_p &= tdesc_numbered_register (feature, tdesc_data,
+					      ARM_FPSCR_REGNUM, "fpscr");
+	  if (!valid_p)
 	    {
 	      tdesc_data_cleanup (tdesc_data);
 	      return NULL;
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]