This is the mail archive of the gdb-testers@sourceware.cygnus.com mailing list for the GDB project. See the GDB home page for more information.


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

gcc/sdbout.c and char parameters



I need some help from someone who knows gcc/sdbout.c and gdb.

For the following testcase, gcc does not produce the right debugging info
on m68k-motorola-sysv (a COFF system using sdbout.c).  Basically, it says
the 'c' parameter is 'int' while it should say it is 'char', and change
the address accordingly.  The code in sdbout says it does that, but
actually it does not.  Below is an unfinished attempt to fix that, that works
for the testcase, but I do not have enough knowledge in that area to be
sure it this totally right; one thing that should be taken care off is that
we may not say 'float' for a 'float' promoted to 'double'.  Could someone look
at it and improve it ?  What I have done is replace DECL_RTL by
DECL_INCOMING_RTL at some places, but I think that that actually suppress the
usefullness of the test.

Thanks in advance

Philippe De Muyter

f(char c)
	{
	}

g(c)
char	c;
	{
	}

main()
	{
	f('a');
	g('b');
	}

--- ./sdbout.c	Tue Feb 10 07:00:45 1998
+++ ./sdbout.c	Tue Feb 10 07:00:12 1998
@@ -1298,8 +1301,10 @@ sdbout_parms (parms)
 
 	if (PARM_PASSED_IN_MEMORY (parms))
 	  {
-	    rtx addr = XEXP (DECL_INCOMING_RTL (parms), 0);
+	    rtx decl_incoming_rtl = DECL_INCOMING_RTL (parms);
+	    rtx addr = XEXP (decl_incoming_rtl, 0);
 	    tree type;
+	    rtx decl_rtl = DECL_RTL (parms);
 
 	    /* ??? Here we assume that the parm address is indexed
 	       off the frame pointer or arg pointer.
@@ -1311,9 +1316,9 @@ sdbout_parms (parms)
 	    else
 	      current_sym_value = 0;
 
-	    if (GET_CODE (DECL_RTL (parms)) == REG
-		&& REGNO (DECL_RTL (parms)) >= 0
-		&& REGNO (DECL_RTL (parms)) < FIRST_PSEUDO_REGISTER)
+	    if (GET_CODE (decl_rtl) == REG
+		&& REGNO (decl_rtl) >= 0
+		&& REGNO (decl_rtl) < FIRST_PSEUDO_REGISTER)
 	      type = DECL_ARG_TYPE (parms);
 	    else
 	      {
@@ -1329,14 +1334,14 @@ sdbout_parms (parms)
 		    && TREE_TYPE (parms) != DECL_ARG_TYPE (parms))
 		  current_sym_value +=
 		    (GET_MODE_SIZE (TYPE_MODE (DECL_ARG_TYPE (parms)))
-		     - GET_MODE_SIZE (GET_MODE (DECL_RTL (parms))));
+		     - GET_MODE_SIZE (GET_MODE (decl_rtl)));
 
-		if (GET_CODE (DECL_RTL (parms)) == MEM
-		    && GET_CODE (XEXP (DECL_RTL (parms), 0)) == PLUS
-		    && (GET_CODE (XEXP (XEXP (DECL_RTL (parms), 0), 1))
+		if (GET_CODE (decl_incoming_rtl) == MEM
+		    && GET_CODE (XEXP (decl_incoming_rtl, 0)) == PLUS
+		    && (GET_CODE (XEXP (XEXP (decl_incoming_rtl, 0), 1))
 			== CONST_INT)
-		    && (INTVAL (XEXP (XEXP (DECL_RTL (parms), 0), 1))
-			== current_sym_value))
+		    && (INTVAL (XEXP (XEXP (decl_incoming_rtl, 0), 1))
+			== original_sym_value))
 		  type = TREE_TYPE (parms);
 		else
 		  {