This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Share the dwarf2 unwind code between glibc and gcc 3.0
On Mon, Jul 09, 2001 at 05:07:14PM +0200, Mark Kettenis wrote:
>
> What we're talking about here is a more subtle issue of mixing plain C
> code compiled with -fexceptions with C++ code from another GCC
> version. Why would you compile plain C code with -fexceptions? Well,
> this is necessary if you have C code called from C++ that might in
> turn call C++ code that throws an exception. An example is qsort().
> qsort() calls a comparison function that you pass to it. Now if this
> comparison function is a C++ function that might throw an exception
> that is supposed to be caught by the C++ code that calls qsort(), then
> the exception handling code needs to unwind the stack. In order to do
> so, it needs some information which we usually refer to as "frame
> info". This frame info is generated by -fexceptions. For C++ code
> -fexceptions also generates information about the exception handlers
> that you defined (and about destructors). But that stuff isn't
> present in C code. New versions of GCC can handle the frame info from
> older GCC versions just fine, and they ignore the information about
> exception handlers generated by older GCC versions. So you can mix C
I am not sure if the current frame unwinder in gcc 3.0.1 can correctly
unwind the gcc v2 frames. Richard can verify it.
> code compiled with -fexceptions with C++ code from GCC 3.0. The other
> way around is tricky, and will in principle not work.
I think my patch should work. Basically, it puts the gcc v3 unwinder
in glibc with the gcc v2 frame support even if glibc is compiled with
gcc 2.95.
H.J.