aboutsummaryrefslogtreecommitdiff
path: root/gdb/ax-gdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ax-gdb.c')
-rw-r--r--gdb/ax-gdb.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index f2c5155..9cb8fe9 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -367,9 +367,9 @@ gen_trace_static_fields (struct gdbarch *gdbarch,
{
case axs_lvalue_memory:
{
- int length = TYPE_LENGTH (check_typedef (value.type));
-
- ax_const_l (ax, length);
+ /* Initialize the TYPE_LENGTH if it is a typedef. */
+ check_typedef (value.type);
+ ax_const_l (ax, TYPE_LENGTH (value.type));
ax_simple (ax, aop_trace);
}
break;
@@ -425,17 +425,18 @@ gen_traced_pop (struct gdbarch *gdbarch,
case axs_lvalue_memory:
{
- int length = TYPE_LENGTH (check_typedef (value->type));
-
if (string_trace)
ax_simple (ax, aop_dup);
+ /* Initialize the TYPE_LENGTH if it is a typedef. */
+ check_typedef (value->type);
+
/* There's no point in trying to use a trace_quick bytecode
here, since "trace_quick SIZE pop" is three bytes, whereas
"const8 SIZE trace" is also three bytes, does the same
thing, and the simplest code which generates that will also
work correctly for objects with large sizes. */
- ax_const_l (ax, length);
+ ax_const_l (ax, TYPE_LENGTH (value->type));
ax_simple (ax, aop_trace);
if (string_trace)