From 0e32bbcc674601f8a59109568a548692bbfa9e24 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Wed, 16 Nov 2005 22:09:52 +0000 Subject: [PATCH] * unwind-sjlj.c (_Unwind_GetCFA): Handle the builtin_setjmp case. From-SVN: r107102 --- gcc/ChangeLog | 4 ++++ gcc/unwind-sjlj.c | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5c3a1503386..9f35e986e38 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2005-11-16 Daniel Jacobowitz + + * unwind-sjlj.c (_Unwind_GetCFA): Handle the builtin_setjmp case. + 2005-11-16 Eric Botcazou * config/alpha/alpha.c (alpha_init_builtins): Use type_for_mode diff --git a/gcc/unwind-sjlj.c b/gcc/unwind-sjlj.c index d08602da9fc..9ea6d06c9a7 100644 --- a/gcc/unwind-sjlj.c +++ b/gcc/unwind-sjlj.c @@ -185,6 +185,18 @@ _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *context __attribute__((unused))) { /* ??? Ideally __builtin_setjmp places the CFA in the jmpbuf. */ + +#ifndef DONT_USE_BUILTIN_SETJMP + /* This is a crude imitation of the CFA: the saved stack pointer. + This is roughly the CFA of the frame before CONTEXT. When using the + DWARF-2 unwinder _Unwind_GetCFA returns the CFA of the frame described + by CONTEXT instead; but for DWARF-2 the cleanups associated with + CONTEXT have already been run, and for SJLJ they have not yet been. */ + if (context->fc != NULL) + return (_Unwind_Word) context->fc->jbuf[2]; +#endif + + /* Otherwise we're out of luck for now. */ return (_Unwind_Word) 0; }