From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15751 invoked by alias); 4 Jan 2005 22:20:54 -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 15612 invoked from network); 4 Jan 2005 22:20:32 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 4 Jan 2005 22:20:32 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j04MKQtx031988 for ; Tue, 4 Jan 2005 17:20:26 -0500 Received: from localhost.redhat.com (vpn50-80.rdu.redhat.com [172.16.50.80]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j04MKQr11866; Tue, 4 Jan 2005 17:20:26 -0500 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id EBB1F7D79; Tue, 4 Jan 2005 17:20:13 -0500 (EST) Message-ID: <41DB169A.8040103@gnu.org> Date: Tue, 04 Jan 2005 22:20:00 -0000 From: Andrew Cagney User-Agent: Mozilla Thunderbird 0.8 (X11/20041020) MIME-Version: 1.0 To: Andreas Schwab Cc: gdb-patches@sources.redhat.com Subject: Re: Don't error out when variable not available References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-01/txt/msg00017.txt.bz2 Andreas Schwab wrote: > With the introduction of DWARF location lists it became impossible to get > the full list of local variables of a function when any of them is not > available. This is especially annoying when the first local or function > parameter is missing. Here is an attempt at correcting this. It is > suboptimal because it still prints the error message including the newline > which badly messes up the output. Any idea how to fix that properly? The code to catch these errors and print the message as part of the output has long been on my (and I suspect others) wish list. It should, in addition to solving your problem, mean that gdb handles the general case printing for instance: (gdb) print struct_s $1 = { a = , b = "hi" } (gdb) instead of $1 = { a = memory error (gdb) Have a look at catch_exceptions_with_msg. It was added to handle the problem of needing to catch the error message (you might need to wiggle the interface though). Adding more special case code, as was done with your other patch, isn't the way to go. Andrew > 2005-01-02 Andreas Schwab > > * findvar.c (read_var_value_no_error, read_var_value_no_error_1) > (struct read_var_value_args): New. > * value.h (read_var_value_no_error): Declare it. > * printcmd.c (print_variable_value): Use read_var_value_no_error. > * stack.c (print_frame_args): Likewise.