Jan Kratochvil 92b52c5
http://sourceware.org/ml/gdb-cvs/2012-09/msg00142.html
Jan Kratochvil 92b52c5
Jan Kratochvil 92b52c5
### src/gdb/ChangeLog	2012/09/25 12:38:55	1.14696
Jan Kratochvil 92b52c5
### src/gdb/ChangeLog	2012/09/25 12:48:52	1.14697
Jan Kratochvil 92b52c5
## -1,3 +1,36 @@
Jan Kratochvil 92b52c5
+2012-09-25  Siddhesh Poyarekar  <siddhesh@redhat.com>
Jan Kratochvil 92b52c5
+
Jan Kratochvil 92b52c5
+	* ada-valprint.c (ada_val_print_1): Eliminate single-use
Jan Kratochvil 92b52c5
+	variable LEN.
Jan Kratochvil 92b52c5
+	* alpha-tdep.c (alpha_extract_return_value): Use TYPE_LENGTH
Jan Kratochvil 92b52c5
+	directly.
Jan Kratochvil 92b52c5
+	(alpha_store_return_value): Likewise.
Jan Kratochvil 92b52c5
+	* amd64-tdep.c (amd64_classify_aggregate): Likewise.
Jan Kratochvil 92b52c5
+	(amd64_push_arguments): Likewise.
Jan Kratochvil 92b52c5
+	* ax-gdb.c (gen_trace_static_fields): Likewise.
Jan Kratochvil 92b52c5
+	(gen_traced_pop): Likewise.
Jan Kratochvil 92b52c5
+	* bfin-tdep.c (bfin_push_dummy_call): Likewise.
Jan Kratochvil 92b52c5
+	* breakpoint.c (update_watchpoint): Likewise.
Jan Kratochvil 92b52c5
+	* findcmd.c (parse_find_args): Use local variable for type
Jan Kratochvil 92b52c5
+	instead of length.
Jan Kratochvil 92b52c5
+	* findvar.c (default_read_var_value): Use TYPE_LENGTH directly.
Jan Kratochvil 92b52c5
+	* h8300-tdep.c (h8300h_extract_return_value): Likewise.
Jan Kratochvil 92b52c5
+	(h8300_store_return_value): Likewise.
Jan Kratochvil 92b52c5
+	* i386-darwin-tdep.c (i386_darwin_push_dummy_call): Likewise.
Jan Kratochvil 92b52c5
+	Use i386_darwin_arg_type_alignment directly.
Jan Kratochvil 92b52c5
+	* infcall.c (call_function_by_hand): Use TYPE_LENGTH directly.
Jan Kratochvil 92b52c5
+	* lm32-tdep.c (lm32_push_dummy_call): Likewise.
Jan Kratochvil 92b52c5
+	* m68hc11-tdep.c (m68hc11_push_dummy_call): Likewise.
Jan Kratochvil 92b52c5
+	(m68hc11_extract_return_value): Likewise.
Jan Kratochvil 92b52c5
+	* mep-tdep.c (mep_push_dummy_call): Likewise.
Jan Kratochvil 92b52c5
+	* printcmd.c (float_type_from_length): Likewise.
Jan Kratochvil 92b52c5
+	* s390-tdep.c (s390_value_from_register): Likewise.
Jan Kratochvil 92b52c5
+	* stack.c (read_frame_arg): Likewise.
Jan Kratochvil 92b52c5
+	* tracepoint.c (encode_actions_1): Likewise.
Jan Kratochvil 92b52c5
+	* valops.c (value_fetch_lazy): Use local variable for type
Jan Kratochvil 92b52c5
+	instead of length.  Use TYPE_LENGTH directly.
Jan Kratochvil 92b52c5
+	* value.c (value_contents_equal): Use TYPE_LENGTH directly.
Jan Kratochvil 92b52c5
+
Jan Kratochvil 92b52c5
 2012-09-25  Joel Brobecker  <brobecker@adacore.com>
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
 	* symtab.c (skip_prologue_sal): Fix typo in comment.
