diff options
author | Daniel Jacobowitz <dan@codesourcery.com> | 2005-11-16 22:09:52 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@gcc.gnu.org> | 2005-11-16 22:09:52 +0000 |
commit | 0e32bbcc674601f8a59109568a548692bbfa9e24 (patch) | |
tree | 9b560384f7981dc682a54d1711274eb0c0f4631f /gcc/unwind-sjlj.c | |
parent | 6276e725b276838be6383f941bec392e182d63b0 (diff) | |
download | gcc-0e32bbcc674601f8a59109568a548692bbfa9e24.zip gcc-0e32bbcc674601f8a59109568a548692bbfa9e24.tar.gz gcc-0e32bbcc674601f8a59109568a548692bbfa9e24.tar.bz2 |
* unwind-sjlj.c (_Unwind_GetCFA): Handle the builtin_setjmp case.
From-SVN: r107102
Diffstat (limited to 'gcc/unwind-sjlj.c')
-rw-r--r-- | gcc/unwind-sjlj.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/unwind-sjlj.c b/gcc/unwind-sjlj.c index d08602d..9ea6d06 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; } |