2001-03-28 13:04:51 +02:00
|
|
|
/* Exception handling and frame unwind runtime interface routines.
|
2018-01-03 11:03:58 +01:00
|
|
|
Copyright (C) 2001-2018 Free Software Foundation, Inc.
|
2001-03-28 13:04:51 +02:00
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
This file is part of GCC.
|
2001-03-28 13:04:51 +02:00
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
GCC is free software; you can redistribute it and/or modify it
|
|
|
|
under the terms of the GNU General Public License as published by
|
2009-04-09 17:00:19 +02:00
|
|
|
the Free Software Foundation; either version 3, or (at your option)
|
2001-03-28 13:04:51 +02:00
|
|
|
any later version.
|
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
|
|
|
License for more details.
|
2001-03-28 13:04:51 +02:00
|
|
|
|
2009-04-09 17:00:19 +02:00
|
|
|
Under Section 7 of GPL version 3, you are granted additional
|
|
|
|
permissions described in the GCC Runtime Library Exception, version
|
|
|
|
3.1, as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License and
|
|
|
|
a copy of the GCC Runtime Library Exception along with this program;
|
|
|
|
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
2003-03-05 14:04:30 +01:00
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
/* This is derived from the C++ ABI for IA-64. Where we diverge
|
|
|
|
for cross-architecture compatibility are noted with "@@@". */
|
|
|
|
|
2004-01-08 08:50:46 +01:00
|
|
|
#ifndef _UNWIND_H
|
|
|
|
#define _UNWIND_H
|
|
|
|
|
2012-11-29 10:36:41 +01:00
|
|
|
#if defined (__SEH__) && !defined (__USING_SJLJ_EXCEPTIONS__)
|
2012-07-19 09:29:24 +02:00
|
|
|
/* Only for _GCC_specific_handler. */
|
|
|
|
#include <windows.h>
|
|
|
|
#endif
|
|
|
|
|
2004-11-30 09:15:42 +01:00
|
|
|
#ifndef HIDE_EXPORTS
|
2004-08-03 18:57:40 +02:00
|
|
|
#pragma GCC visibility push(default)
|
2004-11-30 09:15:42 +01:00
|
|
|
#endif
|
2004-08-03 18:57:40 +02:00
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Level 1: Base ABI */
|
|
|
|
|
|
|
|
/* @@@ The IA-64 ABI uses uint64 throughout. Most places this is
|
|
|
|
inefficient for 32-bit and smaller machines. */
|
2008-06-18 22:49:12 +02:00
|
|
|
typedef unsigned _Unwind_Word __attribute__((__mode__(__unwind_word__)));
|
|
|
|
typedef signed _Unwind_Sword __attribute__((__mode__(__unwind_word__)));
|
2002-08-15 20:01:30 +02:00
|
|
|
#if defined(__ia64__) && defined(__hpux__)
|
|
|
|
typedef unsigned _Unwind_Ptr __attribute__((__mode__(__word__)));
|
|
|
|
#else
|
2001-03-28 13:04:51 +02:00
|
|
|
typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__)));
|
2002-08-15 20:01:30 +02:00
|
|
|
#endif
|
|
|
|
typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__)));
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
/* @@@ The IA-64 ABI uses a 64-bit word to identify the producer and
|
|
|
|
consumer of an exception. We'll go along with this for now even on
|
|
|
|
32-bit machines. We'll need to provide some other option for
|
|
|
|
16-bit machines and for machines with > 8 bits per byte. */
|
|
|
|
typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__)));
|
|
|
|
|
|
|
|
/* The unwind interface uses reason codes in several contexts to
|
|
|
|
identify the reasons for failures or other actions. */
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
_URC_NO_REASON = 0,
|
|
|
|
_URC_FOREIGN_EXCEPTION_CAUGHT = 1,
|
|
|
|
_URC_FATAL_PHASE2_ERROR = 2,
|
|
|
|
_URC_FATAL_PHASE1_ERROR = 3,
|
|
|
|
_URC_NORMAL_STOP = 4,
|
|
|
|
_URC_END_OF_STACK = 5,
|
|
|
|
_URC_HANDLER_FOUND = 6,
|
|
|
|
_URC_INSTALL_CONTEXT = 7,
|
|
|
|
_URC_CONTINUE_UNWIND = 8
|
|
|
|
} _Unwind_Reason_Code;
|
|
|
|
|
|
|
|
|
|
|
|
/* The unwind interface uses a pointer to an exception header object
|
|
|
|
as its representation of an exception being thrown. In general, the
|
|
|
|
full representation of an exception object is language- and
|
|
|
|
implementation-specific, but it will be prefixed by a header
|
|
|
|
understood by the unwind interface. */
|
|
|
|
|
|
|
|
struct _Unwind_Exception;
|
|
|
|
|
|
|
|
typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
|
|
|
|
struct _Unwind_Exception *);
|
|
|
|
|
|
|
|
struct _Unwind_Exception
|
|
|
|
{
|
|
|
|
_Unwind_Exception_Class exception_class;
|
|
|
|
_Unwind_Exception_Cleanup_Fn exception_cleanup;
|
2012-07-19 09:29:24 +02:00
|
|
|
|
|
|
|
#if !defined (__USING_SJLJ_EXCEPTIONS__) && defined (__SEH__)
|
|
|
|
_Unwind_Word private_[6];
|
|
|
|
#else
|
2001-03-28 13:04:51 +02:00
|
|
|
_Unwind_Word private_1;
|
|
|
|
_Unwind_Word private_2;
|
2012-07-19 09:29:24 +02:00
|
|
|
#endif
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
/* @@@ The IA-64 ABI says that this structure must be double-word aligned.
|
|
|
|
Taking that literally does not make much sense generically. Instead we
|
|
|
|
provide the maximum alignment required by any type for the machine. */
|
|
|
|
} __attribute__((__aligned__));
|
|
|
|
|
|
|
|
|
|
|
|
/* The ACTIONS argument to the personality routine is a bitwise OR of one
|
|
|
|
or more of the following constants. */
|
|
|
|
typedef int _Unwind_Action;
|
|
|
|
|
|
|
|
#define _UA_SEARCH_PHASE 1
|
|
|
|
#define _UA_CLEANUP_PHASE 2
|
|
|
|
#define _UA_HANDLER_FRAME 4
|
|
|
|
#define _UA_FORCE_UNWIND 8
|
2001-09-04 20:20:21 +02:00
|
|
|
#define _UA_END_OF_STACK 16
|
2001-03-28 13:04:51 +02:00
|
|
|
|
2007-09-14 20:35:12 +02:00
|
|
|
/* The target can override this macro to define any back-end-specific
|
|
|
|
attributes required for the lowest-level stack frame. */
|
|
|
|
#ifndef LIBGCC2_UNWIND_ATTRIBUTE
|
|
|
|
#define LIBGCC2_UNWIND_ATTRIBUTE
|
|
|
|
#endif
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
/* This is an opaque type used to refer to a system-specific data
|
|
|
|
structure used by the system unwinder. This context is created and
|
|
|
|
destroyed by the system, and passed to the personality routine
|
|
|
|
during unwinding. */
|
|
|
|
struct _Unwind_Context;
|
|
|
|
|
|
|
|
/* Raise an exception, passing along the given exception object. */
|
2007-09-14 20:35:12 +02:00
|
|
|
extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
|
|
|
|
_Unwind_RaiseException (struct _Unwind_Exception *);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
/* Raise an exception for forced unwinding. */
|
|
|
|
|
|
|
|
typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
|
|
|
|
(int, _Unwind_Action, _Unwind_Exception_Class,
|
|
|
|
struct _Unwind_Exception *, struct _Unwind_Context *, void *);
|
|
|
|
|
2007-09-14 20:35:12 +02:00
|
|
|
extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
|
|
|
|
_Unwind_ForcedUnwind (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
/* Helper to invoke the exception_cleanup routine. */
|
|
|
|
extern void _Unwind_DeleteException (struct _Unwind_Exception *);
|
|
|
|
|
|
|
|
/* Resume propagation of an existing exception. This is used after
|
|
|
|
e.g. executing cleanup code, and not to implement rethrowing. */
|
2007-09-14 20:35:12 +02:00
|
|
|
extern void LIBGCC2_UNWIND_ATTRIBUTE
|
|
|
|
_Unwind_Resume (struct _Unwind_Exception *);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
2007-11-26 03:25:50 +01:00
|
|
|
/* @@@ Resume propagation of a FORCE_UNWIND exception, or to rethrow
|
2003-05-08 00:11:38 +02:00
|
|
|
a normal exception that was handled. */
|
2007-09-14 20:35:12 +02:00
|
|
|
extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
|
|
|
|
_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *);
|
2003-05-08 00:11:38 +02:00
|
|
|
|
2003-04-15 18:24:18 +02:00
|
|
|
/* @@@ Use unwind data to perform a stack backtrace. The trace callback
|
|
|
|
is called for every stack frame in the call chain, but no cleanup
|
|
|
|
actions are performed. */
|
|
|
|
typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)
|
|
|
|
(struct _Unwind_Context *, void *);
|
|
|
|
|
2007-09-14 20:35:12 +02:00
|
|
|
extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
|
|
|
|
_Unwind_Backtrace (_Unwind_Trace_Fn, void *);
|
2003-04-15 18:24:18 +02:00
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
/* These functions are used for communicating information about the unwind
|
|
|
|
context (i.e. the unwind descriptors and the user register state) between
|
|
|
|
the unwind library and the personality routine and landing pad. Only
|
2007-11-26 03:25:50 +01:00
|
|
|
selected registers may be manipulated. */
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
extern _Unwind_Word _Unwind_GetGR (struct _Unwind_Context *, int);
|
|
|
|
extern void _Unwind_SetGR (struct _Unwind_Context *, int, _Unwind_Word);
|
|
|
|
|
|
|
|
extern _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *);
|
2006-02-27 18:26:26 +01:00
|
|
|
extern _Unwind_Ptr _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
|
2001-03-28 13:04:51 +02:00
|
|
|
extern void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr);
|
|
|
|
|
2003-04-03 04:06:55 +02:00
|
|
|
/* @@@ Retrieve the CFA of the given context. */
|
|
|
|
extern _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *);
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
extern void *_Unwind_GetLanguageSpecificData (struct _Unwind_Context *);
|
|
|
|
|
|
|
|
extern _Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *);
|
|
|
|
|
|
|
|
|
|
|
|
/* The personality routine is the function in the C++ (or other language)
|
|
|
|
runtime library which serves as an interface between the system unwind
|
|
|
|
library and language-specific exception handling semantics. It is
|
|
|
|
specific to the code fragment described by an unwind info block, and
|
|
|
|
it is always referenced via the pointer in the unwind info block, and
|
2002-06-01 00:15:42 +02:00
|
|
|
hence it has no ABI-specified name.
|
2001-03-28 13:04:51 +02:00
|
|
|
|
|
|
|
Note that this implies that two different C++ implementations can
|
|
|
|
use different names, and have different contents in the language
|
2002-06-01 00:15:42 +02:00
|
|
|
specific data area. Moreover, that the language specific data
|
2001-03-28 13:04:51 +02:00
|
|
|
area contains no version info because name of the function invoked
|
|
|
|
provides more effective versioning by detecting at link time the
|
|
|
|
lack of code to handle the different data format. */
|
2002-06-01 00:15:42 +02:00
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)
|
|
|
|
(int, _Unwind_Action, _Unwind_Exception_Class,
|
|
|
|
struct _Unwind_Exception *, struct _Unwind_Context *);
|
|
|
|
|
|
|
|
/* @@@ The following alternate entry points are for setjmp/longjmp
|
|
|
|
based unwinding. */
|
|
|
|
|
|
|
|
struct SjLj_Function_Context;
|
|
|
|
extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *);
|
|
|
|
extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *);
|
|
|
|
|
2007-09-14 20:35:12 +02:00
|
|
|
extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
|
|
|
|
_Unwind_SjLj_RaiseException (struct _Unwind_Exception *);
|
|
|
|
extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
|
|
|
|
_Unwind_SjLj_ForcedUnwind (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
|
|
|
|
extern void LIBGCC2_UNWIND_ATTRIBUTE
|
|
|
|
_Unwind_SjLj_Resume (struct _Unwind_Exception *);
|
|
|
|
extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
|
|
|
|
_Unwind_SjLj_Resume_or_Rethrow (struct _Unwind_Exception *);
|
2001-03-28 13:04:51 +02:00
|
|
|
|
2001-05-12 08:03:20 +02:00
|
|
|
/* @@@ The following provide access to the base addresses for text
|
|
|
|
and data-relative addressing in the LDSA. In order to stay link
|
|
|
|
compatible with the standard ABI for IA-64, we inline these. */
|
|
|
|
|
|
|
|
#ifdef __ia64__
|
|
|
|
static inline _Unwind_Ptr
|
|
|
|
_Unwind_GetDataRelBase (struct _Unwind_Context *_C)
|
|
|
|
{
|
|
|
|
/* The GP is stored in R1. */
|
|
|
|
return _Unwind_GetGR (_C, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline _Unwind_Ptr
|
2003-01-23 18:22:53 +01:00
|
|
|
_Unwind_GetTextRelBase (struct _Unwind_Context *_C __attribute__ ((__unused__)))
|
2001-05-12 08:03:20 +02:00
|
|
|
{
|
2015-12-16 16:24:52 +01:00
|
|
|
__builtin_abort ();
|
2005-05-20 02:59:02 +02:00
|
|
|
return 0;
|
2001-05-12 08:03:20 +02:00
|
|
|
}
|
2003-09-04 12:47:46 +02:00
|
|
|
|
|
|
|
/* @@@ Retrieve the Backing Store Pointer of the given context. */
|
|
|
|
extern _Unwind_Word _Unwind_GetBSP (struct _Unwind_Context *);
|
2001-05-12 08:03:20 +02:00
|
|
|
#else
|
|
|
|
extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *);
|
|
|
|
extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *);
|
|
|
|
#endif
|
|
|
|
|
2002-11-27 11:33:56 +01:00
|
|
|
/* @@@ Given an address, return the entry point of the function that
|
|
|
|
contains it. */
|
|
|
|
extern void * _Unwind_FindEnclosingFunction (void *pc);
|
|
|
|
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
#ifndef __SIZEOF_LONG__
|
|
|
|
#error "__SIZEOF_LONG__ macro not defined"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __SIZEOF_POINTER__
|
|
|
|
#error "__SIZEOF_POINTER__ macro not defined"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* leb128 type numbers have a potentially unlimited size.
|
|
|
|
The target of the following definitions of _sleb128_t and _uleb128_t
|
|
|
|
is to have efficient data types large enough to hold the leb128 type
|
|
|
|
numbers used in the unwind code.
|
|
|
|
Mostly these types will simply be defined to long and unsigned long
|
|
|
|
except when a unsigned long data type on the target machine is not
|
|
|
|
capable of storing a pointer. */
|
|
|
|
|
2007-03-30 01:35:33 +02:00
|
|
|
#if __SIZEOF_LONG__ >= __SIZEOF_POINTER__
|
|
|
|
typedef long _sleb128_t;
|
|
|
|
typedef unsigned long _uleb128_t;
|
|
|
|
#elif __SIZEOF_LONG_LONG__ >= __SIZEOF_POINTER__
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
typedef long long _sleb128_t;
|
|
|
|
typedef unsigned long long _uleb128_t;
|
|
|
|
#else
|
2007-03-30 01:35:33 +02:00
|
|
|
# error "What type shall we use for _sleb128_t?"
|
unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with
_uleb128_t and _Unwind_SWord with _sleb128_t.
* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
uw_frame_state_for, uw_update_context_1): Likewise.
* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
* unwind-pe.h (read_uleb128, read_sleb128,
read_encoded_value_with_base): Likewise.
* unwind-generic.h: Define _sleb128_t and _uleb128_t types.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* libsupc++/eh_personality.cc (parse_lsda_header, check_exception_spec,
get_ttype_entry, empty_exception_spec, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
2007-01-24 Andreas Krebbel <krebbel1@de.ibm.com>
* exception.cc (parse_lsda_header, PERSONALITY_FUNCTION): Replaced
_Unwind_Word with _uleb128_t and _Unwind_SWord with _sleb128_t.
From-SVN: r121116
2007-01-24 15:46:47 +01:00
|
|
|
#endif
|
|
|
|
|
2012-11-29 10:36:41 +01:00
|
|
|
#if defined (__SEH__) && !defined (__USING_SJLJ_EXCEPTIONS__)
|
2012-07-19 09:29:24 +02:00
|
|
|
/* Handles the mapping from SEH to GCC interfaces. */
|
|
|
|
EXCEPTION_DISPOSITION _GCC_specific_handler (PEXCEPTION_RECORD, void *,
|
|
|
|
PCONTEXT, PDISPATCHER_CONTEXT,
|
|
|
|
_Unwind_Personality_Fn);
|
|
|
|
#endif
|
|
|
|
|
2001-03-28 13:04:51 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2004-01-08 08:50:46 +01:00
|
|
|
|
2004-11-30 09:15:42 +01:00
|
|
|
#ifndef HIDE_EXPORTS
|
2004-08-03 18:57:40 +02:00
|
|
|
#pragma GCC visibility pop
|
2004-11-30 09:15:42 +01:00
|
|
|
#endif
|
2004-08-03 18:57:40 +02:00
|
|
|
|
2017-11-17 16:21:23 +01:00
|
|
|
/* Additional actions to unwind number of stack frames. */
|
|
|
|
#define _Unwind_Frames_Extra(frames)
|
|
|
|
|
2018-04-19 19:05:39 +02:00
|
|
|
/* Increment frame count. */
|
|
|
|
#define _Unwind_Frames_Increment(context, frames) frames++
|
|
|
|
|
2004-01-08 08:50:46 +01:00
|
|
|
#endif /* unwind.h */
|