From cb82636715e384dc5e75f3c1a4fd436626ba8dcd Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 21 May 2010 21:01:46 +0000 Subject: gdb * dwarf2loc.c (read_pieced_value): Exit loop when result is full. : New case. * dwarf2expr.h (enum dwarf_value_location) : New constant. * dwarf2expr.c (dwarf_expr_stack_empty_p): New function. (add_piece): Handle empty piece. (execute_stack_op) : Handle DWARF_VALUE_OPTIMIZED_OUT. gdb/testsuite * gdb.dwarf2/pieces.exp (pieces_test_f6): New proc. Call it. * gdb.dwarf2/pieces.c (struct C): New. (f6): New function. * gdb.dwarf2/pieces.S: Replace. --- gdb/dwarf2loc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gdb/dwarf2loc.c') diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index f40be6c..fee81a1 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -384,6 +384,16 @@ read_pieced_value (struct value *v) } break; + case DWARF_VALUE_OPTIMIZED_OUT: + /* We just leave the bits empty for now. This is not ideal + but gdb currently does not have a nice way to represent + optimized-out pieces. */ + warning (_("bytes %ld-%ld in computed object were optimized out; " + "replacing with zeroes"), + offset, + offset + (long) this_size); + break; + default: internal_error (__FILE__, __LINE__, _("invalid location type")); } @@ -609,6 +619,9 @@ dwarf2_evaluate_loc_desc (struct type *type, struct frame_info *frame, } break; + /* DWARF_VALUE_OPTIMIZED_OUT can't occur in this context -- + it can only be encountered when making a piece. */ + case DWARF_VALUE_OPTIMIZED_OUT: default: internal_error (__FILE__, __LINE__, _("invalid location type")); } -- cgit v1.1