unwind-compat.c revision 146895
1/* Backward compatibility unwind routines. 2 Copyright (C) 2004 3 Free Software Foundation, Inc. 4 5 This file is part of GCC. 6 7 GCC is free software; you can redistribute it and/or modify it 8 under the terms of the GNU General Public License as published by 9 the Free Software Foundation; either version 2, or (at your option) 10 any later version. 11 12 In addition to the permissions in the GNU General Public License, the 13 Free Software Foundation gives you unlimited permission to link the 14 compiled version of this file into combinations with other programs, 15 and to distribute those combinations without any restriction coming 16 from the use of this file. (The General Public License restrictions 17 do apply in other respects; for example, they cover modification of 18 the file, and distribution when not linked into a combined 19 executable.) 20 21 GCC is distributed in the hope that it will be useful, but WITHOUT 22 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 23 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 24 License for more details. 25 26 You should have received a copy of the GNU General Public License 27 along with GCC; see the file COPYING. If not, write to the Free 28 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 29 02111-1307, USA. */ 30 31#if defined (USE_GAS_SYMVER) && defined (USE_LIBUNWIND_EXCEPTIONS) 32#include "unwind.h" 33#include "unwind-dw2-fde.h" 34#include "unwind-compat.h" 35 36extern _Unwind_Reason_Code __libunwind_Unwind_Backtrace 37 (_Unwind_Trace_Fn, void *); 38 39_Unwind_Reason_Code 40_Unwind_Backtrace (_Unwind_Trace_Fn trace, void *trace_argument) 41{ 42 return __libunwind_Unwind_Backtrace (trace, trace_argument); 43} 44symver (_Unwind_Backtrace, GCC_3.3); 45 46extern void __libunwind_Unwind_DeleteException 47 (struct _Unwind_Exception *); 48 49void 50_Unwind_DeleteException (struct _Unwind_Exception *exc) 51{ 52 return __libunwind_Unwind_DeleteException (exc); 53} 54symver (_Unwind_DeleteException, GCC_3.0); 55 56extern void * __libunwind_Unwind_FindEnclosingFunction (void *); 57 58void * 59_Unwind_FindEnclosingFunction (void *pc) 60{ 61 return __libunwind_Unwind_FindEnclosingFunction (pc); 62} 63symver (_Unwind_FindEnclosingFunction, GCC_3.3); 64 65extern _Unwind_Reason_Code __libunwind_Unwind_ForcedUnwind 66 (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); 67 68_Unwind_Reason_Code 69_Unwind_ForcedUnwind (struct _Unwind_Exception *exc, 70 _Unwind_Stop_Fn stop, void * stop_argument) 71{ 72 return __libunwind_Unwind_ForcedUnwind (exc, stop, stop_argument); 73} 74symver (_Unwind_ForcedUnwind, GCC_3.0); 75 76extern _Unwind_Word __libunwind_Unwind_GetCFA 77 (struct _Unwind_Context *); 78 79_Unwind_Word 80_Unwind_GetCFA (struct _Unwind_Context *context) 81{ 82 return __libunwind_Unwind_GetCFA (context); 83} 84symver (_Unwind_GetCFA, GCC_3.3); 85 86#ifdef __ia64__ 87extern _Unwind_Word __libunwind_Unwind_GetBSP 88 (struct _Unwind_Context *); 89 90_Unwind_Word 91_Unwind_GetBSP (struct _Unwind_Context * context) 92{ 93 return __libunwind_Unwind_GetBSP (context); 94} 95symver (_Unwind_GetBSP, GCC_3.3.2); 96#else 97extern _Unwind_Ptr __libunwind_Unwind_GetDataRelBase 98 (struct _Unwind_Context *); 99 100_Unwind_Ptr 101_Unwind_GetDataRelBase (struct _Unwind_Context *context) 102{ 103 return __libunwind_Unwind_GetDataRelBase (context); 104} 105symver (_Unwind_GetDataRelBase, GCC_3.0); 106 107extern _Unwind_Ptr __libunwind_Unwind_GetTextRelBase 108 (struct _Unwind_Context *); 109 110_Unwind_Ptr 111_Unwind_GetTextRelBase (struct _Unwind_Context *context) 112{ 113 return __libunwind_Unwind_GetTextRelBase (context); 114} 115symver (_Unwind_GetTextRelBase, GCC_3.0); 116#endif 117 118extern _Unwind_Word __libunwind_Unwind_GetGR 119 (struct _Unwind_Context *, int ); 120 121_Unwind_Word 122_Unwind_GetGR (struct _Unwind_Context *context, int index) 123{ 124 return __libunwind_Unwind_GetGR (context, index); 125} 126symver (_Unwind_GetGR, GCC_3.0); 127 128extern _Unwind_Ptr __libunwind_Unwind_GetIP (struct _Unwind_Context *); 129 130_Unwind_Ptr 131_Unwind_GetIP (struct _Unwind_Context *context) 132{ 133 return __libunwind_Unwind_GetIP (context); 134} 135symver (_Unwind_GetIP, GCC_3.0); 136 137extern void *__libunwind_Unwind_GetLanguageSpecificData 138 (struct _Unwind_Context *); 139 140void * 141_Unwind_GetLanguageSpecificData (struct _Unwind_Context *context) 142{ 143 return __libunwind_Unwind_GetLanguageSpecificData (context); 144} 145symver (_Unwind_GetLanguageSpecificData, GCC_3.0); 146 147extern _Unwind_Ptr __libunwind_Unwind_GetRegionStart 148 (struct _Unwind_Context *); 149 150_Unwind_Ptr 151_Unwind_GetRegionStart (struct _Unwind_Context *context) 152{ 153 return __libunwind_Unwind_GetRegionStart (context); 154} 155symver (_Unwind_GetRegionStart, GCC_3.0); 156 157extern _Unwind_Reason_Code __libunwind_Unwind_RaiseException 158 (struct _Unwind_Exception *); 159 160_Unwind_Reason_Code 161_Unwind_RaiseException(struct _Unwind_Exception *exc) 162{ 163 return __libunwind_Unwind_RaiseException (exc); 164} 165symver (_Unwind_RaiseException, GCC_3.0); 166 167extern void __libunwind_Unwind_Resume (struct _Unwind_Exception *); 168 169void 170_Unwind_Resume (struct _Unwind_Exception *exc) 171{ 172 __libunwind_Unwind_Resume (exc); 173} 174symver (_Unwind_Resume, GCC_3.0); 175 176extern _Unwind_Reason_Code __libunwind_Unwind_Resume_or_Rethrow 177 (struct _Unwind_Exception *); 178 179_Unwind_Reason_Code 180_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *exc) 181{ 182 return __libunwind_Unwind_Resume_or_Rethrow (exc); 183} 184symver (_Unwind_Resume_or_Rethrow, GCC_3.3); 185 186extern void __libunwind_Unwind_SetGR 187 (struct _Unwind_Context *, int, _Unwind_Word); 188 189void 190_Unwind_SetGR (struct _Unwind_Context *context, int index, 191 _Unwind_Word val) 192{ 193 __libunwind_Unwind_SetGR (context, index, val); 194} 195symver (_Unwind_SetGR, GCC_3.0); 196 197extern void __libunwind_Unwind_SetIP 198 (struct _Unwind_Context *, _Unwind_Ptr); 199 200void 201_Unwind_SetIP (struct _Unwind_Context *context, _Unwind_Ptr val) 202{ 203 return __libunwind_Unwind_SetIP (context, val); 204} 205symver (_Unwind_SetIP, GCC_3.0); 206#endif 207