From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22928 invoked by alias); 8 May 2007 16:26:43 -0000 Received: (qmail 22919 invoked by uid 22791); 8 May 2007 16:26:41 -0000 X-Spam-Check-By: sourceware.org Received: from mail-out3.apple.com (HELO mail-out3.apple.com) (17.254.13.22) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 08 May 2007 16:26:36 +0000 Received: from relay7.apple.com (relay7.apple.com [17.128.113.37]) by mail-out3.apple.com (Postfix) with ESMTP id 15085BEB27 for ; Tue, 8 May 2007 09:26:27 -0700 (PDT) Received: from relay7.apple.com (unknown [127.0.0.1]) by relay7.apple.com (Symantec Mail Security) with ESMTP id 9ABA0304B5; Tue, 8 May 2007 09:26:35 -0700 (PDT) X-AuditID: 11807125-a1a73bb00000318d-15-4640a4bbdc65 Received: from [17.201.21.120] (athena.apple.com [17.201.21.120]) by relay7.apple.com (Apple SCV relay) with ESMTP id 80B8F30066; Tue, 8 May 2007 09:26:35 -0700 (PDT) Cc: Caroline Tice Message-Id: <717BDA2E-D6FF-4AA5-B857-68BA5B140F5F@apple.com> From: Caroline Tice To: gdb-patches@sourceware.org In-Reply-To: <80EE31A6-4DF2-4D1F-B23D-8B814C1E6928@apple.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v880) Subject: Ping! [PATCH]: Tracking and reporting uninitialized variables Date: Tue, 08 May 2007 16:26:00 -0000 References: <80EE31A6-4DF2-4D1F-B23D-8B814C1E6928@apple.com> X-Mailer: Apple Mail (2.880) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-05/txt/msg00116.txt.bz2 On May 1, 2007, at 5:14 PM, Caroline Tice wrote: > > 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 variable > the user requests to see is uninitialized. > > I have tested this patch on some small testcases and I have run the > gdb dejagnu > 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 > ctice@apple.com > > > > 2007-05-01 Caroline Tice > > * c-valprint.c (c_value_print): If the var_status field of the > value struct is 0, print out "[uninitialized]" before the > value. > * dwarf2expr.c (add_piece): Make function non-static. > (unsigned_address_type): Likewise. > (signed_address_type): Likewise. > (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 > ctx->var_status appropriately. > * dwarf2expr.h (struct dwarf_expr_context): New field, > var_status. > (unsigned_address_type): Add extern declaration. > (signed_address_type): Likewise. > (add_piece): Likewise. > * dwarf2loc.c (dwarf2_evaluate_loc_desc): Add call to > set_var_status. > * dwarf2read.c (dwarf_stack_op_name): Add case for > DW_OP_GNU_uninit. > (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. > (set_var_status): Likewise. > * include/elf/dwarf2.h: (enum dwarf_location_atom): Add new > DW_OP, > DW_OP_GNU_uninit. > > >