Re: stdcall lib functions with exception throwing callbacks vs Dwarf2 EH

2004-11-24 Thread Richard Henderson
On Wed, Nov 24, 2004 at 01:59:46PM -0500, Andrew Pinski wrote: > Could this be related to PR 17220? I wouldn't think so. My patch *should* only have any affect when stdcall functions are involved. (Well, that's not quite true -- the output may be a bit more compact, since I reduced the number of

Re: stdcall lib functions with exception throwing callbacks vs Dwarf2 EH

2004-11-24 Thread Andrew Pinski
On Nov 24, 2004, at 1:44 PM, Richard Henderson wrote: I reproduced this specific failure on linux, and the following seems to fix the problem. Can you give it a go with whatever more complex test case you have? Could this be related to PR 17220? Thanks, Andrew Pinski -- Unsubscribe info: http

Re: stdcall lib functions with exception throwing callbacks vs Dwarf2 EH

2004-11-24 Thread Richard Henderson
I reproduced this specific failure on linux, and the following seems to fix the problem. Can you give it a go with whatever more complex test case you have? r~ * dwarf2out.c (dwarf2out_stack_adjust): Add after_p argument. Save args_size adjustments for calls even with cfa as s

Re: stdcall lib functions with exception throwing callbacks vs Dwarf2 EH

2004-11-24 Thread Andrew Haley
Richard Henderson writes: > On Wed, Nov 24, 2004 at 02:51:35AM -0600, Aaron W. LaFramboise wrote: > > Is there a way to have the DW2 unwinder call some particular function, > > for eg, if the previous frame was not compiled with -fexceptions, rather > > than just crashing? Is this what MD_FALL

Re: stdcall lib functions with exception throwing callbacks vs Dwarf2 EH

2004-11-24 Thread Richard Henderson
On Wed, Nov 24, 2004 at 02:51:35AM -0600, Aaron W. LaFramboise wrote: > Is there a way to have the DW2 unwinder call some particular function, > for eg, if the previous frame was not compiled with -fexceptions, rather > than just crashing? Is this what MD_FALLBACK_FRAME_STATE_FOR is for? Yes, sor

Re: stdcall lib functions with exception throwing callbacks vs Dwarf2 EH

2004-11-24 Thread Aaron W. LaFramboise
Richard Henderson wrote: > On Wed, Nov 24, 2004 at 08:50:17PM +1300, Danny Smith wrote: > >>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? > > Yes. Thus glibc compiles e.g. qsort and bse

Re: stdcall lib functions with exception throwing callbacks vs Dwarf2 EH

2004-11-24 Thread Danny Smith
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 t

Re: stdcall lib functions with exception throwing callbacks vs Dwarf2 EH

2004-11-24 Thread Richard Henderson
On Wed, Nov 24, 2004 at 08:50:17PM +1300, Danny Smith wrote: > 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? Yes. Thus glibc compiles e.g. qsort and bsearch with -fexceptions. r~ -- Un

Re: stdcall lib functions with exception throwing callbacks vs Dwarf2 EH

2004-11-23 Thread Danny Smith
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 t

Re: stdcall lib functions with exception throwing callbacks vs Dwarf2 EH

2004-11-23 Thread Ranjit Mathew
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

Re: stdcall lib functions with exception throwing callbacks vs Dwarf2 EH

2004-11-23 Thread Christopher Faylor
On Tue, Nov 23, 2004 at 09:22:34PM -0600, Aaron W. LaFramboise wrote: >Do any Windows system routines have any function local cleanup that >they'd need to do registered with SEH, or are they OK with suddenly >being zapped out of existance at user code call points? If cygwin's signal handling code

Re: stdcall lib functions with exception throwing callbacks vs Dwarf2 EH

2004-11-23 Thread Aaron W. LaFramboise
Danny Smith wrote: > If a C library function that takes a callback arg is compiled > using stdcall convention, C++ exception thrown by the callback > result in abort. Just to speculate while not asking anyone to implement anything, would there be any value in implementing special behavior when th

Re: stdcall lib functions with exception throwing callbacks vs Dwarf2 EH

2004-11-23 Thread Richard Henderson
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 generato

stdcall lib functions with exception throwing callbacks vs Dwarf2 EH

2004-11-23 Thread Danny Smith
Hi, I've been trying to get DW2 EH exception handling working on windows targets with general success, but have hit a snag. If a C library function that takes a callback arg is compiled using stdcall convention, C++ exception thrown by the callback result in abort. If the C libarary function use