This is the mail archive of the gdb-patches@sourceware.org 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]

[PATCH] m32c: Use byte-size, not bit-size to create types


m32c-tdep.c creates several m32c-specific types by calling
arch_type().  This function was being invoked incorrectly; each call
of arch_type() specified the length of the new type in bits instead of
in bytes.  I've made the obvious adjustment so that the size of the
type in bytes is passed instead.

Committed as obvious.

Kevin

	* m32c-tdep.c (make_types): When calling `arch_type', pass size of
	type in bytes, not bits.

Index: m32c-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m32c-tdep.c,v
retrieving revision 1.35
diff -u -p -r1.35 m32c-tdep.c
--- m32c-tdep.c	1 Jan 2010 07:31:37 -0000	1.35
+++ m32c-tdep.c	6 Apr 2010 00:10:21 -0000
@@ -194,7 +194,8 @@ make_types (struct gdbarch *arch)
      this is called, so we avoid using them.  */
   tdep->voyd = arch_type (arch, TYPE_CODE_VOID, 1, "void");
   tdep->ptr_voyd
-    = arch_type (arch, TYPE_CODE_PTR, gdbarch_ptr_bit (arch), NULL);
+    = arch_type (arch, TYPE_CODE_PTR, gdbarch_ptr_bit (arch) / TARGET_CHAR_BIT,
+                 NULL);
   TYPE_TARGET_TYPE (tdep->ptr_voyd) = tdep->voyd;
   TYPE_UNSIGNED (tdep->ptr_voyd) = 1;
   tdep->func_voyd = lookup_function_type (tdep->voyd);
@@ -202,14 +203,16 @@ make_types (struct gdbarch *arch)
   sprintf (type_name, "%s_data_addr_t",
 	   gdbarch_bfd_arch_info (arch)->printable_name);
   tdep->data_addr_reg_type
-    = arch_type (arch, TYPE_CODE_PTR, data_addr_reg_bits, xstrdup (type_name));
+    = arch_type (arch, TYPE_CODE_PTR, data_addr_reg_bits / TARGET_CHAR_BIT,
+                 xstrdup (type_name));
   TYPE_TARGET_TYPE (tdep->data_addr_reg_type) = tdep->voyd;
   TYPE_UNSIGNED (tdep->data_addr_reg_type) = 1;
 
   sprintf (type_name, "%s_code_addr_t",
 	   gdbarch_bfd_arch_info (arch)->printable_name);
   tdep->code_addr_reg_type
-    = arch_type (arch, TYPE_CODE_PTR, code_addr_reg_bits, xstrdup (type_name));
+    = arch_type (arch, TYPE_CODE_PTR, code_addr_reg_bits / TARGET_CHAR_BIT,
+                 xstrdup (type_name));
   TYPE_TARGET_TYPE (tdep->code_addr_reg_type) = tdep->func_voyd;
   TYPE_UNSIGNED (tdep->code_addr_reg_type) = 1;
 


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