aboutsummaryrefslogtreecommitdiff
path: root/gdb/amd64-tdep.c
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@sourceware.org>2012-09-25 12:48:53 +0000
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2012-09-25 12:48:53 +0000
commit744a80590447619c1c58d7d6a6e780ae6bd29777 (patch)
treeb491fe31aed31cb5602ebc51515298738489312f /gdb/amd64-tdep.c
parenta4b411d69d3bb453546f1120664377057da8a444 (diff)
downloadfsf-binutils-gdb-744a80590447619c1c58d7d6a6e780ae6bd29777.zip
fsf-binutils-gdb-744a80590447619c1c58d7d6a6e780ae6bd29777.tar.gz
fsf-binutils-gdb-744a80590447619c1c58d7d6a6e780ae6bd29777.tar.bz2
* ada-valprint.c (ada_val_print_1): Eliminate single-use
variable LEN. * alpha-tdep.c (alpha_extract_return_value): Use TYPE_LENGTH directly. (alpha_store_return_value): Likewise. * amd64-tdep.c (amd64_classify_aggregate): Likewise. (amd64_push_arguments): Likewise. * ax-gdb.c (gen_trace_static_fields): Likewise. (gen_traced_pop): Likewise. * bfin-tdep.c (bfin_push_dummy_call): Likewise. * breakpoint.c (update_watchpoint): Likewise. * findcmd.c (parse_find_args): Use local variable for type instead of length. * findvar.c (default_read_var_value): Use TYPE_LENGTH directly. * h8300-tdep.c (h8300h_extract_return_value): Likewise. (h8300_store_return_value): Likewise. * i386-darwin-tdep.c (i386_darwin_push_dummy_call): Likewise. Use i386_darwin_arg_type_alignment directly. * infcall.c (call_function_by_hand): Use TYPE_LENGTH directly. * lm32-tdep.c (lm32_push_dummy_call): Likewise. * m68hc11-tdep.c (m68hc11_push_dummy_call): Likewise. (m68hc11_extract_return_value): Likewise. * mep-tdep.c (mep_push_dummy_call): Likewise. * printcmd.c (float_type_from_length): Likewise. * s390-tdep.c (s390_value_from_register): Likewise. * stack.c (read_frame_arg): Likewise. * tracepoint.c (encode_actions_1): Likewise. * valops.c (value_fetch_lazy): Use local variable for type instead of length. Use TYPE_LENGTH directly. * value.c (value_contents_equal): Use TYPE_LENGTH directly.
Diffstat (limited to 'gdb/amd64-tdep.c')
-rw-r--r--gdb/amd64-tdep.c11
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