From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6269 invoked by alias); 20 Jun 2010 06:58:28 -0000 Received: (qmail 6261 invoked by uid 22791); 20 Jun 2010 06:58:27 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,TW_DB,TW_SM X-Spam-Check-By: sourceware.org Received: from mail-pw0-f47.google.com (HELO mail-pw0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 20 Jun 2010 06:58:22 +0000 Received: by pwi8 with SMTP id 8so1037272pwi.20 for ; Sat, 19 Jun 2010 23:58:21 -0700 (PDT) Received: by 10.115.115.9 with SMTP id s9mr2592738wam.66.1277017100997; Sat, 19 Jun 2010 23:58:20 -0700 (PDT) Received: from [172.16.151.67] ([60.12.143.4]) by mx.google.com with ESMTPS id a23sm133023466wam.2.2010.06.19.23.58.16 (version=SSLv3 cipher=RC4-MD5); Sat, 19 Jun 2010 23:58:20 -0700 (PDT) Message-ID: <4C1DBC21.1070204@gmail.com> Date: Sun, 20 Jun 2010 12:55:00 -0000 From: asmwarrior User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: Ian Lance Taylor CC: gcc@gcc.gnu.org Subject: Re: Can GCC emit debug information to support debug uninitialized local variables References: <4C1C49DC.8020808@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2010-06/txt/msg00636.txt.bz2 On 2010-6-20 14:18, Ian Lance Taylor wrote: > asmwarrior writes: > >> My question is: Is there any possible that GCC can emit some debug >> information to indicate that one variable is initialed or not.(at >> least in the DEBUG build mode) >> > You didn't mention which version of gcc you are testing. With current > gcc see if the -fvar-tracking option helps. > > Ian > Thanks for your time and help. I'm currently using two versions of GCC under Windows. (MinGW GCC 4.4.4 and MinGW GCC 4.5). The gdb I built was (gdb cvs 20100613 and gdb cvs 20100618, both with python support), but both of the gdb will get crash when I run the "info locals" command. I'm not sure I have catch the core idea about my question, because I found an old post here: http://gcc.gnu.org/ml/gcc/2007-04/msg00138.html ,there, you suggest add the DW_AT_start_scope somewhere. As you said, if I add the "-fvar-tracking" option, there will have debug information included. Then, GDB can use this information to avoid to print the uninitialized local variables? Thanks. Asmwarrior ollydbg from codeblocks' forum.