From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15058 invoked by alias); 9 Jun 2003 09:35:33 -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 14862 invoked from network); 9 Jun 2003 09:35:30 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (62.163.169.212) by sources.redhat.com with SMTP; 9 Jun 2003 09:35:30 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p2/8.12.5) with ESMTP id h599ZM6H000286; Mon, 9 Jun 2003 11:35:22 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p2/8.12.6) with ESMTP id h599ZMth000455; Mon, 9 Jun 2003 11:35:22 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p2/8.12.6/Submit) id h599ZLbJ000452; Mon, 9 Jun 2003 11:35:21 +0200 (CEST) Date: Mon, 09 Jun 2003 09:35:00 -0000 Message-Id: <200306090935.h599ZLbJ000452@elgar.kettenis.dyndns.org> From: Mark Kettenis To: ac131313@redhat.com CC: gdb-patches@sources.redhat.com In-reply-to: <3EE3D336.1080108@redhat.com> (message from Andrew Cagney on Sun, 08 Jun 2003 20:22:14 -0400) 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> X-SW-Source: 2003-06/txt/msg00294.txt.bz2 Date: Sun, 08 Jun 2003 20:22:14 -0400 From: Andrew Cagney > And what do these functions do if the register is unavailable in a > certain frame? That shouldn't happen if we have complete debug > information, but unfortunately we almost certainly don't have that. > Should this be reported to the user or not? Should we set > VALUE_OPTIMIZED_OUT, just as we do for registers that don't need > conversion? If so, we probably need a return value that indicates > whether the conversion was successfull. I've got into the habit of ignoring OPTIMIZED_OUT, for registers it's always cleared (well ignoring the recent CFI stuff). It was added between 3.5 and 3.93 but for no apparent reason (at least for registers). The ChangeLog's are not very enlightenting and this pre-dates Cygnus CVS. Well, most debugging info isn't expressive enough to indicate which registers have been saved, and which registers haven't. Therefore most unwinders pretend they can always find the register, and do so by returning the value from the next frame. 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. Mark