[gnu.gdb.bug] Sun4 GDB bug

mdt@CIS.OHIO-STATE.EDU (Michael Tiemann) (11/28/88)

This code in printcmd.c assumes that LOC_REGPARM implies
an integer or floating type.  In fact, any kind of type
can occur for a LOC_REGPARM.  GDB crashes if a parameter
has some other kind of type.

      /* Print the next arg.  */
      if (SYMBOL_CLASS (sym) == LOC_REGPARM)
	{
	  unsigned char raw_buffer[MAX_REGISTER_RAW_SIZE];
	  unsigned char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE];

	  read_relative_register_raw_bytes (SYMBOL_VALUE (sym), raw_buffer);
	  if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT)
	    val = value_from_long (SYMBOL_TYPE (sym), *(int *)raw_buffer);
	  else if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FLT)
	    val = value_from_double (SYMBOL_TYPE (sym), *(double *)raw_buffer);
	}