This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: _Unwind_FindEnclosingFunction vs darwin


On Fri, Dec 18, 2009 at 03:01:08PM +0000, Andrew Haley wrote:
> 
> _Unwind_Find_FDE is a standard function.  Does Darwin support that?
> 

Andrew,
    I believe we do have _Unwind_Find_FDE on darwin10 but it
is only functional if compact unwind information isn't used.
This is currently the case in gcc trunk since I disabled
the darwin10 linker's default of using compact unwind info
to avoid issues with the new epilog unwind info on the
darwin10 linker.
     Shouldn't we be able to add something like...

 void *
 darwin10_Unwind_FindEnclosingFunction (void *pc)
 {
   struct dwarf_eh_bases bases;
   const struct dwarf_fde *fde = _Unwind_Find_FDE (pc-1, &bases);
   if (fde)
     return bases.func;
   else
     return NULL;
 }

and use...

#undefine _Unwind_FindEnclosingFunction(PC) 
#define _Unwind_FindEnclosingFunction(PC) darwin10_Unwind_FindEnclosingFunction(PC)

to avoid the system _Unwind_FindEnclosingFunction() on darwin10?
I assume that darwin10_Unwind_FindEnclosingFunction code would have to go into
libjava/darwin.cc. However, I am unclear where to place...

#undefine _Unwind_FindEnclosingFunction(PC) 
#define _Unwind_FindEnclosingFunction(PC) darwin10_Unwind_FindEnclosingFunction(PC)

The most logical place would be in gcc/config/darwin10.h but I am uncertain if
this would be parsed for when libjava compiles libjava/gnu/classpath/natVMStackWalker.cc
so that the call to _Unwind_FindEnclosingFunction() is redirected to
darwin10_Unwind_FindEnclosingFunction(). Any advice would be welcome.
             Jack


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]