From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19584 invoked by alias); 18 Jan 2013 17:34:30 -0000 Received: (qmail 19520 invoked by uid 22791); 18 Jan 2013 17:34:28 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_EG 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, 18 Jan 2013 17:34:18 +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.14.4/8.14.4) with ESMTP id r0IHYEwN005435 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 18 Jan 2013 12:34:15 -0500 Received: from barimba (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 r0IHYDrv008813 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 18 Jan 2013 12:34:13 -0500 From: Tom Tromey To: "Pierre Muller" Cc: Subject: Re: catch SIGSEGV in the demangler References: <87fw23o70u.fsf@fleche.redhat.com> <19236.9665638127$1358374641@news.gmane.org> <87622vd2vd.fsf@fleche.redhat.com> Date: Fri, 18 Jan 2013 17:34:00 -0000 In-Reply-To: <87622vd2vd.fsf@fleche.redhat.com> (Tom Tromey's message of "Thu, 17 Jan 2013 12:29:58 -0700") Message-ID: <87zk0675uy.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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: 2013-01/txt/msg00443.txt.bz2 >>>>> "Tom" == Tom Tromey writes: Tom> I was thinking of perhaps expanding the scope somewhat. Tom> One idea I had was to introduce a new RETURN_SEGV to return_reason and Tom> *not* add this to RETURN_MASK_ALL. Tom> Then, have a special throw_segv that first looks to see if anything Tom> expects to catch it, and if not, reset the handler and re-raise the Tom> signal. Tom> This way we could let code handle SEGV when appropriate, without tying Tom> it to the demangler -- but also without catching all SEGVs that occur in Tom> gdb. I implemented this and I think it reads a bit better. Now any code that knows what to do with a SEGV can TRY_CATCH (except, RETURN_MASK_SEGV) { ... } ... but if nothing on the call stack does this, SEGVs are just allowed to cause gdb to crash. Tom