From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4300 invoked by alias); 3 Jan 2005 13:41:30 -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 3140 invoked from network); 3 Jan 2005 13:40:39 -0000 Received: from unknown (HELO Cantor.suse.de) (195.135.220.2) by sourceware.org with SMTP; 3 Jan 2005 13:40:39 -0000 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 4513012C4A72 for ; Mon, 3 Jan 2005 14:40:39 +0100 (CET) To: gdb-patches@sources.redhat.com Subject: Re: Don't error out when variable not available References: <20050102225745.GA28488@nevyn.them.org> <20050103004937.GA30858@nevyn.them.org> From: Andreas Schwab X-Yow: Pardon me, but do you know what it means to be TRULY ONE with your BOOTH! Date: Mon, 03 Jan 2005 13:41:00 -0000 In-Reply-To: <20050103004937.GA30858@nevyn.them.org> (Daniel Jacobowitz's message of "Sun, 2 Jan 2005 19:49:37 -0500") Message-ID: User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2005-01/txt/msg00006.txt.bz2 How about this? Andreas. 2005-01-03 Andreas Schwab * stack.c (print_frame_args): Handle VALUE_OPTIMIZED_OUT. * dwarf2loc.c (loclist_read_variable): Return a value with VALUE_OPTIMIZED_OUT set instead of erring out when value not available. Index: dwarf2loc.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2loc.c,v retrieving revision 1.18 diff -u -a -p -r1.18 dwarf2loc.c --- dwarf2loc.c 9 Nov 2004 14:43:25 -0000 1.18 +++ dwarf2loc.c 3 Jan 2005 13:33:23 -0000 @@ -1,5 +1,5 @@ /* DWARF 2 location expression support for GDB. - Copyright 2003 Free Software Foundation, Inc. + Copyright 2003, 2005 Free Software Foundation, Inc. Contributed by Daniel Jacobowitz, MontaVista Software, Inc. This file is part of GDB. @@ -510,9 +510,14 @@ loclist_read_variable (struct symbol *sy data = find_location_expression (dlbaton, &size, frame ? get_frame_pc (frame) : 0); if (data == NULL) - error ("Variable \"%s\" is not available.", SYMBOL_NATURAL_NAME (symbol)); - - val = dwarf2_evaluate_loc_desc (symbol, frame, data, size, dlbaton->objfile); + { + val = allocate_value (SYMBOL_TYPE (symbol)); + VALUE_LVAL (val) = not_lval; + VALUE_OPTIMIZED_OUT (val) = 1; + } + else + val = dwarf2_evaluate_loc_desc (symbol, frame, data, size, + dlbaton->objfile); return val; } Index: stack.c =================================================================== RCS file: /cvs/src/src/gdb/stack.c,v retrieving revision 1.119 diff -u -a -p -r1.119 stack.c --- stack.c 12 Nov 2004 21:45:07 -0000 1.119 +++ stack.c 3 Jan 2005 13:33:56 -0000 @@ -1,7 +1,7 @@ /* Print and select stack frames for GDB, the GNU debugger. Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, - 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free + 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GDB. @@ -353,10 +353,15 @@ print_frame_args (struct symbol *func, s if (val) { - val_print (value_type (val), VALUE_CONTENTS (val), 0, - VALUE_ADDRESS (val), - stb->stream, 0, 0, 2, Val_no_prettyprint); - ui_out_field_stream (uiout, "value", stb); + if (VALUE_OPTIMIZED_OUT (val)) + ui_out_text (uiout, ""); + else + { + val_print (value_type (val), VALUE_CONTENTS (val), 0, + VALUE_ADDRESS (val), + stb->stream, 0, 0, 2, Val_no_prettyprint); + ui_out_field_stream (uiout, "value", stb); + } } else ui_out_text (uiout, "???"); -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."