aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2loc.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-07-12 21:16:48 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-07-12 21:16:48 +0000
commita7035dbbd10c5208e63cc3bc1b45f2dd8d16d7bb (patch)
tree9c200988328bc0af2cc5f23bb334b2414a80ae4d /gdb/dwarf2loc.c
parentd07ed419cf333c92f5b7376c2f97a899b7359161 (diff)
downloadgdb-a7035dbbd10c5208e63cc3bc1b45f2dd8d16d7bb.zip
gdb-a7035dbbd10c5208e63cc3bc1b45f2dd8d16d7bb.tar.gz
gdb-a7035dbbd10c5208e63cc3bc1b45f2dd8d16d7bb.tar.bz2
gdb/
Code cleanup making also optimized out values lazy. * dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Use allocate_optimized_out_value. Twice. (loclist_read_variable) Use allocate_optimized_out_value. Once. * findvar.c (read_var_value): Likewise. * value.c (allocate_optimized_out_value): New function. * value.h (allocate_optimized_out_value): New declaration.
Diffstat (limited to 'gdb/dwarf2loc.c')
-rw-r--r--gdb/dwarf2loc.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index baac1c6..101ce1c 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -1094,12 +1094,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
invalid_synthetic_pointer ();
if (size == 0)
- {
- retval = allocate_value (type);
- VALUE_LVAL (retval) = not_lval;
- set_value_optimized_out (retval, 1);
- return retval;
- }
+ return allocate_optimized_out_value (type);
baton.frame = frame;
baton.per_cu = per_cu;
@@ -1247,9 +1242,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
case DWARF_VALUE_OPTIMIZED_OUT:
do_cleanups (value_chain);
- retval = allocate_value (type);
- VALUE_LVAL (retval) = not_lval;
- set_value_optimized_out (retval, 1);
+ retval = allocate_optimized_out_value (type);
break;
/* DWARF_VALUE_IMPLICIT_POINTER was converted to a pieced
@@ -2829,11 +2822,7 @@ loclist_read_variable (struct symbol *symbol, struct frame_info *frame)
data = dwarf2_find_location_expression (dlbaton, &size, pc);
if (data == NULL)
- {
- val = allocate_value (SYMBOL_TYPE (symbol));
- VALUE_LVAL (val) = not_lval;
- set_value_optimized_out (val, 1);
- }
+ val = allocate_optimized_out_value (SYMBOL_TYPE (symbol));
else
val = dwarf2_evaluate_loc_desc (SYMBOL_TYPE (symbol), frame, data, size,
dlbaton->per_cu);