Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* mips-tdep.c: Sign-extend pointers for n32
@ 2007-10-25 14:43 Maciej W. Rozycki
  2007-12-16 18:49 ` Daniel Jacobowitz
  0 siblings, 1 reply; 15+ messages in thread
From: Maciej W. Rozycki @ 2007-10-25 14:43 UTC (permalink / raw)
  To: gdb-patches; +Cc: David Ung, Maciej W. Rozycki

Hello,

 The change below fixes a few regressions in the GDB test suite for 
MIPS/n32 like the one below:

print (diamond.*left_base_vpmf) ()
UNPREDICTABLE: PC = 0x80020580
Quit
(gdb) FAIL: gdb.cp/member-ptr.exp: print (diamond.*left_base_vpmf) ()

 Tested for n32 using the mipsisa32-sde-elf target, with the 
mips-sim-sde64/-mips64/-EB and mips-sim-sde64/-mips64/-EL boards, fixing 6 
regressions (of 78) for the former and 3 regressions (of 74) for the 
latter.

2007-10-25  David Ung  <davidu@mips.com>

	* mips-tdep.c (mips_n32n64_push_dummy_call): Sign-extend the
	pointer value if the length of the variable is less than the
	width of the register size of the ABI.

 OK to apply?

  Maciej

12741-0.diff
Index: binutils-quilt/src/gdb/mips-tdep.c
===================================================================
--- binutils-quilt.orig/src/gdb/mips-tdep.c	2007-09-21 17:19:38.000000000 +0100
+++ binutils-quilt/src/gdb/mips-tdep.c	2007-09-21 17:19:38.000000000 +0100
@@ -3032,6 +3032,10 @@
 			  || typecode == TYPE_CODE_UNION))
 		    regval <<= ((MIPS64_REGSIZE - partial_len)
 				* TARGET_CHAR_BIT);
+		  /* Sign extend the value if it is an address.  */
+		  else if (partial_len < MIPS64_REGSIZE
+			   && typecode == TYPE_CODE_PTR)
+		    regval = extract_signed_integer (val, partial_len);
 
 		  if (mips_debug)
 		    fprintf_filtered (gdb_stdlog, " - reg=%d val=%s",


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2007-12-22  5:22 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-25 14:43 mips-tdep.c: Sign-extend pointers for n32 Maciej W. Rozycki
2007-12-16 18:49 ` Daniel Jacobowitz
2007-12-19 15:27   ` Maciej W. Rozycki
2007-12-19 15:28     ` Daniel Jacobowitz
2007-12-19 16:16       ` Maciej W. Rozycki
2007-12-19 17:08         ` Daniel Jacobowitz
2007-12-20 16:41           ` Maciej W. Rozycki
2007-12-20 17:07             ` Daniel Jacobowitz
2007-12-20 17:18               ` Maciej W. Rozycki
2007-12-20 19:37                 ` Daniel Jacobowitz
2007-12-21  4:36                 ` Joel Brobecker
2007-12-21 11:34                   ` Maciej W. Rozycki
2007-12-21 11:51                     ` Joel Brobecker
2007-12-21 12:02                       ` Maciej W. Rozycki
2007-12-22  5:30                         ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox