From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23812 invoked by alias); 24 Jun 2010 11:33:12 -0000 Received: (qmail 23795 invoked by uid 22791); 24 Jun 2010 11:33:11 -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; Thu, 24 Jun 2010 11:33:06 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5OBX48Q016056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 24 Jun 2010 07:33:05 -0400 Received: from Phil-THINK.home (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5OBX3GS004245 for ; Thu, 24 Jun 2010 07:33:04 -0400 Message-ID: <4C23426F.4020502@redhat.com> Date: Thu, 24 Jun 2010 11:33:00 -0000 From: Phil Muldoon User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Thunderbird/3.0.4 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: [patch] PR python/11407 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/msg00519.txt.bz2 Hi, This patch is for PR 11407. It also cures the ills in Jan's test-case from last night: [patch 1/2] testsuite: dw2-ref-missing-frame cleanup http://sourceware.org/ml/gdb-patches/2010-06/msg00516.html [patch 2/2] testsuite: dw2-ref-missing-frame for PR python/11407 http://sourceware.org/ml/gdb-patches/2010-06/msg00515.html As the source between the Python issues and Jan's are similar, Jan's patch will form the test-case for this patch. There are many functions/commands in GDB that iterate over variables to produce output of one type or another. bt full, info locals, -stack-list-locals are just a few of many different sources that rely on this functionality. In the current GDB, if during this recursion an error is raised at any point from the request down (and some of these calls result in very deep calls stacks), the whole recursion is terminated (as the exception reached the top level). This is undesirable -- we should cope with the error and continue to recurse the other data. This patch fixes this issue in the last common denominator in each of the commands before they diverge. This patch catches the exception at the print level and prints a message with the exception message. Test on X8664 with no regressions. OK? Cheers, Phil Muldoon -- 2010-06-24 Phil Muldoon PR python/11407 * printcmd.c (print_variable_and_value): Print error message on caught exception. -- diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 430ccee..07abc2d 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -1944,15 +1944,21 @@ print_variable_and_value (const char *name, struct symbol *var, { struct value *val; struct value_print_options opts; + volatile struct gdb_exception except; if (!name) name = SYMBOL_PRINT_NAME (var); fprintf_filtered (stream, "%s%s = ", n_spaces (2 * indent), name); - - val = read_var_value (var, frame); - get_user_print_options (&opts); - common_val_print (val, stream, indent, &opts, current_language); + TRY_CATCH (except, RETURN_MASK_ERROR) + { + val = read_var_value (var, frame); + get_user_print_options (&opts); + common_val_print (val, stream, indent, &opts, current_language); + } + if (except.reason < 0) + fprintf_filtered(stream, "", name, + except.message); fprintf_filtered (stream, "\n"); }