From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29932 invoked by alias); 6 Sep 2003 21:34:16 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 29924 invoked from network); 6 Sep 2003 21:34:15 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 6 Sep 2003 21:34:15 -0000 Received: from drow by nevyn.them.org with local (Exim 4.22 #1 (Debian)) id 19vkgp-0000Ms-Si for ; Sat, 06 Sep 2003 17:33:51 -0400 Date: Sat, 06 Sep 2003 21:34:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: [rfa/6.0] Better handle unspecified CFI values Message-ID: <20030906213351.GA1101@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <3F593115.4030407@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F593115.4030407@redhat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-09/txt/msg00091.txt.bz2 On Fri, Sep 05, 2003 at 08:57:57PM -0400, Andrew Cagney wrote: > Hello, > > This patch is an attempt at improving GDB's behavior when GCC "treads > the boundaries of the CFI specification". > > It does the following: > > - changes the rules REG_UNMODIFIED -> REG_SAME_VALUE and REG_UNSAVED -> > REG_UNDEFINED so that they better match the corresponding CFI register > states (I could commit this separatly). The other names confused me :-) > > - it adds a new register rule - REG_UNSPECIFIED - which is used to > differentiate a register that is missing CFI info from a register that > CFI specified as "undefined" (nee UNSAVED). > > - when unwinding, it treats REG_UNSPECIFIED registers like > REG_SAME_VALUE but with the additional hack to map an unspecified > SP_REGNUM onto the CFA. > > - if it detects an unspecified CFI entry it complains > It isn't perfect though - since it doesn't know the full range of valid > debug info register numbers it can't check every entry. Instead it > checks the range provided by CFI for unspecified holes and then > complains about that. The reality is that GCC at least gets that bit > right (but consistently forgets the SP). > > I'd like to commit the patch as is for the 6.0 branch. For the mainline > though, I'd like to make the additional changes: > > - delete the SP_REGNUM hack from the REG_UNDEFINED rule (it's no longer > needed, I think) Leaving the hack in REG_UNSPECIFIED? Yes, I'm pretty sure you're right. > - add a check/complaint for the SP v CFA problem. Could you hold off on the complaint until there's a valid way to specify the SP in the unwind information? Right now there isn't one, as I described on the dwarf2 list three weeks ago. Otherwise this looks good to me. > @@ -611,7 +646,9 @@ > > switch (cache->reg[regnum].how) > { > - case REG_UNSAVED: > + case REG_UNDEFINED: > + /* If CFI explicitly specified that the value isn't defined, > + mark it as optomized away - the value isn't available. */ "optimized" -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer