From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4377 invoked by alias); 25 Jun 2010 06:56:52 -0000 Received: (qmail 4368 invoked by uid 22791); 25 Jun 2010 06:56:51 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,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; Fri, 25 Jun 2010 06:56:47 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5P6ujB9009742 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 25 Jun 2010 02:56:45 -0400 Received: from Phil-THINK.home (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5P6uiw9001547; Fri, 25 Jun 2010 02:56:45 -0400 Message-ID: <4C24532C.3060705@redhat.com> Date: Fri, 25 Jun 2010 06:56:00 -0000 From: Phil Muldoon User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100621 Fedora/3.0.5-1.fc13 Thunderbird/3.0.5 MIME-Version: 1.0 To: tromey@redhat.com CC: gdb-patches@sourceware.org Subject: Re: [patch] PR python/11407 References: <4C23426F.4020502@redhat.com> <4C23D5CB.5040702@redhat.com> In-Reply-To: <4C23D5CB.5040702@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 2010-06/txt/msg00569.txt.bz2 On 06/24/2010 11:01 PM, Phil Muldoon wrote: > On 06/24/2010 07:10 PM, Tom Tromey wrote: >>>>>>> "Phil" == Phil Muldoon writes: >> >> Phil> This patch is for PR 11407. It also cures the ills in Jan's >> Phil> test-case from last night: >> >> Phil> 2010-06-24 Phil Muldoon >> Phil> PR python/11407 >> Phil> * printcmd.c (print_variable_and_value): Print error message on >> Phil> caught exception. >> >> This is ok with the changes Jan suggested. >> >> I think the MI commands -stack-list-variables and friends will need >> similar treatment. See mi-cmd-stack.c:list_args_or_locals. > > Sorry for missing this, I was running 'info locals' in the MI > interpreter. The MI -stack-list-locals case (as you noted) takes a > different direction from the CLI in printing these cases. > > WDYT? Oops in the last patch, I forgot to include ui_out_field_stream (uiout, "value", stb); in both cases. Here is a corrected patch: -- diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c index 6797055..e67d085 100644 --- a/gdb/mi/mi-cmd-stack.c +++ b/gdb/mi/mi-cmd-stack.c @@ -31,7 +31,7 @@ #include "gdb_string.h" #include "language.h" #include "valprint.h" - +#include "exceptions.h" enum what_to_list { locals, arguments, all }; @@ -335,26 +335,41 @@ list_args_or_locals (enum what_to_list what, int values, struct frame_info *fi) && TYPE_CODE (type) != TYPE_CODE_UNION) { struct value_print_options opts; - - val = read_var_value (sym2, fi); - get_raw_print_options (&opts); - opts.deref_ref = 1; - common_val_print - (val, stb->stream, 0, &opts, - language_def (SYMBOL_LANGUAGE (sym2))); + volatile struct gdb_exception except; + + TRY_CATCH (except, RETURN_MASK_ERROR) + { + + val = read_var_value (sym2, fi); + get_raw_print_options (&opts); + opts.deref_ref = 1; + common_val_print + (val, stb->stream, 0, &opts, + language_def (SYMBOL_LANGUAGE (sym2))); + } + if (except.reason < 0) + warning (_("")); + ui_out_field_stream (uiout, "value", stb); } break; case PRINT_ALL_VALUES: { struct value_print_options opts; - - val = read_var_value (sym2, fi); - get_raw_print_options (&opts); - opts.deref_ref = 1; - common_val_print - (val, stb->stream, 0, &opts, - language_def (SYMBOL_LANGUAGE (sym2))); + volatile struct gdb_exception except; + + TRY_CATCH (except, RETURN_MASK_ERROR) + { + val = read_var_value (sym2, fi); + get_raw_print_options (&opts); + opts.deref_ref = 1; + common_val_print + (val, stb->stream, 0, &opts, + language_def (SYMBOL_LANGUAGE (sym2))); + } + if (except.reason < 0) + warning (_("")); + ui_out_field_stream (uiout, "value", stb); } break;