From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1687 invoked by alias); 24 Nov 2006 15:15:46 -0000 Received: (qmail 1643 invoked by uid 22791); 24 Nov 2006 15:15:45 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Fri, 24 Nov 2006 15:15:40 +0000 Received: from drow by nevyn.them.org with local (Exim 4.63) (envelope-from ) id 1GncmA-0003Kn-Dk for gdb@sourceware.org; Fri, 24 Nov 2006 10:15:38 -0500 Date: Fri, 24 Nov 2006 15:15:00 -0000 From: Daniel Jacobowitz To: gdb@sourceware.org Subject: Re: Variable values before initialisaton Message-ID: <20061124151537.GA12695@nevyn.them.org> Mail-Followup-To: gdb@sourceware.org References: <20061123195521.GA18110@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-11/txt/msg00167.txt.bz2 On Fri, Nov 24, 2006 at 09:52:52AM +0300, Vladimir Prus wrote: > Can you clarify? Certainly, each constructor invocation produces a finite > number of processor instruction. You can identify the "last" instruction of > those, and hack gcc to produce file last_instructions_of_ctors.txt and make > gdb read such file and do the right thing. You can have: - Initialize part A of structure - Read part A of structure - Initialize rest of structure You don't want GDB to be unable to display the structure at that read, do you? So you need to know which bits of it are initialized and which aren't. And, in some cases, you want to be able to debug a structure pointer after "new" returns some storage but before the constructor is invoked. I suppose this is doable though: a very interesting project for someone interested in learning about debug info formats and generation would be to annotate initializedness somehow. The compiler does know. But it wouldn't be easy. -- Daniel Jacobowitz CodeSourcery