aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib-darwin.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2015-12-11 17:06:35 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2015-12-14 10:54:21 +0000
commit132874d7e3c94d8cc6f865b57f286cf62e5ad0b8 (patch)
treec40a4ed4653090e95bd0ac1b57d8095d76ab99f6 /gdb/solib-darwin.c
parent92e18d93433197e0cee12366b17297a984e76bd8 (diff)
gdb: Use TYPE_LENGTH macro
Fixes a couple of places where we access the length field of the type structure directly, rather than using the TYPE_LENGTH macro. gdb/ChangeLog: * i386-tdep.c (i386_mpx_info_bounds): Use TYPE_LENGTH. (i386_mpx_set_bounds): Likewise. * solib-darwin.c (darwin_load_image_infos): Likewise. (darwin_solib_read_all_image_info_addr): Likewise.
Diffstat (limited to 'gdb/solib-darwin.c')
-rw-r--r--gdb/solib-darwin.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c
index 88a4d73c4b..6829bc56cc 100644
--- a/gdb/solib-darwin.c
+++ b/gdb/solib-darwin.c
@@ -132,7 +132,7 @@ darwin_load_image_infos (struct darwin_info *info)
/* The structure has 4 fields: version (4 bytes), count (4 bytes),
info (pointer) and notifier (pointer). */
- len = 4 + 4 + 2 * ptr_type->length;
+ len = 4 + 4 + 2 * TYPE_LENGTH (ptr_type);
gdb_assert (len <= sizeof (buf));
memset (&info->all_image, 0, sizeof (info->all_image));
@@ -148,7 +148,7 @@ darwin_load_image_infos (struct darwin_info *info)
info->all_image.count = extract_unsigned_integer (buf + 4, 4, byte_order);
info->all_image.info = extract_typed_address (buf + 8, ptr_type);
info->all_image.notifier = extract_typed_address
- (buf + 8 + ptr_type->length, ptr_type);
+ (buf + 8 + TYPE_LENGTH (ptr_type), ptr_type);
}
/* Link map info to include in an allocated so_list entry. */
@@ -528,11 +528,11 @@ darwin_solib_read_all_image_info_addr (struct darwin_info *info)
struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
/* Sanity check. */
- if (ptr_type->length > sizeof (buf))
+ if (TYPE_LENGTH (ptr_type) > sizeof (buf))
return;
len = target_read (&current_target, TARGET_OBJECT_DARWIN_DYLD_INFO, NULL,
- buf, 0, ptr_type->length);
+ buf, 0, TYPE_LENGTH (ptr_type));
if (len <= 0)
return;