From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23728 invoked by alias); 24 Nov 2006 06:53:35 -0000 Received: (qmail 23720 invoked by uid 22791); 24 Nov 2006 06:53:34 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 24 Nov 2006 06:53:28 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GnUvz-0002oq-83 for gdb@sources.redhat.com; Fri, 24 Nov 2006 07:53:15 +0100 Received: from 73-198.umostel.ru ([82.179.73.198]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 Nov 2006 07:53:15 +0100 Received: from ghost by 73-198.umostel.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 Nov 2006 07:53:15 +0100 To: gdb@sources.redhat.com From: Vladimir Prus Subject: Re: Variable values before initialisaton Date: Fri, 24 Nov 2006 06:53:00 -0000 Message-ID: References: <20061123195521.GA18110@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.10.2 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/msg00165.txt.bz2 Daniel Jacobowitz wrote: > On Thu, Nov 23, 2006 at 05:32:39PM +0000, Rob Quill wrote: >> How could I go about looking into a fix? I wouldn't really know where >> to start, but it is quite annoying for what am trying to do. > > You have to emit proper debug info from the compiler. It's the only > thing that knows. However, for things where initialization is > complicated (like classes), there's basically no way to get it right. 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. Now getting this work in nice way can be a lot of work, but where does "no way to get it right" comes from? The only serious complexity I can imagine is that if body of ctor is duplicated along two execution paths. I doubt this happens regularly, at least at -O0. - Volodya