From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13430 invoked by alias); 24 Nov 2004 07:52:52 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 13224 invoked from network); 24 Nov 2004 07:52:38 -0000 Received: from unknown (HELO smtp1.clear.net.nz) (203.97.33.27) by sourceware.org with SMTP; 24 Nov 2004 07:52:38 -0000 Received: from DANNY (218-101-109-229.dialup.clear.net.nz [218.101.109.229]) by smtp1.clear.net.nz (CLEAR Net Mail) with SMTP id <0I7O00JYQB72BM@smtp1.clear.net.nz> for gcc@gcc.gnu.org; Wed, 24 Nov 2004 20:52:16 +1300 (NZDT) Date: Wed, 24 Nov 2004 08:08:00 -0000 From: Danny Smith Subject: Re: stdcall lib functions with exception throwing callbacks vs Dwarf2 EH To: Richard Henderson Cc: gcc@gcc.gnu.org, Cygwin , mingw-dvlpr Reply-to: Danny Smith Message-id: <000c01c4d1fa$3f297fd0$e56d65da@DANNY> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7bit References: <001701c4d1ab$949322e0$0a6d65da@DANNY> <20041124003240.GA6028@redhat.com> X-SW-Source: 2004-11/txt/msg00881.txt.bz2 Richard Henderson wrote: > On Wed, Nov 24, 2004 at 11:27:11AM +1300, Danny Smith wrote: >> Before I pull any more hair out trying, does any one have any hints >> on how to use an MD_FALLBACK_FRAME_STATE_FOR to workaround ... > > That would be wrong. > > I think the most likely explanation is that there's a bug in the > dwarf2 generator for stdcall functions with -fomit-frame-pointer, > and the problem should be attacked there. > > If you've got a call that takes 12 bytes of arguments on the stack > and pop them on return, then the unwind info should look like > > # DW_CFA_GNU_args_size 12 > call foo > # DW_CFA_def_cfa_offset > > Umm, actually I don't think it is stdcall thing at all. When I reran the testcase after doing other things both the cdecl and stdcall functions resulted in uncaught exceptions, I can't explain the success with cdecl in my earlier report, Sorry for the noise. If I compile the callback-using library code with -fexceptions using a DW2 enabled compiler, then both calling conventions work, as expected. So is it a general requirements of DW2 EH that functions that are passed callbacks as args be compiled with -fexceptions, if the callbacks may throw? I don't see how else they could work Danny > r~