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