This is the mail archive of the
mailing list for the GDB project.
[PATCH]: Tracking and reporting uninitialized variables
- From: Caroline Tice <ctice at apple dot com>
- To: gdb-patches at sourceware dot org
- Cc: Caroline Tice <ctice at apple dot com>
- Date: Tue, 1 May 2007 17:14:39 -0700
- Subject: [PATCH]: Tracking and reporting uninitialized variables
As part of some work I have been doing on improving debugging of
optimized code, I
have created a GCC patch that tags variables it believes are
uninitialized with a new
Dwarf op (an extension), DW_OP_GNU_uninit. I have submitted that
patch to the
GCC patches list and am waiting for approval to commit it. I have
also created the
following gdb patch to recognize the new op and inform the user when a
the user requests to see is uninitialized.
I have tested this patch on some small testcases and I have run the
testsuite with no regressions. I am new to submitting things to this
list, so if there
is anything else I ought to have done, please let me know (kindly!).
Is this patch okay to commit to gdb?
-- Caroline Tice
2007-05-01 Caroline Tice <email@example.com>
* c-valprint.c (c_value_print): If the var_status field of the
value struct is 0, print out "[uninitialized]" before the
* dwarf2expr.c (add_piece): Make function non-static.
(execute_stack_op): Initialize ctx->var_status field; allow
DW_OP_GNU_uninit as legal op following a DW_OP_reg op or a
DW_OP_regx op; add case for DW_OP_GNU_uninit and update
* dwarf2expr.h (struct dwarf_expr_context): New field,
(unsigned_address_type): Add extern declaration.
* dwarf2loc.c (dwarf2_evaluate_loc_desc): Add call to
* dwarf2read.c (dwarf_stack_op_name): Add case for
(decode_locdesc): Add case for DW_OP_GNU_uninit.
* value.c (struct value): New field, var_status.
(allocate_value): Initialize new field.
(set_var_status): New function.
(value_var_status): New function.
* value.h (value_var_status): New extern declaration.
* include/elf/dwarf2.h: (enum dwarf_location_atom): Add new
Description: Text document