diff options
author | Caroline Tice <cmtice@google.com> | 2007-05-18 19:42:42 +0000 |
---|---|---|
committer | Caroline Tice <cmtice@google.com> | 2007-05-18 19:42:42 +0000 |
commit | 42be36b328ae784ae6981da7c7cab95b67ed7737 (patch) | |
tree | 5b0a0ffb49db6fe2d5c149e62e5d84f2c9de39b7 /gdb/dwarf2expr.c | |
parent | a7c569c8f08b3485034e771a5e49cce0e23ca2b2 (diff) | |
download | gdb-42be36b328ae784ae6981da7c7cab95b67ed7737.zip gdb-42be36b328ae784ae6981da7c7cab95b67ed7737.tar.gz gdb-42be36b328ae784ae6981da7c7cab95b67ed7737.tar.bz2 |
Add ability to report when a variable's value is uninitialized,
based on information provided by the compiler. Also add new
DWARF OP, DW_OP_GNU_uninit, for this purpose.
Diffstat (limited to 'gdb/dwarf2expr.c')
-rw-r--r-- | gdb/dwarf2expr.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c index ad259f4..92d9e16 100644 --- a/gdb/dwarf2expr.c +++ b/gdb/dwarf2expr.c @@ -284,6 +284,7 @@ execute_stack_op (struct dwarf_expr_context *ctx, gdb_byte *op_ptr, gdb_byte *op_end) { ctx->in_reg = 0; + ctx->initialized = 1; /* Default is initialized. */ while (op_ptr < op_end) { @@ -410,7 +411,9 @@ execute_stack_op (struct dwarf_expr_context *ctx, case DW_OP_reg29: case DW_OP_reg30: case DW_OP_reg31: - if (op_ptr != op_end && *op_ptr != DW_OP_piece) + if (op_ptr != op_end + && *op_ptr != DW_OP_piece + && *op_ptr != DW_OP_GNU_uninit) error (_("DWARF-2 expression error: DW_OP_reg operations must be " "used either alone or in conjuction with DW_OP_piece.")); @@ -731,6 +734,14 @@ execute_stack_op (struct dwarf_expr_context *ctx, } goto no_push; + case DW_OP_GNU_uninit: + if (op_ptr != op_end) + error (_("DWARF-2 expression error: DW_OP_GNU_unint must always " + "be the very last op.")); + + ctx->initialized = 0; + goto no_push; + default: error (_("Unhandled dwarf expression opcode 0x%x"), op); } |