diff options
Diffstat (limited to 'gdb/amd64-tdep.c')
-rw-r--r-- | gdb/amd64-tdep.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index 5424926..8c5b6cc 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -446,12 +446,10 @@ amd64_non_pod_p (struct type *type) static void amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2]) { - int len = TYPE_LENGTH (type); - /* 1. If the size of an object is larger than two eightbytes, or in C++, is a non-POD structure or union type, or contains unaligned fields, it has class memory. */ - if (len > 16 || amd64_non_pod_p (type)) + if (TYPE_LENGTH (type) > 16 || amd64_non_pod_p (type)) { class[0] = class[1] = AMD64_MEMORY; return; @@ -471,7 +469,7 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2]) /* All fields in an array have the same type. */ amd64_classify (subtype, class); - if (len > 8 && class[1] == AMD64_NO_CLASS) + if (TYPE_LENGTH (type) > 8 && class[1] == AMD64_NO_CLASS) class[1] = class[0]; } else @@ -839,10 +837,9 @@ amd64_push_arguments (struct regcache *regcache, int nargs, { struct type *type = value_type (stack_args[i]); const gdb_byte *valbuf = value_contents (stack_args[i]); - int len = TYPE_LENGTH (type); CORE_ADDR arg_addr = sp + element * 8; - write_memory (arg_addr, valbuf, len); + write_memory (arg_addr, valbuf, TYPE_LENGTH (type)); if (arg_addr_regno[i] >= 0) { /* We also need to store the address of that argument in @@ -853,7 +850,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, store_unsigned_integer (buf, 8, byte_order, arg_addr); regcache_cooked_write (regcache, arg_addr_regno[i], buf); } - element += ((len + 7) / 8); + element += ((TYPE_LENGTH (type) + 7) / 8); } /* The psABI says that "For calls that may call functions that use |