From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16199 invoked by alias); 8 Dec 2010 01:20:15 -0000 Received: (qmail 16190 invoked by uid 22791); 8 Dec 2010 01:20:15 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from imr3.ericy.com (HELO imr3.ericy.com) (198.24.6.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 08 Dec 2010 01:20:00 +0000 Received: from eusaamw0712.eamcs.ericsson.se ([147.117.20.181]) by imr3.ericy.com (8.13.8/8.13.8) with ESMTP id oB81JmsU010339 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 7 Dec 2010 19:19:49 -0600 Received: from EUSAACMS0703.eamcs.ericsson.se ([169.254.1.63]) by eusaamw0712.eamcs.ericsson.se ([147.117.20.181]) with mapi; Tue, 7 Dec 2010 20:19:48 -0500 From: Marc Khouzam To: Tom Tromey CC: "'gdb-patches@sourceware.org'" Date: Wed, 08 Dec 2010 01:20:00 -0000 Subject: RE: [MI] Segfault using 'interpreter-exec mi' Message-ID: References: , In-Reply-To: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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-12/txt/msg00082.txt.bz2 From: Tom Tromey [tromey@redhat.com] >>>>> "Marc" =3D=3D Marc Khouzam writes: Marc> Thanks! Marc> I was stuck trying to use catch_exception(), which was not working Marc> because I needed the return value of mi_parse(), but I see that Marc> using TRY_CATCH was the way to go. > Yeah. For future reference, you can do that by having a trampoline > function that has different arguments. I find TRY_CATCH a lot simpler > though. >> + if (exception.reason < 0) >> + { >> + mi_print_exception (token, exception); >> + xfree (token); Marc> Here, do we need an call to Marc> mi_out_rewind (uiout)? Marc> I don't know what it does, but I noticed it was being Marc> called below after mi_print_exception() > It is unclear to me what mi_out_rewind does. > There don't seem to be any comments describing this function. >=20 > So, I chose to implement this in a way that is compatible with the > earlier code, which did not call mi_out_rewind on this path. Thanks Tom, I tried the patch and it does exactly what I was hoping for. I did notice one issue but it is not with your patch, but something I missed in the fix from http://sourceware.org/ml/gdb-patches/2010-12/msg00049.html I will post a fix for that in 2 minutes. Thanks again Marc