From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30489 invoked by alias); 9 Jun 2003 14:38:29 -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 30425 invoked from network); 9 Jun 2003 14:38:27 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.131) by sources.redhat.com with SMTP; 9 Jun 2003 14:38:27 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 4C1302B63; Mon, 9 Jun 2003 10:38:24 -0400 (EDT) Message-ID: <3EE49BE0.4070001@redhat.com> Date: Mon, 09 Jun 2003 14:38:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mark Kettenis Cc: gdb-patches@sources.redhat.com Subject: Re: [cagney_convert-20030606-branch] Add value to REGISTER_TO_VALUE et.al. References: <3EDE4A9E.70403@redhat.com> <8665nl34ao.fsf@elgar.kettenis.dyndns.org> <3EE0D987.6030207@redhat.com> <200306081643.h58GhiTr048427@elgar.kettenis.dyndns.org> <3EE36F28.9000104@redhat.com> <3EE3B455.7080902@redhat.com> <200306082250.h58Mow31022350@elgar.kettenis.dyndns.org> <3EE3D336.1080108@redhat.com> <200306090935.h599ZLbJ000452@elgar.kettenis.dyndns.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-06/txt/msg00299.txt.bz2 > Anyway, the question of what to do when the register's value can't be > found has been largely ignored. I'm thinking that throwing an error > would be a safer strategy - there is too much code ignoring register > fetches and I don't think we're going to be auditing it soon. > > Indeed, GDB depends on the frame unwinder always returning a value for > its registers. However for the sake of printing variables stored in > registers it seems that setting OPTIMIZED_OUT makes sense if we know > for certain that a the register has been thrashed. It makes > valprint.c:value_print() print "". The problem > with printing an error message from REGISTER_TO_VALUE() is keeping the > error messages uniform. However, in some cases it might be more > appropriate to print a warning instead of an error, for example if the > register hasn't been saved, but if we cannot tell whether it has been > thrashed yet. > > However, I can live with the current status quo. Well, the status quo is that GDB doesn't have a story :-( GDB throws an error for some values (memory read failures), returns bogus values for others (register not available), and sets optimized out for more. As a pie in the sky, would printing better messages help, vis: or or or What of the user interface, should it expect to be able to catch such errors? Andrew