From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17253 invoked by alias); 9 May 2012 16:08:46 -0000 Received: (qmail 17190 invoked by uid 22791); 9 May 2012 16:08:43 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,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; Wed, 09 May 2012 16:08:28 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q49G8BPG004955 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 9 May 2012 12:08:12 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q49FWofk018671 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 9 May 2012 11:32:51 -0400 From: Tom Tromey To: "Maciej W. Rozycki" Cc: Mark Kettenis , Joel Brobecker , Subject: Re: [RFA 1/2] mips: Switch inferior function calls to ON_STACK method. References: <20120503214933.GJ15555@adacore.com> <20120504205818.GT15555@adacore.com> <201205042118.q44LIh3p018153@glazunov.sibelius.xs4all.nl> <201205051144.q45Bitv4006357@glazunov.sibelius.xs4all.nl> <20120508160542.GB15555@adacore.com> <20120508204257.GC15555@adacore.com> <20120508220805.GD15555@adacore.com> <201205090823.q498Njc7019605@glazunov.sibelius.xs4all.nl> Date: Wed, 09 May 2012 16:08:00 -0000 In-Reply-To: (Maciej W. Rozycki's message of "Wed, 9 May 2012 10:14:12 +0100") Message-ID: <87k40ltlnh.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (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: 2012-05/txt/msg00280.txt.bz2 >>>>> "Maciej" == Maciej W Rozycki writes: Maciej> It would make sense IMHO though if GDB was capable to catch that Maciej> exception and report that the function returned with such rather than Maciej> normally (if it already does not, that is -- I don't deal with C++ or Maciej> other code using exceptions much, so I don't know). GDB tries, see "help show unwind-on-terminating-exception". The problem here is that gdb doesn't try to modify the unwind data when making an inferior call. So, if the inferior call reuses memory covered by the unwind data, then the unwinder will go ahead and try to use this data, resulting in weird behavior. It is probably possible to fix the problem other ways, but ON_STACK is pretty simple in comparison to modifying the unwind data or hooking into the unwinder. Tom