From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32635 invoked by alias); 2 Sep 2005 09:28:04 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 32446 invoked by uid 22791); 2 Sep 2005 09:27:36 -0000 Received: from [220.225.32.98] (HELO calvin.codito.co.in) (220.225.32.98) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 02 Sep 2005 09:27:36 +0000 Received: from zirakzigil.codito.co.in (zirakzigil.codito.co.in [192.168.100.106]) by calvin.codito.co.in (8.13.2/8.13.2/Debian-1) with ESMTP id j829REYf010585; Fri, 2 Sep 2005 14:57:16 +0530 Subject: Re: "info locals" -- is variable initialized From: Ramana Radhakrishnan Reply-To: ramana.radhakrishnan@codito.com To: Vladimir Prus Cc: gdb@sources.redhat.com In-Reply-To: References: Content-Type: text/plain Date: Fri, 02 Sep 2005 09:28:00 -0000 Message-Id: <1125653235.9801.18.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SW-Source: 2005-09/txt/msg00011.txt.bz2 > > When entering this function, KDevelop asks gdb via "info locals" what locals > vars are there. But, gdb reports all variables, even though at the function > entry 'i2' is not initialized (or, from C++ point of view, not even visible > yet). For pretty priting 'i2', I have to evaluate 'i2.prettyURL(0)', which > will just crash. I can use "set unwindonsignal on", but generally, calling > methods on uninitialized object can damage random memory. GDB puts a breakpoint after the prologue of a function. Which means that all locals in scope have been created / allocated space for . Hence you would see i2 , right ? cheers Ramana