]> gcc.gnu.org Git - gcc.git/blame - gcc/unwind-compat.c
re PR bootstrap/45751 (Bootstrap failure: at stage 1 xgcc segfault)
[gcc.git] / gcc / unwind-compat.c
CommitLineData
443728bb 1/* Backward compatibility unwind routines.
748086b7 2 Copyright (C) 2004, 2005, 2006, 2009
443728bb
L
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
748086b7 9 the Free Software Foundation; either version 3, or (at your option)
443728bb
L
10 any later version.
11
443728bb
L
12 GCC is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 License for more details.
16
748086b7
JJ
17 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
20
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 <http://www.gnu.org/licenses/>. */
443728bb
L
25
26#if defined (USE_GAS_SYMVER) && defined (USE_LIBUNWIND_EXCEPTIONS)
7a774cac
JB
27#include "tconfig.h"
28#include "tsystem.h"
443728bb
L
29#include "unwind.h"
30#include "unwind-dw2-fde.h"
31#include "unwind-compat.h"
32
33extern _Unwind_Reason_Code __libunwind_Unwind_Backtrace
34 (_Unwind_Trace_Fn, void *);
35
56e449d3 36_Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
443728bb
L
37_Unwind_Backtrace (_Unwind_Trace_Fn trace, void *trace_argument)
38{
39 return __libunwind_Unwind_Backtrace (trace, trace_argument);
40}
41symver (_Unwind_Backtrace, GCC_3.3);
42
43extern void __libunwind_Unwind_DeleteException
44 (struct _Unwind_Exception *);
45
46void
47_Unwind_DeleteException (struct _Unwind_Exception *exc)
48{
49 return __libunwind_Unwind_DeleteException (exc);
50}
51symver (_Unwind_DeleteException, GCC_3.0);
52
53extern void * __libunwind_Unwind_FindEnclosingFunction (void *);
54
55void *
56_Unwind_FindEnclosingFunction (void *pc)
57{
58 return __libunwind_Unwind_FindEnclosingFunction (pc);
59}
60symver (_Unwind_FindEnclosingFunction, GCC_3.3);
61
62extern _Unwind_Reason_Code __libunwind_Unwind_ForcedUnwind
63 (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
64
56e449d3 65_Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
443728bb
L
66_Unwind_ForcedUnwind (struct _Unwind_Exception *exc,
67 _Unwind_Stop_Fn stop, void * stop_argument)
68{
69 return __libunwind_Unwind_ForcedUnwind (exc, stop, stop_argument);
70}
71symver (_Unwind_ForcedUnwind, GCC_3.0);
72
73extern _Unwind_Word __libunwind_Unwind_GetCFA
74 (struct _Unwind_Context *);
75
76_Unwind_Word
77_Unwind_GetCFA (struct _Unwind_Context *context)
78{
79 return __libunwind_Unwind_GetCFA (context);
80}
81symver (_Unwind_GetCFA, GCC_3.3);
82
83#ifdef __ia64__
84extern _Unwind_Word __libunwind_Unwind_GetBSP
85 (struct _Unwind_Context *);
86
87_Unwind_Word
88_Unwind_GetBSP (struct _Unwind_Context * context)
89{
90 return __libunwind_Unwind_GetBSP (context);
91}
92symver (_Unwind_GetBSP, GCC_3.3.2);
93#else
94extern _Unwind_Ptr __libunwind_Unwind_GetDataRelBase
95 (struct _Unwind_Context *);
96
97_Unwind_Ptr
98_Unwind_GetDataRelBase (struct _Unwind_Context *context)
99{
100 return __libunwind_Unwind_GetDataRelBase (context);
101}
102symver (_Unwind_GetDataRelBase, GCC_3.0);
103
104extern _Unwind_Ptr __libunwind_Unwind_GetTextRelBase
105 (struct _Unwind_Context *);
106
107_Unwind_Ptr
108_Unwind_GetTextRelBase (struct _Unwind_Context *context)
109{
110 return __libunwind_Unwind_GetTextRelBase (context);
111}
112symver (_Unwind_GetTextRelBase, GCC_3.0);
113#endif
114
115extern _Unwind_Word __libunwind_Unwind_GetGR
116 (struct _Unwind_Context *, int );
117
118_Unwind_Word
119_Unwind_GetGR (struct _Unwind_Context *context, int index)
120{
121 return __libunwind_Unwind_GetGR (context, index);
122}
123symver (_Unwind_GetGR, GCC_3.0);
124
125extern _Unwind_Ptr __libunwind_Unwind_GetIP (struct _Unwind_Context *);
126
127_Unwind_Ptr
128_Unwind_GetIP (struct _Unwind_Context *context)
129{
130 return __libunwind_Unwind_GetIP (context);
131}
132symver (_Unwind_GetIP, GCC_3.0);
133
754e45a8
JJ
134_Unwind_Ptr
135_Unwind_GetIPInfo (struct _Unwind_Context *context, int *ip_before_insn)
136{
137 *ip_before_insn = 0;
138 return __libunwind_Unwind_GetIP (context);
139}
140
443728bb
L
141extern void *__libunwind_Unwind_GetLanguageSpecificData
142 (struct _Unwind_Context *);
143
144void *
145_Unwind_GetLanguageSpecificData (struct _Unwind_Context *context)
146{
147 return __libunwind_Unwind_GetLanguageSpecificData (context);
148}
149symver (_Unwind_GetLanguageSpecificData, GCC_3.0);
150
151extern _Unwind_Ptr __libunwind_Unwind_GetRegionStart
152 (struct _Unwind_Context *);
153
154_Unwind_Ptr
155_Unwind_GetRegionStart (struct _Unwind_Context *context)
156{
157 return __libunwind_Unwind_GetRegionStart (context);
158}
159symver (_Unwind_GetRegionStart, GCC_3.0);
160
161extern _Unwind_Reason_Code __libunwind_Unwind_RaiseException
162 (struct _Unwind_Exception *);
163
56e449d3 164_Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
443728bb
L
165_Unwind_RaiseException(struct _Unwind_Exception *exc)
166{
167 return __libunwind_Unwind_RaiseException (exc);
168}
169symver (_Unwind_RaiseException, GCC_3.0);
170
171extern void __libunwind_Unwind_Resume (struct _Unwind_Exception *);
172
56e449d3 173void LIBGCC2_UNWIND_ATTRIBUTE
443728bb
L
174_Unwind_Resume (struct _Unwind_Exception *exc)
175{
176 __libunwind_Unwind_Resume (exc);
177}
178symver (_Unwind_Resume, GCC_3.0);
179
180extern _Unwind_Reason_Code __libunwind_Unwind_Resume_or_Rethrow
181 (struct _Unwind_Exception *);
182
56e449d3 183_Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
443728bb
L
184_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *exc)
185{
186 return __libunwind_Unwind_Resume_or_Rethrow (exc);
187}
188symver (_Unwind_Resume_or_Rethrow, GCC_3.3);
189
190extern void __libunwind_Unwind_SetGR
191 (struct _Unwind_Context *, int, _Unwind_Word);
192
193void
194_Unwind_SetGR (struct _Unwind_Context *context, int index,
b8698a0f 195 _Unwind_Word val)
443728bb
L
196{
197 __libunwind_Unwind_SetGR (context, index, val);
198}
199symver (_Unwind_SetGR, GCC_3.0);
200
201extern void __libunwind_Unwind_SetIP
202 (struct _Unwind_Context *, _Unwind_Ptr);
203
204void
205_Unwind_SetIP (struct _Unwind_Context *context, _Unwind_Ptr val)
206{
207 return __libunwind_Unwind_SetIP (context, val);
208}
209symver (_Unwind_SetIP, GCC_3.0);
210#endif
This page took 2.887505 seconds and 5 git commands to generate.