Make sure terminal settings are restored before exiting
[deliverable/binutils-gdb.git] / gdb / gdbtypes.c
index 3f1f3fb6a20ad5d4a2fa69df711a4c61cf47ef74..e6a95474a5a2793ca4756f2fd2fb42c7c871e46a 100644 (file)
@@ -252,6 +252,17 @@ get_target_type (struct type *type)
   return type;
 }
 
+/* See gdbtypes.h.  */
+
+unsigned int
+type_length_units (struct type *type)
+{
+  struct gdbarch *arch = get_type_arch (type);
+  int unit_size = gdbarch_addressable_memory_unit_size (arch);
+
+  return TYPE_LENGTH (type) / unit_size;
+}
+
 /* Alloc a new type instance structure, fill it with some defaults,
    and point it at OLDTYPE.  Allocate the new type instance from the
    same place as OLDTYPE.  */
This page took 0.02293 seconds and 4 git commands to generate.