xref: /aoo41x/main/sal/osl/unx/backtrace.h (revision 79aad27f)
1*9eab2a37SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*9eab2a37SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*9eab2a37SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*9eab2a37SAndrew Rist  * distributed with this work for additional information
6*9eab2a37SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*9eab2a37SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*9eab2a37SAndrew Rist  * "License"); you may not use this file except in compliance
9*9eab2a37SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*9eab2a37SAndrew Rist  *
11*9eab2a37SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*9eab2a37SAndrew Rist  *
13*9eab2a37SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*9eab2a37SAndrew Rist  * software distributed under the License is distributed on an
15*9eab2a37SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*9eab2a37SAndrew Rist  * KIND, either express or implied.  See the License for the
17*9eab2a37SAndrew Rist  * specific language governing permissions and limitations
18*9eab2a37SAndrew Rist  * under the License.
19*9eab2a37SAndrew Rist  *
20*9eab2a37SAndrew Rist  *************************************************************/
21*9eab2a37SAndrew Rist 
22*9eab2a37SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir 
25cdf0e10cSrcweir #if defined (SOLARIS) || (FREEBSD)
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifdef __cplusplus
28cdf0e10cSrcweir extern "C" {
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir 
31cdf0e10cSrcweir /* backtrace function with same behaviour as defined in GNU libc */
32cdf0e10cSrcweir 
33cdf0e10cSrcweir int backtrace( void **buffer, int max_frames );
34cdf0e10cSrcweir 
35cdf0e10cSrcweir void backtrace_symbols_fd( void **buffer, int size, int fd );
36cdf0e10cSrcweir 
37cdf0e10cSrcweir /* no frame.h on FreeBSD */
38cdf0e10cSrcweir #if defined FREEBSD
39cdf0e10cSrcweir struct frame {
40cdf0e10cSrcweir 	long	arg0[8];
41cdf0e10cSrcweir 	long	arg1[6];
42cdf0e10cSrcweir 	struct frame *fr_savfp;
43cdf0e10cSrcweir 	long	fr_savpc;
44cdf0e10cSrcweir };
45cdf0e10cSrcweir #endif
46cdf0e10cSrcweir 
47cdf0e10cSrcweir 
48cdf0e10cSrcweir #ifdef __cplusplus
49cdf0e10cSrcweir } /* extern "C" */
50cdf0e10cSrcweir #endif
51cdf0e10cSrcweir 
52cdf0e10cSrcweir #endif /* defined SOLARIS || FREEBSD */
53cdf0e10cSrcweir 
54cdf0e10cSrcweir #if defined (LINUX) && defined (SPARC)
55cdf0e10cSrcweir #ifdef __cplusplus
56cdf0e10cSrcweir extern "C" {
57cdf0e10cSrcweir #endif
58cdf0e10cSrcweir 
59cdf0e10cSrcweir /* backtrace function with same behaviour as defined in GNU libc */
60cdf0e10cSrcweir 
61cdf0e10cSrcweir int backtrace( void **buffer, int max_frames );
62cdf0e10cSrcweir 
63cdf0e10cSrcweir void backtrace_symbols_fd( void **buffer, int size, int fd );
64cdf0e10cSrcweir 
65cdf0e10cSrcweir /* no frame.h on linux sparc */
66cdf0e10cSrcweir struct frame {
67cdf0e10cSrcweir 	long	arg0[8];
68cdf0e10cSrcweir 	long	arg1[6];
69cdf0e10cSrcweir 	struct frame *fr_savfp;
70cdf0e10cSrcweir 	long	fr_savpc;
71cdf0e10cSrcweir };
72cdf0e10cSrcweir 
73cdf0e10cSrcweir #ifdef __cplusplus
74cdf0e10cSrcweir } /* extern "C" */
75cdf0e10cSrcweir #endif
76cdf0e10cSrcweir 
77cdf0e10cSrcweir #endif /* defined LINUX && SPARC */
78cdf0e10cSrcweir 
79cdf0e10cSrcweir #if defined (MACOSX)
80cdf0e10cSrcweir 
81cdf0e10cSrcweir #ifdef __cplusplus
82cdf0e10cSrcweir extern "C" {
83cdf0e10cSrcweir #endif
84cdf0e10cSrcweir 
85cdf0e10cSrcweir /* backtrace function with same behaviour as defined in GNU libc */
86cdf0e10cSrcweir 
87cdf0e10cSrcweir int backtrace( void **buffer, int max_frames );
88cdf0e10cSrcweir 
89cdf0e10cSrcweir void backtrace_symbols_fd( void **buffer, int size, int fd );
90cdf0e10cSrcweir 
91cdf0e10cSrcweir #ifdef __cplusplus
92cdf0e10cSrcweir } /* extern "C" */
93cdf0e10cSrcweir #endif
94cdf0e10cSrcweir 
95cdf0e10cSrcweir #endif /* defined MACOSX */
96