This is the mail archive of the gdb-patches@sources.redhat.com 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]

[obish] Delete BELIEVE_PCC_PROMOTION_TYPE


FYI,

It's no longer defined. I'll give this a day or so before committing,

Andrew
2004-04-29  Andrew Cagney  <cagney@redhat.com>

	* gdbarch.sh (BELIEVE_PCC_PROMOTION_TYPE): Delete.
	* gdbarch.h, gdbarch.c: Re-generate.
	* stabsread.c (define_symbol): Delete BELIEVE_PCC_PROMOTION_TYPE
	code.

Index: doc/ChangeLog
2004-04-29  Andrew Cagney  <cagney@redhat.com>

	* gdbint.texinfo (Target Architecture Definition): Delete
	documentation for BELIEVE_PCC_PROMOTION_TYPE, no longer defined.

Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.307
diff -p -u -r1.307 gdbarch.sh
--- gdbarch.sh	2 Apr 2004 23:20:48 -0000	1.307
+++ gdbarch.sh	29 Apr 2004 23:31:40 -0000
@@ -564,7 +564,6 @@ F::DEPRECATED_PC_IN_CALL_DUMMY:int:depre
 F:2:DEPRECATED_INIT_FRAME_PC:CORE_ADDR:deprecated_init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev
 #
 v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion:::::::
-v::BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type:::::::
 F:2:DEPRECATED_GET_SAVED_REGISTER:void:deprecated_get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval
 #
 # For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
Index: stabsread.c
===================================================================
RCS file: /cvs/src/src/gdb/stabsread.c,v
retrieving revision 1.76
diff -p -u -r1.76 stabsread.c
--- stabsread.c	2 Mar 2004 20:31:56 -0000	1.76
+++ stabsread.c	29 Apr 2004 23:31:41 -0000
@@ -978,61 +978,17 @@ define_symbol (CORE_ADDR valu, char *str
 	      init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
 			 TYPE_FLAG_UNSIGNED, "unsigned int", NULL);
 
-	  if (BELIEVE_PCC_PROMOTION_TYPE)
+	  /* If PCC says a parameter is a short or a char, it is
+	     really an int.  */
+	  if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (pcc_promotion_type)
+	      && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT)
 	    {
-	      /* This is defined on machines (e.g. sparc) where we
-	         should believe the type of a PCC 'short' argument,
-	         but shouldn't believe the address (the address is the
-	         address of the corresponding int).
-
-	         My guess is that this correction, as opposed to
-	         changing the parameter to an 'int' (as done below,
-	         for PCC on most machines), is the right thing to do
-	         on all machines, but I don't want to risk breaking
-	         something that already works.  On most PCC machines,
-	         the sparc problem doesn't come up because the calling
-	         function has to zero the top bytes (not knowing
-	         whether the called function wants an int or a short),
-	         so there is little practical difference between an
-	         int and a short (except perhaps what happens when the
-	         GDB user types "print short_arg = 0x10000;").
-
-	         Hacked for SunOS 4.1 by gnu@cygnus.com.  In 4.1, the
-	         compiler actually produces the correct address (we
-	         don't need to fix it up).  I made this code adapt so
-	         that it will offset the symbol if it was pointing at
-	         an int-aligned location and not otherwise.  This way
-	         you can use the same gdb for 4.0.x and 4.1 systems.
-
-	         If the parameter is shorter than an int, and is
-	         integral (e.g. char, short, or unsigned equivalent),
-	         and is claimed to be passed on an integer boundary,
-	         don't believe it!  Offset the parameter's address to
-	         the tail-end of that integer.  */
-
-	      if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (pcc_promotion_type)
-		  && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT
-	      && 0 == SYMBOL_VALUE (sym) % TYPE_LENGTH (pcc_promotion_type))
-		{
-		  SYMBOL_VALUE (sym) += TYPE_LENGTH (pcc_promotion_type)
-		    - TYPE_LENGTH (SYMBOL_TYPE (sym));
-		}
-	      break;
-	    }
-	  else
-	    {
-	      /* If PCC says a parameter is a short or a char,
-	         it is really an int.  */
-	      if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (pcc_promotion_type)
-		  && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT)
-		{
-		  SYMBOL_TYPE (sym) =
-		    TYPE_UNSIGNED (SYMBOL_TYPE (sym))
-		    ? pcc_unsigned_promotion_type
-		    : pcc_promotion_type;
-		}
-	      break;
+	      SYMBOL_TYPE (sym) =
+		TYPE_UNSIGNED (SYMBOL_TYPE (sym))
+		? pcc_unsigned_promotion_type
+		: pcc_promotion_type;
 	    }
+	  break;
 	}
 
     case 'P':
Index: doc/gdbint.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v
retrieving revision 1.196
diff -p -u -r1.196 gdbint.texinfo
--- doc/gdbint.texinfo	4 Apr 2004 14:03:57 -0000	1.196
+++ doc/gdbint.texinfo	29 Apr 2004 23:31:42 -0000
@@ -2926,12 +2926,6 @@ Define if the compiler promotes a @code{
 parameter to an @code{int}, but still reports the parameter as its
 original type, rather than the promoted type.
 
-@item BELIEVE_PCC_PROMOTION_TYPE
-@findex BELIEVE_PCC_PROMOTION_TYPE
-Define this if @value{GDBN} should believe the type of a @code{short}
-argument when compiled by @code{pcc}, but look within a full int space to get
-its value.  Only defined for Sun-3 at present.
-
 @item BITS_BIG_ENDIAN
 @findex BITS_BIG_ENDIAN
 Define this if the numbering of bits in the targets does @strong{not} match the

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