From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31873 invoked by alias); 28 Feb 2011 15:53:47 -0000 Received: (qmail 31782 invoked by uid 22791); 28 Feb 2011 15:53:46 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 28 Feb 2011 15:53:37 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p1SFrS39000415 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 28 Feb 2011 10:53:28 -0500 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p1SFrQGV030502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 28 Feb 2011 10:53:28 -0500 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p1SFrQ9R031687; Mon, 28 Feb 2011 16:53:26 +0100 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id p1SFrPbb031683; Mon, 28 Feb 2011 16:53:25 +0100 Date: Mon, 28 Feb 2011 15:53:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [unavailable regs/locals, 01/11] registers status upwards Message-ID: <20110228155325.GB7881@host1.dyn.jankratochvil.net> References: <201102221327.51130.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201102221327.51130.pedro@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-02/txt/msg00904.txt.bz2 On Tue, 22 Feb 2011 14:27:50 +0100, Pedro Alves wrote: > Make the regcache_XXX_read_XXX functions return an indication > of whether the register's value is valid, so that the > frame module can mark frame registers as unavailable. The basic question on my mind is why instead of REG_UNAVAILABLE it does not throw NOT_AVAILABLE_ERROR? And if not NOT_AVAILABLE_ERROR then there should be __attribute__((warn_unused_result)) as if the caller is operating with not-available value - it is the case this patchset exactly tries to fix. In fact all the memsets (, 0, ) could be rather changed to debug-stub 0x55. Just __attribute__((warn_unused_result)) errors on too many cases which suggests more for the NOT_AVAILABLE_ERROR throw. The mail: graceful unwind termination when we'd need unavailable/uncollect memory or registers to unwind further is sure better but without this last mail it it printed: (gdb) bt #0 f () at 1.c:11 #1 0x0000000000000000 in ?? () and while I did not try I believe one could still find some case(s) where GDB will print 0. Currently even if one catches all the cases it is still fragile for future changes as the developers are not well aware of the `availability'. Thanks, Jan