Jan Kratochvil 92b52c5
Index: gdb-7.5.0.20120926/gdb/ada-valprint.c
Jan Kratochvil 92b52c5
===================================================================
Jan Kratochvil 92b52c5
--- gdb-7.5.0.20120926.orig/gdb/ada-valprint.c	2012-04-18 08:46:46.000000000 +0200
Jan Kratochvil 92b52c5
+++ gdb-7.5.0.20120926/gdb/ada-valprint.c	2012-11-07 22:03:57.600623522 +0100
Jan Kratochvil 92b52c5
@@ -730,9 +730,8 @@ ada_val_print_1 (struct type *type, cons
Jan Kratochvil 92b52c5
       if (ada_is_fixed_point_type (type))
Jan Kratochvil 92b52c5
 	{
Jan Kratochvil 92b52c5
 	  LONGEST v = unpack_long (type, valaddr + offset_aligned);
Jan Kratochvil 92b52c5
-	  int len = TYPE_LENGTH (type);
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
-	  fprintf_filtered (stream, len < 4 ? "%.11g" : "%.17g",
Jan Kratochvil 92b52c5
+	  fprintf_filtered (stream, TYPE_LENGTH (type) < 4 ? "%.11g" : "%.17g",
Jan Kratochvil 92b52c5
 			    (double) ada_fixed_to_float (type, v));
Jan Kratochvil 92b52c5
 	  return;
Jan Kratochvil 92b52c5
 	}
Jan Kratochvil 92b52c5
Index: gdb-7.5.0.20120926/gdb/alpha-tdep.c
Jan Kratochvil 92b52c5
===================================================================
Jan Kratochvil 92b52c5
--- gdb-7.5.0.20120926.orig/gdb/alpha-tdep.c	2012-05-16 16:35:02.000000000 +0200
Jan Kratochvil 92b52c5
+++ gdb-7.5.0.20120926/gdb/alpha-tdep.c	2012-11-07 22:03:57.602623520 +0100
Jan Kratochvil 92b52c5
@@ -475,14 +475,13 @@ alpha_extract_return_value (struct type
Jan Kratochvil 92b52c5
 {
Jan Kratochvil 92b52c5
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
Jan Kratochvil 92b52c5
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
Jan Kratochvil 92b52c5
-  int length = TYPE_LENGTH (valtype);
Jan Kratochvil 92b52c5
   gdb_byte raw_buffer[ALPHA_REGISTER_SIZE];
Jan Kratochvil 92b52c5
   ULONGEST l;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
   switch (TYPE_CODE (valtype))
Jan Kratochvil 92b52c5
     {
Jan Kratochvil 92b52c5
     case TYPE_CODE_FLT:
Jan Kratochvil 92b52c5
-      switch (length)
Jan Kratochvil 92b52c5
+      switch (TYPE_LENGTH (valtype))
Jan Kratochvil 92b52c5
 	{
Jan Kratochvil 92b52c5
 	case 4:
Jan Kratochvil 92b52c5
 	  regcache_cooked_read (regcache, ALPHA_FP0_REGNUM, raw_buffer);
Jan Kratochvil 92b52c5
@@ -505,7 +504,7 @@ alpha_extract_return_value (struct type
Jan Kratochvil 92b52c5
       break;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
     case TYPE_CODE_COMPLEX:
Jan Kratochvil 92b52c5
-      switch (length)
Jan Kratochvil 92b52c5
+      switch (TYPE_LENGTH (valtype))
Jan Kratochvil 92b52c5
 	{
Jan Kratochvil 92b52c5
 	case 8:
Jan Kratochvil 92b52c5
 	  /* ??? This isn't correct wrt the ABI, but it's what GCC does.  */
Jan Kratochvil 92b52c5
@@ -531,7 +530,7 @@ alpha_extract_return_value (struct type
Jan Kratochvil 92b52c5
     default:
Jan Kratochvil 92b52c5
       /* Assume everything else degenerates to an integer.  */
Jan Kratochvil 92b52c5
       regcache_cooked_read_unsigned (regcache, ALPHA_V0_REGNUM, &l);
Jan Kratochvil 92b52c5
-      store_unsigned_integer (valbuf, length, byte_order, l);
Jan Kratochvil 92b52c5
+      store_unsigned_integer (valbuf, TYPE_LENGTH (valtype), byte_order, l);
Jan Kratochvil 92b52c5
       break;
Jan Kratochvil 92b52c5
     }
Jan Kratochvil 92b52c5
 }
Jan Kratochvil 92b52c5
@@ -544,14 +543,13 @@ alpha_store_return_value (struct type *v
Jan Kratochvil 92b52c5
 			  const gdb_byte *valbuf)
Jan Kratochvil 92b52c5
 {
Jan Kratochvil 92b52c5
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
Jan Kratochvil 92b52c5
-  int length = TYPE_LENGTH (valtype);
Jan Kratochvil 92b52c5
   gdb_byte raw_buffer[ALPHA_REGISTER_SIZE];
Jan Kratochvil 92b52c5
   ULONGEST l;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
   switch (TYPE_CODE (valtype))
Jan Kratochvil 92b52c5
     {
Jan Kratochvil 92b52c5
     case TYPE_CODE_FLT:
Jan Kratochvil 92b52c5
-      switch (length)
Jan Kratochvil 92b52c5
+      switch (TYPE_LENGTH (valtype))
Jan Kratochvil 92b52c5
 	{
Jan Kratochvil 92b52c5
 	case 4:
Jan Kratochvil 92b52c5
 	  alpha_lds (gdbarch, raw_buffer, valbuf);
Jan Kratochvil 92b52c5
@@ -575,7 +573,7 @@ alpha_store_return_value (struct type *v
Jan Kratochvil 92b52c5
       break;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
     case TYPE_CODE_COMPLEX:
Jan Kratochvil 92b52c5
-      switch (length)
Jan Kratochvil 92b52c5
+      switch (TYPE_LENGTH (valtype))
Jan Kratochvil 92b52c5
 	{
Jan Kratochvil 92b52c5
 	case 8:
Jan Kratochvil 92b52c5
 	  /* ??? This isn't correct wrt the ABI, but it's what GCC does.  */
Jan Kratochvil 92b52c5
@@ -603,7 +601,7 @@ alpha_store_return_value (struct type *v
Jan Kratochvil 92b52c5
       /* Assume everything else degenerates to an integer.  */
Jan Kratochvil 92b52c5
       /* 32-bit values must be sign-extended to 64 bits
Jan Kratochvil 92b52c5
 	 even if the base data type is unsigned.  */
Jan Kratochvil 92b52c5
-      if (length == 4)
Jan Kratochvil 92b52c5
+      if (TYPE_LENGTH (valtype) == 4)
Jan Kratochvil 92b52c5
 	valtype = builtin_type (gdbarch)->builtin_int32;
Jan Kratochvil 92b52c5
       l = unpack_long (valtype, valbuf);
Jan Kratochvil 92b52c5
       regcache_cooked_write_unsigned (regcache, ALPHA_V0_REGNUM, l);
Jan Kratochvil 92b52c5
Index: gdb-7.5.0.20120926/gdb/amd64-tdep.c
Jan Kratochvil 92b52c5
===================================================================
Jan Kratochvil 92b52c5
--- gdb-7.5.0.20120926.orig/gdb/amd64-tdep.c	2012-11-07 22:00:42.000000000 +0100
Jan Kratochvil 92b52c5
+++ gdb-7.5.0.20120926/gdb/amd64-tdep.c	2012-11-07 22:03:57.623623489 +0100
Jan Kratochvil 92b52c5
@@ -446,12 +446,10 @@ amd64_non_pod_p (struct type *type)
Jan Kratochvil 92b52c5
 static void
Jan Kratochvil 92b52c5
 amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2])
Jan Kratochvil 92b52c5
 {
Jan Kratochvil 92b52c5
-  int len = TYPE_LENGTH (type);
Jan Kratochvil 92b52c5
-
Jan Kratochvil 92b52c5
   /* 1. If the size of an object is larger than two eightbytes, or in
Jan Kratochvil 92b52c5
         C++, is a non-POD structure or union type, or contains
Jan Kratochvil 92b52c5
         unaligned fields, it has class memory.  */
Jan Kratochvil 92b52c5
-  if (len > 16 || amd64_non_pod_p (type))
Jan Kratochvil 92b52c5
+  if (TYPE_LENGTH (type) > 16 || amd64_non_pod_p (type))
Jan Kratochvil 92b52c5
     {
Jan Kratochvil 92b52c5
       class[0] = class[1] = AMD64_MEMORY;
Jan Kratochvil 92b52c5
       return;
Jan Kratochvil 92b52c5
@@ -471,7 +469,7 @@ amd64_classify_aggregate (struct type *t
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
       /* All fields in an array have the same type.  */
Jan Kratochvil 92b52c5
       amd64_classify (subtype, class);
Jan Kratochvil 92b52c5
-      if (len > 8 && class[1] == AMD64_NO_CLASS)
Jan Kratochvil 92b52c5
+      if (TYPE_LENGTH (type) > 8 && class[1] == AMD64_NO_CLASS)
Jan Kratochvil 92b52c5
 	class[1] = class[0];
Jan Kratochvil 92b52c5
     }
Jan Kratochvil 92b52c5
   else
Jan Kratochvil 92b52c5
@@ -839,10 +837,9 @@ amd64_push_arguments (struct regcache *r
Jan Kratochvil 92b52c5
     {
Jan Kratochvil 92b52c5
       struct type *type = value_type (stack_args[i]);
Jan Kratochvil 92b52c5
       const gdb_byte *valbuf = value_contents (stack_args[i]);
Jan Kratochvil 92b52c5
-      int len = TYPE_LENGTH (type);
Jan Kratochvil 92b52c5
       CORE_ADDR arg_addr = sp + element * 8;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
-      write_memory (arg_addr, valbuf, len);
Jan Kratochvil 92b52c5
+      write_memory (arg_addr, valbuf, TYPE_LENGTH (type));
Jan Kratochvil 92b52c5
       if (arg_addr_regno[i] >= 0)
Jan Kratochvil 92b52c5
         {
Jan Kratochvil 92b52c5
           /* We also need to store the address of that argument in
Jan Kratochvil 92b52c5
@@ -853,7 +850,7 @@ amd64_push_arguments (struct regcache *r
Jan Kratochvil 92b52c5
           store_unsigned_integer (buf, 8, byte_order, arg_addr);
Jan Kratochvil 92b52c5
           regcache_cooked_write (regcache, arg_addr_regno[i], buf);
Jan Kratochvil 92b52c5
         }
Jan Kratochvil 92b52c5
-      element += ((len + 7) / 8);
Jan Kratochvil 92b52c5
+      element += ((TYPE_LENGTH (type) + 7) / 8);
Jan Kratochvil 92b52c5
     }
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
   /* The psABI says that "For calls that may call functions that use
Jan Kratochvil 92b52c5
Index: gdb-7.5.0.20120926/gdb/ax-gdb.c
Jan Kratochvil 92b52c5
===================================================================
Jan Kratochvil 92b52c5
--- gdb-7.5.0.20120926.orig/gdb/ax-gdb.c	2012-07-05 03:03:01.000000000 +0200
Jan Kratochvil 92b52c5
+++ gdb-7.5.0.20120926/gdb/ax-gdb.c	2012-11-07 22:03:57.626623484 +0100
Jan Kratochvil 92b52c5
@@ -367,9 +367,9 @@ gen_trace_static_fields (struct gdbarch
Jan Kratochvil 92b52c5
 	    {
Jan Kratochvil 92b52c5
 	    case axs_lvalue_memory:
Jan Kratochvil 92b52c5
 	      {
Jan Kratochvil 92b52c5
-		int length = TYPE_LENGTH (check_typedef (value.type));
Jan Kratochvil 92b52c5
-
Jan Kratochvil 92b52c5
-		ax_const_l (ax, length);
Jan Kratochvil 92b52c5
+	        /* Initialize the TYPE_LENGTH if it is a typedef.  */
Jan Kratochvil 92b52c5
+	        check_typedef (value.type);
Jan Kratochvil 92b52c5
+		ax_const_l (ax, TYPE_LENGTH (value.type));
Jan Kratochvil 92b52c5
 		ax_simple (ax, aop_trace);
Jan Kratochvil 92b52c5
 	      }
Jan Kratochvil 92b52c5
 	      break;
Jan Kratochvil 92b52c5
@@ -425,17 +425,18 @@ gen_traced_pop (struct gdbarch *gdbarch,
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
       case axs_lvalue_memory:
Jan Kratochvil 92b52c5
 	{
Jan Kratochvil 92b52c5
-	  int length = TYPE_LENGTH (check_typedef (value->type));
Jan Kratochvil 92b52c5
-
Jan Kratochvil 92b52c5
 	  if (string_trace)
Jan Kratochvil 92b52c5
 	    ax_simple (ax, aop_dup);
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
+	  /* Initialize the TYPE_LENGTH if it is a typedef.  */
Jan Kratochvil 92b52c5
+	  check_typedef (value->type);
Jan Kratochvil 92b52c5
+
Jan Kratochvil 92b52c5
 	  /* There's no point in trying to use a trace_quick bytecode
Jan Kratochvil 92b52c5
 	     here, since "trace_quick SIZE pop" is three bytes, whereas
Jan Kratochvil 92b52c5
 	     "const8 SIZE trace" is also three bytes, does the same
Jan Kratochvil 92b52c5
 	     thing, and the simplest code which generates that will also
Jan Kratochvil 92b52c5
 	     work correctly for objects with large sizes.  */
Jan Kratochvil 92b52c5
-	  ax_const_l (ax, length);
Jan Kratochvil 92b52c5
+	  ax_const_l (ax, TYPE_LENGTH (value->type));
Jan Kratochvil 92b52c5
 	  ax_simple (ax, aop_trace);
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
 	  if (string_trace)
Jan Kratochvil 92b52c5
Index: gdb-7.5.0.20120926/gdb/bfin-tdep.c
Jan Kratochvil 92b52c5
===================================================================
Jan Kratochvil 92b52c5
--- gdb-7.5.0.20120926.orig/gdb/bfin-tdep.c	2012-05-16 16:35:03.000000000 +0200
Jan Kratochvil 92b52c5
+++ gdb-7.5.0.20120926/gdb/bfin-tdep.c	2012-11-07 22:03:57.643623460 +0100
Jan Kratochvil 92b52c5
@@ -513,9 +513,8 @@ bfin_push_dummy_call (struct gdbarch *gd
Jan Kratochvil 92b52c5
   for (i = nargs - 1; i >= 0; i--)
Jan Kratochvil 92b52c5
     {
Jan Kratochvil 92b52c5
       struct type *value_type = value_enclosing_type (args[i]);
Jan Kratochvil 92b52c5
-      int len = TYPE_LENGTH (value_type);
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
-      total_len += (len + 3) & ~3;
Jan Kratochvil 92b52c5
+      total_len += (TYPE_LENGTH (value_type) + 3) & ~3;
Jan Kratochvil 92b52c5
     }
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
   /* At least twelve bytes of stack space must be allocated for the function's
Jan Kratochvil 92b52c5
@@ -531,8 +530,7 @@ bfin_push_dummy_call (struct gdbarch *gd
Jan Kratochvil 92b52c5
     {
Jan Kratochvil 92b52c5
       struct type *value_type = value_enclosing_type (args[i]);
Jan Kratochvil 92b52c5
       struct type *arg_type = check_typedef (value_type);
Jan Kratochvil 92b52c5
-      int len = TYPE_LENGTH (value_type);
Jan Kratochvil 92b52c5
-      int container_len = (len + 3) & ~3;
Jan Kratochvil 92b52c5
+      int container_len = (TYPE_LENGTH (value_type) + 3) & ~3;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
       sp -= container_len;
Jan Kratochvil 92b52c5
       write_memory (sp, value_contents_writeable (args[i]), container_len);
Jan Kratochvil 92b52c5
Index: gdb-7.5.0.20120926/gdb/breakpoint.c
Jan Kratochvil 92b52c5
===================================================================
Jan Kratochvil 92b52c5
--- gdb-7.5.0.20120926.orig/gdb/breakpoint.c	2012-11-07 22:00:43.000000000 +0100
Jan Kratochvil 92b52c5
+++ gdb-7.5.0.20120926/gdb/breakpoint.c	2012-11-07 22:03:57.660623434 +0100
Jan Kratochvil 92b52c5
@@ -1844,11 +1844,10 @@ update_watchpoint (struct watchpoint *b,
Jan Kratochvil 92b52c5
 		      && TYPE_CODE (vtype) != TYPE_CODE_ARRAY))
Jan Kratochvil 92b52c5
 		{
Jan Kratochvil 92b52c5
 		  CORE_ADDR addr;
Jan Kratochvil 92b52c5
-		  int len, type;
Jan Kratochvil 92b52c5
+		  int type;
Jan Kratochvil 92b52c5
 		  struct bp_location *loc, **tmp;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
 		  addr = value_address (v);
Jan Kratochvil 92b52c5
-		  len = TYPE_LENGTH (value_type (v));
Jan Kratochvil 92b52c5
 		  type = hw_write;
Jan Kratochvil 92b52c5
 		  if (b->base.type == bp_read_watchpoint)
Jan Kratochvil 92b52c5
 		    type = hw_read;
Jan Kratochvil 92b52c5
@@ -1863,7 +1862,7 @@ update_watchpoint (struct watchpoint *b,
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
 		  loc->pspace = frame_pspace;
Jan Kratochvil 92b52c5
 		  loc->address = addr;
Jan Kratochvil 92b52c5
-		  loc->length = len;
Jan Kratochvil 92b52c5
+		  loc->length = TYPE_LENGTH (value_type (v));
Jan Kratochvil 92b52c5
 		  loc->watchpoint_type = type;
Jan Kratochvil 92b52c5
 		}
Jan Kratochvil 92b52c5
 	    }
Jan Kratochvil 92b52c5
Index: gdb-7.5.0.20120926/gdb/findcmd.c
Jan Kratochvil 92b52c5
===================================================================
Jan Kratochvil 92b52c5
--- gdb-7.5.0.20120926.orig/gdb/findcmd.c	2012-07-06 17:51:39.000000000 +0200
Jan Kratochvil 92b52c5
+++ gdb-7.5.0.20120926/gdb/findcmd.c	2012-11-07 22:03:57.676623411 +0100
Jan Kratochvil 92b52c5
@@ -169,19 +169,19 @@ parse_find_args (char *args, ULONGEST *m
Jan Kratochvil 92b52c5
   while (*s != '\0')
Jan Kratochvil 92b52c5
     {
Jan Kratochvil 92b52c5
       LONGEST x;
Jan Kratochvil 92b52c5
-      int val_bytes;
Jan Kratochvil 92b52c5
+      struct type *t;
Jan Kratochvil 92b52c5
       ULONGEST pattern_buf_size_need;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
       while (isspace (*s))
Jan Kratochvil 92b52c5
 	++s;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
       v = parse_to_comma_and_eval (&s);
Jan Kratochvil 92b52c5
-      val_bytes = TYPE_LENGTH (value_type (v));
Jan Kratochvil 92b52c5
+      t = value_type (v);
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
       /* Keep it simple and assume size == 'g' when watching for when we
Jan Kratochvil 92b52c5
 	 need to grow the pattern buf.  */
Jan Kratochvil 92b52c5
       pattern_buf_size_need = (pattern_buf_end - pattern_buf
Jan Kratochvil 92b52c5
-			       + max (val_bytes, sizeof (int64_t)));
Jan Kratochvil 92b52c5
+			       + max (TYPE_LENGTH (t), sizeof (int64_t)));
Jan Kratochvil 92b52c5
       if (pattern_buf_size_need > pattern_buf_size)
Jan Kratochvil 92b52c5
 	{
Jan Kratochvil 92b52c5
 	  size_t current_offset = pattern_buf_end - pattern_buf;
Jan Kratochvil 92b52c5
@@ -215,8 +215,8 @@ parse_find_args (char *args, ULONGEST *m
Jan Kratochvil 92b52c5
 	}
Jan Kratochvil 92b52c5
       else
Jan Kratochvil 92b52c5
 	{
Jan Kratochvil 92b52c5
-	  memcpy (pattern_buf_end, value_contents (v), val_bytes);
Jan Kratochvil 92b52c5
-	  pattern_buf_end += val_bytes;
Jan Kratochvil 92b52c5
+	  memcpy (pattern_buf_end, value_contents (v), TYPE_LENGTH (t));
Jan Kratochvil 92b52c5
+	  pattern_buf_end += TYPE_LENGTH (t);
Jan Kratochvil 92b52c5
 	}
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
       if (*s == ',')
Jan Kratochvil 92b52c5
Index: gdb-7.5.0.20120926/gdb/h8300-tdep.c
Jan Kratochvil 92b52c5
===================================================================
Jan Kratochvil 92b52c5
--- gdb-7.5.0.20120926.orig/gdb/h8300-tdep.c	2012-11-07 22:00:44.000000000 +0100
Jan Kratochvil 92b52c5
+++ gdb-7.5.0.20120926/gdb/h8300-tdep.c	2012-11-07 22:03:57.679623409 +0100
Jan Kratochvil 92b52c5
@@ -785,16 +785,15 @@ h8300h_extract_return_value (struct type
Jan Kratochvil 92b52c5
 {
Jan Kratochvil 92b52c5
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
Jan Kratochvil 92b52c5
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
Jan Kratochvil 92b52c5
-  int len = TYPE_LENGTH (type);
Jan Kratochvil 92b52c5
   ULONGEST c;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
-  switch (len)
Jan Kratochvil 92b52c5
+  switch (TYPE_LENGTH (type))
Jan Kratochvil 92b52c5
     {
Jan Kratochvil 92b52c5
     case 1:
Jan Kratochvil 92b52c5
     case 2:
Jan Kratochvil 92b52c5
     case 4:
Jan Kratochvil 92b52c5
       regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &c);
Jan Kratochvil 92b52c5
-      store_unsigned_integer (valbuf, len, byte_order, c);
Jan Kratochvil 92b52c5
+      store_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order, c);
Jan Kratochvil 92b52c5
       break;
Jan Kratochvil 92b52c5
     case 8:			/* long long is now 8 bytes.  */
Jan Kratochvil 92b52c5
       if (TYPE_CODE (type) == TYPE_CODE_INT)
Jan Kratochvil 92b52c5
@@ -852,18 +851,17 @@ h8300_store_return_value (struct type *t
Jan Kratochvil 92b52c5
 {
Jan Kratochvil 92b52c5
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
Jan Kratochvil 92b52c5
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
Jan Kratochvil 92b52c5
-  int len = TYPE_LENGTH (type);
Jan Kratochvil 92b52c5
   ULONGEST val;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
-  switch (len)
Jan Kratochvil 92b52c5
+  switch (TYPE_LENGTH (type))
Jan Kratochvil 92b52c5
     {
Jan Kratochvil 92b52c5
     case 1:
Jan Kratochvil 92b52c5
     case 2:			/* short...  */
Jan Kratochvil 92b52c5
-      val = extract_unsigned_integer (valbuf, len, byte_order);
Jan Kratochvil 92b52c5
+      val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order);
Jan Kratochvil 92b52c5
       regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM, val);
Jan Kratochvil 92b52c5
       break;
Jan Kratochvil 92b52c5
     case 4:			/* long, float */
Jan Kratochvil 92b52c5
-      val = extract_unsigned_integer (valbuf, len, byte_order);
Jan Kratochvil 92b52c5
+      val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order);
Jan Kratochvil 92b52c5
       regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM,
Jan Kratochvil 92b52c5
 				      (val >> 16) & 0xffff);
Jan Kratochvil 92b52c5
       regcache_cooked_write_unsigned (regcache, E_RET1_REGNUM, val & 0xffff);
Jan Kratochvil 92b52c5
@@ -882,19 +880,18 @@ h8300h_store_return_value (struct type *
Jan Kratochvil 92b52c5
 {
Jan Kratochvil 92b52c5
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
Jan Kratochvil 92b52c5
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
Jan Kratochvil 92b52c5
-  int len = TYPE_LENGTH (type);
Jan Kratochvil 92b52c5
   ULONGEST val;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
-  switch (len)
Jan Kratochvil 92b52c5
+  switch (TYPE_LENGTH (type))
Jan Kratochvil 92b52c5
     {
Jan Kratochvil 92b52c5
     case 1:
Jan Kratochvil 92b52c5
     case 2:
Jan Kratochvil 92b52c5
     case 4:			/* long, float */
Jan Kratochvil 92b52c5
-      val = extract_unsigned_integer (valbuf, len, byte_order);
Jan Kratochvil 92b52c5
+      val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order);
Jan Kratochvil 92b52c5
       regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM, val);
Jan Kratochvil 92b52c5
       break;
Jan Kratochvil 92b52c5
     case 8:
Jan Kratochvil 92b52c5
-      val = extract_unsigned_integer (valbuf, len, byte_order);
Jan Kratochvil 92b52c5
+      val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order);
Jan Kratochvil 92b52c5
       regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM,
Jan Kratochvil 92b52c5
 				      (val >> 32) & 0xffffffff);
Jan Kratochvil 92b52c5
       regcache_cooked_write_unsigned (regcache, E_RET1_REGNUM,
Jan Kratochvil 92b52c5
Index: gdb-7.5.0.20120926/gdb/i386-darwin-tdep.c
Jan Kratochvil 92b52c5
===================================================================
Jan Kratochvil 92b52c5
--- gdb-7.5.0.20120926.orig/gdb/i386-darwin-tdep.c	2012-04-02 15:15:48.000000000 +0200
Jan Kratochvil 92b52c5
+++ gdb-7.5.0.20120926/gdb/i386-darwin-tdep.c	2012-11-07 22:03:57.680623407 +0100
Jan Kratochvil 92b52c5
@@ -196,13 +196,12 @@ i386_darwin_push_dummy_call (struct gdba
Jan Kratochvil 92b52c5
             }
Jan Kratochvil 92b52c5
           else
Jan Kratochvil 92b52c5
             {
Jan Kratochvil 92b52c5
-              int len = TYPE_LENGTH (arg_type);
Jan Kratochvil 92b52c5
-              int align = i386_darwin_arg_type_alignment (arg_type);
Jan Kratochvil 92b52c5
-
Jan Kratochvil 92b52c5
-              args_space = align_up (args_space, align);
Jan Kratochvil 92b52c5
+              args_space = align_up (args_space,
Jan Kratochvil 92b52c5
+				     i386_darwin_arg_type_alignment (arg_type));
Jan Kratochvil 92b52c5
               if (write_pass)
Jan Kratochvil 92b52c5
                 write_memory (sp + args_space,
Jan Kratochvil 92b52c5
-                              value_contents_all (args[i]), len);
Jan Kratochvil 92b52c5
+                              value_contents_all (args[i]),
Jan Kratochvil 92b52c5
+			      TYPE_LENGTH (arg_type));
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
               /* The System V ABI says that:
Jan Kratochvil 92b52c5
                  
Jan Kratochvil 92b52c5
@@ -211,7 +210,7 @@ i386_darwin_push_dummy_call (struct gdba
Jan Kratochvil 92b52c5
                  depending on the size of the argument."
Jan Kratochvil 92b52c5
                  
Jan Kratochvil 92b52c5
                  This makes sure the stack stays word-aligned.  */
Jan Kratochvil 92b52c5
-              args_space += align_up (len, 4);
Jan Kratochvil 92b52c5
+              args_space += align_up (TYPE_LENGTH (arg_type), 4);
Jan Kratochvil 92b52c5
             }
Jan Kratochvil 92b52c5
         }
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
Index: gdb-7.5.0.20120926/gdb/infcall.c
Jan Kratochvil 92b52c5
===================================================================
Jan Kratochvil 92b52c5
--- gdb-7.5.0.20120926.orig/gdb/infcall.c	2012-07-31 09:34:39.000000000 +0200
Jan Kratochvil 92b52c5
+++ gdb-7.5.0.20120926/gdb/infcall.c	2012-11-07 22:03:57.694623385 +0100
Jan Kratochvil 92b52c5
@@ -709,13 +709,11 @@ call_function_by_hand (struct value *fun
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
   if (struct_return || hidden_first_param_p)
Jan Kratochvil 92b52c5
     {
Jan Kratochvil 92b52c5
-      int len = TYPE_LENGTH (values_type);
Jan Kratochvil 92b52c5
-
Jan Kratochvil 92b52c5
       if (gdbarch_inner_than (gdbarch, 1, 2))
Jan Kratochvil 92b52c5
 	{
Jan Kratochvil 92b52c5
 	  /* Stack grows downward.  Align STRUCT_ADDR and SP after
Jan Kratochvil 92b52c5
              making space for the return value.  */
Jan Kratochvil 92b52c5
-	  sp -= len;
Jan Kratochvil 92b52c5
+	  sp -= TYPE_LENGTH (values_type);
Jan Kratochvil 92b52c5
 	  if (gdbarch_frame_align_p (gdbarch))
Jan Kratochvil 92b52c5
 	    sp = gdbarch_frame_align (gdbarch, sp);
Jan Kratochvil 92b52c5
 	  struct_addr = sp;
Jan Kratochvil 92b52c5
@@ -727,7 +725,7 @@ call_function_by_hand (struct value *fun
Jan Kratochvil 92b52c5
 	  if (gdbarch_frame_align_p (gdbarch))
Jan Kratochvil 92b52c5
 	    sp = gdbarch_frame_align (gdbarch, sp);
Jan Kratochvil 92b52c5
 	  struct_addr = sp;
Jan Kratochvil 92b52c5
-	  sp += len;
Jan Kratochvil 92b52c5
+	  sp += TYPE_LENGTH (values_type);
Jan Kratochvil 92b52c5
 	  if (gdbarch_frame_align_p (gdbarch))
Jan Kratochvil 92b52c5
 	    sp = gdbarch_frame_align (gdbarch, sp);
Jan Kratochvil 92b52c5
 	}
Jan Kratochvil 92b52c5
Index: gdb-7.5.0.20120926/gdb/lm32-tdep.c
Jan Kratochvil 92b52c5
===================================================================
Jan Kratochvil 92b52c5
--- gdb-7.5.0.20120926.orig/gdb/lm32-tdep.c	2012-05-18 23:02:48.000000000 +0200
Jan Kratochvil 92b52c5
+++ gdb-7.5.0.20120926/gdb/lm32-tdep.c	2012-11-07 22:03:57.695623384 +0100
Jan Kratochvil 92b52c5
@@ -261,7 +261,6 @@ lm32_push_dummy_call (struct gdbarch *gd
Jan Kratochvil 92b52c5
       struct value *arg = args[i];
Jan Kratochvil 92b52c5
       struct type *arg_type = check_typedef (value_type (arg));
Jan Kratochvil 92b52c5
       gdb_byte *contents;
Jan Kratochvil 92b52c5
-      int len;
Jan Kratochvil 92b52c5
       ULONGEST val;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
       /* Promote small integer types to int.  */
Jan Kratochvil 92b52c5
@@ -283,8 +282,8 @@ lm32_push_dummy_call (struct gdbarch *gd
Jan Kratochvil 92b52c5
       /* FIXME: Handle structures.  */
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
       contents = (gdb_byte *) value_contents (arg);
Jan Kratochvil 92b52c5
-      len = TYPE_LENGTH (arg_type);
Jan Kratochvil 92b52c5
-      val = extract_unsigned_integer (contents, len, byte_order);
Jan Kratochvil 92b52c5
+      val = extract_unsigned_integer (contents, TYPE_LENGTH (arg_type),
Jan Kratochvil 92b52c5
+				      byte_order);
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
       /* First num_arg_regs parameters are passed by registers, 
Jan Kratochvil 92b52c5
          and the rest are passed on the stack.  */
Jan Kratochvil 92b52c5
@@ -292,7 +291,7 @@ lm32_push_dummy_call (struct gdbarch *gd
Jan Kratochvil 92b52c5
 	regcache_cooked_write_unsigned (regcache, first_arg_reg + i, val);
Jan Kratochvil 92b52c5
       else
Jan Kratochvil 92b52c5
 	{
Jan Kratochvil 92b52c5
-	  write_memory (sp, (void *) &val, len);
Jan Kratochvil 92b52c5
+	  write_memory (sp, (void *) &val, TYPE_LENGTH (arg_type));
Jan Kratochvil 92b52c5
 	  sp -= 4;
Jan Kratochvil 92b52c5
 	}
Jan Kratochvil 92b52c5
     }
Jan Kratochvil 92b52c5
Index: gdb-7.5.0.20120926/gdb/m68hc11-tdep.c
Jan Kratochvil 92b52c5
===================================================================
Jan Kratochvil 92b52c5
--- gdb-7.5.0.20120926.orig/gdb/m68hc11-tdep.c	2012-05-16 16:35:06.000000000 +0200
Jan Kratochvil 92b52c5
+++ gdb-7.5.0.20120926/gdb/m68hc11-tdep.c	2012-11-07 22:03:57.724623347 +0100
Jan Kratochvil 92b52c5
@@ -1174,7 +1174,6 @@ m68hc11_push_dummy_call (struct gdbarch
Jan Kratochvil 92b52c5
   int first_stack_argnum;
Jan Kratochvil 92b52c5
   struct type *type;
Jan Kratochvil 92b52c5
   char *val;
Jan Kratochvil 92b52c5
-  int len;
Jan Kratochvil 92b52c5
   char buf[2];
Jan Kratochvil 92b52c5
   
Jan Kratochvil 92b52c5
   first_stack_argnum = 0;
Jan Kratochvil 92b52c5
@@ -1185,19 +1184,18 @@ m68hc11_push_dummy_call (struct gdbarch
Jan Kratochvil 92b52c5
   else if (nargs > 0)
Jan Kratochvil 92b52c5
     {
Jan Kratochvil 92b52c5
       type = value_type (args[0]);
Jan Kratochvil 92b52c5
-      len = TYPE_LENGTH (type);
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
       /* First argument is passed in D and X registers.  */
Jan Kratochvil 92b52c5
-      if (len <= 4)
Jan Kratochvil 92b52c5
+      if (TYPE_LENGTH (type) <= 4)
Jan Kratochvil 92b52c5
         {
Jan Kratochvil 92b52c5
           ULONGEST v;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
           v = extract_unsigned_integer (value_contents (args[0]),
Jan Kratochvil 92b52c5
-					len, byte_order);
Jan Kratochvil 92b52c5
+					TYPE_LENGTH (type), byte_order);
Jan Kratochvil 92b52c5
           first_stack_argnum = 1;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
           regcache_cooked_write_unsigned (regcache, HARD_D_REGNUM, v);
Jan Kratochvil 92b52c5
-          if (len > 2)
Jan Kratochvil 92b52c5
+          if (TYPE_LENGTH (type) > 2)
Jan Kratochvil 92b52c5
             {
Jan Kratochvil 92b52c5
               v >>= 16;
Jan Kratochvil 92b52c5
               regcache_cooked_write_unsigned (regcache, HARD_X_REGNUM, v);
Jan Kratochvil 92b52c5
@@ -1208,9 +1206,8 @@ m68hc11_push_dummy_call (struct gdbarch
Jan Kratochvil 92b52c5
   for (argnum = nargs - 1; argnum >= first_stack_argnum; argnum--)
Jan Kratochvil 92b52c5
     {
Jan Kratochvil 92b52c5
       type = value_type (args[argnum]);
Jan Kratochvil 92b52c5
-      len = TYPE_LENGTH (type);
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
-      if (len & 1)
Jan Kratochvil 92b52c5
+      if (TYPE_LENGTH (type) & 1)
Jan Kratochvil 92b52c5
         {
Jan Kratochvil 92b52c5
           static char zero = 0;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
@@ -1218,8 +1215,8 @@ m68hc11_push_dummy_call (struct gdbarch
Jan Kratochvil 92b52c5
           write_memory (sp, &zero, 1);
Jan Kratochvil 92b52c5
         }
Jan Kratochvil 92b52c5
       val = (char*) value_contents (args[argnum]);
Jan Kratochvil 92b52c5
-      sp -= len;
Jan Kratochvil 92b52c5
-      write_memory (sp, val, len);
Jan Kratochvil 92b52c5
+      sp -= TYPE_LENGTH (type);
Jan Kratochvil 92b52c5
+      write_memory (sp, val, TYPE_LENGTH (type));
Jan Kratochvil 92b52c5
     }
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
   /* Store return address.  */
Jan Kratochvil 92b52c5
@@ -1291,11 +1288,10 @@ static void
Jan Kratochvil 92b52c5
 m68hc11_extract_return_value (struct type *type, struct regcache *regcache,
Jan Kratochvil 92b52c5
                               void *valbuf)
Jan Kratochvil 92b52c5
 {
Jan Kratochvil 92b52c5
-  int len = TYPE_LENGTH (type);
Jan Kratochvil 92b52c5
   char buf[M68HC11_REG_SIZE];
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
   regcache_raw_read (regcache, HARD_D_REGNUM, buf);
Jan Kratochvil 92b52c5
-  switch (len)
Jan Kratochvil 92b52c5
+  switch (TYPE_LENGTH (type))
Jan Kratochvil 92b52c5
     {
Jan Kratochvil 92b52c5
     case 1:
Jan Kratochvil 92b52c5
       memcpy (valbuf, buf + 1, 1);
Jan Kratochvil 92b52c5
Index: gdb-7.5.0.20120926/gdb/mep-tdep.c
Jan Kratochvil 92b52c5
===================================================================
Jan Kratochvil 92b52c5
--- gdb-7.5.0.20120926.orig/gdb/mep-tdep.c	2012-05-16 16:35:06.000000000 +0200
Jan Kratochvil 92b52c5
+++ gdb-7.5.0.20120926/gdb/mep-tdep.c	2012-11-07 22:03:57.727623334 +0100
Jan Kratochvil 92b52c5
@@ -2337,11 +2337,10 @@ mep_push_dummy_call (struct gdbarch *gdb
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
   for (i = 0; i < argc; i++)
Jan Kratochvil 92b52c5
     {
Jan Kratochvil 92b52c5
-      unsigned arg_size = TYPE_LENGTH (value_type (argv[i]));
Jan Kratochvil 92b52c5
       ULONGEST value;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
       /* Arguments that fit in a GPR get expanded to fill the GPR.  */
Jan Kratochvil 92b52c5
-      if (arg_size <= MEP_GPR_SIZE)
Jan Kratochvil 92b52c5
+      if (TYPE_LENGTH (value_type (argv[i])) <= MEP_GPR_SIZE)
Jan Kratochvil 92b52c5
         value = extract_unsigned_integer (value_contents (argv[i]),
Jan Kratochvil 92b52c5
                                           TYPE_LENGTH (value_type (argv[i])),
Jan Kratochvil 92b52c5
 					  byte_order);
Jan Kratochvil 92b52c5
Index: gdb-7.5.0.20120926/gdb/printcmd.c
Jan Kratochvil 92b52c5
===================================================================
Jan Kratochvil 92b52c5
--- gdb-7.5.0.20120926.orig/gdb/printcmd.c	2012-11-07 22:00:44.000000000 +0100
Jan Kratochvil 92b52c5
+++ gdb-7.5.0.20120926/gdb/printcmd.c	2012-11-07 22:03:57.730623334 +0100
Jan Kratochvil 92b52c5
@@ -347,13 +347,12 @@ float_type_from_length (struct type *typ
Jan Kratochvil 92b52c5
 {
Jan Kratochvil 92b52c5
   struct gdbarch *gdbarch = get_type_arch (type);
Jan Kratochvil 92b52c5
   const struct builtin_type *builtin = builtin_type (gdbarch);
Jan Kratochvil 92b52c5
-  unsigned int len = TYPE_LENGTH (type);
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
-  if (len == TYPE_LENGTH (builtin->builtin_float))
Jan Kratochvil 92b52c5
+  if (TYPE_LENGTH (type) == TYPE_LENGTH (builtin->builtin_float))
Jan Kratochvil 92b52c5
     type = builtin->builtin_float;
Jan Kratochvil 92b52c5
-  else if (len == TYPE_LENGTH (builtin->builtin_double))
Jan Kratochvil 92b52c5
+  else if (TYPE_LENGTH (type) == TYPE_LENGTH (builtin->builtin_double))
Jan Kratochvil 92b52c5
     type = builtin->builtin_double;
Jan Kratochvil 92b52c5
-  else if (len == TYPE_LENGTH (builtin->builtin_long_double))
Jan Kratochvil 92b52c5
+  else if (TYPE_LENGTH (type) == TYPE_LENGTH (builtin->builtin_long_double))
Jan Kratochvil 92b52c5
     type = builtin->builtin_long_double;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
   return type;
Jan Kratochvil 92b52c5
Index: gdb-7.5.0.20120926/gdb/s390-tdep.c
Jan Kratochvil 92b52c5
===================================================================
Jan Kratochvil 92b52c5
--- gdb-7.5.0.20120926.orig/gdb/s390-tdep.c	2012-11-07 22:02:30.000000000 +0100
Jan Kratochvil 92b52c5
+++ gdb-7.5.0.20120926/gdb/s390-tdep.c	2012-11-07 22:03:57.733623329 +0100
Jan Kratochvil 92b52c5
@@ -376,9 +376,11 @@ s390_value_from_register (struct type *t
Jan Kratochvil 92b52c5
 			  struct frame_info *frame)
Jan Kratochvil 92b52c5
 {
Jan Kratochvil 92b52c5
   struct value *value = default_value_from_register (type, regnum, frame);
Jan Kratochvil 92b52c5
-  int len = TYPE_LENGTH (check_typedef (type));
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
-  if (regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM && len < 8)
Jan Kratochvil 92b52c5
+  check_typedef (type);
Jan Kratochvil 92b52c5
+
Jan Kratochvil 92b52c5
+  if (regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM
Jan Kratochvil 92b52c5
+      && TYPE_LENGTH (type) < 8)
Jan Kratochvil 92b52c5
     set_value_offset (value, 0);
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
   return value;
Jan Kratochvil 92b52c5
Index: gdb-7.5.0.20120926/gdb/stack.c
Jan Kratochvil 92b52c5
===================================================================
Jan Kratochvil 92b52c5
--- gdb-7.5.0.20120926.orig/gdb/stack.c	2012-11-07 22:00:43.000000000 +0100
Jan Kratochvil 92b52c5
+++ gdb-7.5.0.20120926/gdb/stack.c	2012-11-07 22:03:57.737623322 +0100
Jan Kratochvil 92b52c5
@@ -354,14 +354,15 @@ read_frame_arg (struct symbol *sym, stru
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
 	  if (val && entryval && !ui_out_is_mi_like_p (current_uiout))
Jan Kratochvil 92b52c5
 	    {
Jan Kratochvil 92b52c5
-	      unsigned len = TYPE_LENGTH (value_type (val));
Jan Kratochvil 92b52c5
+	      struct type *type = value_type (val);
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
 	      if (!value_optimized_out (val) && value_lazy (val))
Jan Kratochvil 92b52c5
 		value_fetch_lazy (val);
Jan Kratochvil 92b52c5
 	      if (!value_optimized_out (val) && value_lazy (entryval))
Jan Kratochvil 92b52c5
 		value_fetch_lazy (entryval);
Jan Kratochvil 92b52c5
 	      if (!value_optimized_out (val)
Jan Kratochvil 92b52c5
-		  && value_available_contents_eq (val, 0, entryval, 0, len))
Jan Kratochvil 92b52c5
+		  && value_available_contents_eq (val, 0, entryval, 0,
Jan Kratochvil 92b52c5
+						  TYPE_LENGTH (type)))
Jan Kratochvil 92b52c5
 		{
Jan Kratochvil 92b52c5
 		  /* Initialize it just to avoid a GCC false warning.  */
Jan Kratochvil 92b52c5
 		  struct value *val_deref = NULL, *entryval_deref;
Jan Kratochvil 92b52c5
@@ -373,12 +374,12 @@ read_frame_arg (struct symbol *sym, stru
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
 		  TRY_CATCH (except, RETURN_MASK_ERROR)
Jan Kratochvil 92b52c5
 		    {
Jan Kratochvil 92b52c5
-		      unsigned len_deref;
Jan Kratochvil 92b52c5
+		      struct type *type_deref;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
 		      val_deref = coerce_ref (val);
Jan Kratochvil 92b52c5
 		      if (value_lazy (val_deref))
Jan Kratochvil 92b52c5
 			value_fetch_lazy (val_deref);
Jan Kratochvil 92b52c5
-		      len_deref = TYPE_LENGTH (value_type (val_deref));
Jan Kratochvil 92b52c5
+		      type_deref = value_type (val_deref);
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
 		      entryval_deref = coerce_ref (entryval);
Jan Kratochvil 92b52c5
 		      if (value_lazy (entryval_deref))
Jan Kratochvil 92b52c5
@@ -389,7 +390,7 @@ read_frame_arg (struct symbol *sym, stru
Jan Kratochvil 92b52c5
 		      if (val != val_deref
Jan Kratochvil 92b52c5
 			  && value_available_contents_eq (val_deref, 0,
Jan Kratochvil 92b52c5
 							  entryval_deref, 0,
Jan Kratochvil 92b52c5
-							  len_deref))
Jan Kratochvil 92b52c5
+						      TYPE_LENGTH (type_deref)))
Jan Kratochvil 92b52c5
 			val_equal = 1;
Jan Kratochvil 92b52c5
 		    }
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
Index: gdb-7.5.0.20120926/gdb/tracepoint.c
Jan Kratochvil 92b52c5
===================================================================
Jan Kratochvil 92b52c5
--- gdb-7.5.0.20120926.orig/gdb/tracepoint.c	2012-06-30 00:46:46.000000000 +0200
Jan Kratochvil 92b52c5
+++ gdb-7.5.0.20120926/gdb/tracepoint.c	2012-11-07 22:03:57.741623318 +0100
Jan Kratochvil 92b52c5
@@ -1450,7 +1450,7 @@ encode_actions_1 (struct command_line *a
Jan Kratochvil 92b52c5
 		}
Jan Kratochvil 92b52c5
 	      else
Jan Kratochvil 92b52c5
 		{
Jan Kratochvil 92b52c5
-		  unsigned long addr, len;
Jan Kratochvil 92b52c5
+		  unsigned long addr;
Jan Kratochvil 92b52c5
 		  struct cleanup *old_chain = NULL;
Jan Kratochvil 92b52c5
 		  struct cleanup *old_chain1 = NULL;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
@@ -1480,8 +1480,10 @@ encode_actions_1 (struct command_line *a
Jan Kratochvil 92b52c5
 		      /* Safe because we know it's a simple expression.  */
Jan Kratochvil 92b52c5
 		      tempval = evaluate_expression (exp);
Jan Kratochvil 92b52c5
 		      addr = value_address (tempval);
Jan Kratochvil 92b52c5
-		      len = TYPE_LENGTH (check_typedef (exp->elts[1].type));
Jan Kratochvil 92b52c5
-		      add_memrange (collect, memrange_absolute, addr, len);
Jan Kratochvil 92b52c5
+		      /* Initialize the TYPE_LENGTH if it is a typedef.  */
Jan Kratochvil 92b52c5
+		      check_typedef (exp->elts[1].type);
Jan Kratochvil 92b52c5
+		      add_memrange (collect, memrange_absolute, addr,
Jan Kratochvil 92b52c5
+				    TYPE_LENGTH (exp->elts[1].type));
Jan Kratochvil 92b52c5
 		      break;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
 		    case OP_VAR_VALUE:
Jan Kratochvil 92b52c5
Index: gdb-7.5.0.20120926/gdb/valops.c
Jan Kratochvil 92b52c5
===================================================================
Jan Kratochvil 92b52c5
--- gdb-7.5.0.20120926.orig/gdb/valops.c	2012-11-07 22:00:44.000000000 +0100
Jan Kratochvil 92b52c5
+++ gdb-7.5.0.20120926/gdb/valops.c	2012-11-07 22:06:35.899393539 +0100
Jan Kratochvil 92b52c5
@@ -1055,7 +1055,6 @@ value_fetch_lazy (struct value *val)
Jan Kratochvil 92b52c5
       struct value *parent = value_parent (val);
Jan Kratochvil 92b52c5
       LONGEST offset = value_offset (val);
Jan Kratochvil 92b52c5
       LONGEST num;
Jan Kratochvil 92b52c5
-      int length = TYPE_LENGTH (type);
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
       if (!value_bits_valid (val,
Jan Kratochvil 92b52c5
 			     TARGET_CHAR_BIT * offset + value_bitpos (val),
Jan Kratochvil 92b52c5
@@ -1069,9 +1068,9 @@ value_fetch_lazy (struct value *val)
Jan Kratochvil 92b52c5
 				      value_bitsize (val), parent, &num))
Jan Kratochvil 92b52c5
 	mark_value_bytes_unavailable (val,
Jan Kratochvil 92b52c5
 				      value_embedded_offset (val),
Jan Kratochvil 92b52c5
-				      length);
Jan Kratochvil 92b52c5
+				      TYPE_LENGTH (type));
Jan Kratochvil 92b52c5
       else
Jan Kratochvil 92b52c5
-	store_signed_integer (value_contents_raw (val), length,
Jan Kratochvil 92b52c5
+	store_signed_integer (value_contents_raw (val), TYPE_LENGTH (type),
Jan Kratochvil 92b52c5
 			      byte_order, num);
Jan Kratochvil 92b52c5
     }
Jan Kratochvil 92b52c5
   else if (VALUE_LVAL (val) == lval_memory)
Jan Kratochvil 92b52c5
@@ -1080,16 +1079,16 @@ value_fetch_lazy (struct value *val)
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
       if (object_address_get_data (value_type (val), &addr))
Jan Kratochvil 92b52c5
 	{
Jan Kratochvil 92b52c5
-	  struct type *type = value_enclosing_type (val);
Jan Kratochvil 92b52c5
-	  int length = TYPE_LENGTH (check_typedef (type));
Jan Kratochvil 92b52c5
+	  struct type *type = check_typedef (value_enclosing_type (val));
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
-	  if (length)
Jan Kratochvil 92b52c5
+	  if (TYPE_LENGTH (type))
Jan Kratochvil 92b52c5
 	    {
Jan Kratochvil 92b52c5
 	      /* Delay it after object_address_get_data above.  */
Jan Kratochvil 92b52c5
 	      allocate_value_contents (val);
Jan Kratochvil 92b52c5
 	      addr += value_offset (val);
Jan Kratochvil 92b52c5
 	      read_value_memory (val, 0, value_stack (val),
Jan Kratochvil 92b52c5
-				 addr, value_contents_all_raw (val), length);
Jan Kratochvil 92b52c5
+				 addr, value_contents_all_raw (val),
Jan Kratochvil 92b52c5
+				 TYPE_LENGTH (type));
Jan Kratochvil 92b52c5
 	    }
Jan Kratochvil 92b52c5
 	}
Jan Kratochvil 92b52c5
       /* Just to be sure it has been called.  */
Jan Kratochvil 92b52c5
Index: gdb-7.5.0.20120926/gdb/value.c
Jan Kratochvil 92b52c5
===================================================================
Jan Kratochvil 92b52c5
--- gdb-7.5.0.20120926.orig/gdb/value.c	2012-11-07 22:00:43.000000000 +0100
Jan Kratochvil 92b52c5
+++ gdb-7.5.0.20120926/gdb/value.c	2012-11-07 22:03:57.751623303 +0100
Jan Kratochvil 92b52c5
@@ -1034,15 +1034,14 @@ value_contents_equal (struct value *val1
Jan Kratochvil 92b52c5
 {
Jan Kratochvil 92b52c5
   struct type *type1;
Jan Kratochvil 92b52c5
   struct type *type2;
Jan Kratochvil 92b52c5
-  int len;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
   type1 = check_typedef (value_type (val1));
Jan Kratochvil 92b52c5
   type2 = check_typedef (value_type (val2));
Jan Kratochvil 92b52c5
-  len = TYPE_LENGTH (type1);
Jan Kratochvil 92b52c5
-  if (len != TYPE_LENGTH (type2))
Jan Kratochvil 92b52c5
+  if (TYPE_LENGTH (type1) != TYPE_LENGTH (type2))
Jan Kratochvil 92b52c5
     return 0;
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
-  return (memcmp (value_contents (val1), value_contents (val2), len) == 0);
Jan Kratochvil 92b52c5
+  return (memcmp (value_contents (val1), value_contents (val2),
Jan Kratochvil 92b52c5
+		  TYPE_LENGTH (type1)) == 0);
Jan Kratochvil 92b52c5
 }
Jan Kratochvil 92b52c5
 
Jan Kratochvil 92b52c5
 int