annotate libbacktrace/internal.h @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* internal.h -- Internal header file for stack backtrace library.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 Copyright (C) 2012-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3 Written by Ian Lance Taylor, Google.
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 Redistribution and use in source and binary forms, with or without
kono
parents:
diff changeset
6 modification, are permitted provided that the following conditions are
kono
parents:
diff changeset
7 met:
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 (1) Redistributions of source code must retain the above copyright
kono
parents:
diff changeset
10 notice, this list of conditions and the following disclaimer.
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 (2) Redistributions in binary form must reproduce the above copyright
kono
parents:
diff changeset
13 notice, this list of conditions and the following disclaimer in
kono
parents:
diff changeset
14 the documentation and/or other materials provided with the
kono
parents:
diff changeset
15 distribution.
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 (3) The name of the author may not be used to
kono
parents:
diff changeset
18 endorse or promote products derived from this software without
kono
parents:
diff changeset
19 specific prior written permission.
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
kono
parents:
diff changeset
22 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
kono
parents:
diff changeset
23 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
kono
parents:
diff changeset
24 DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
kono
parents:
diff changeset
25 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
kono
parents:
diff changeset
26 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
kono
parents:
diff changeset
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
kono
parents:
diff changeset
28 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
kono
parents:
diff changeset
29 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
kono
parents:
diff changeset
30 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
kono
parents:
diff changeset
31 POSSIBILITY OF SUCH DAMAGE. */
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 #ifndef BACKTRACE_INTERNAL_H
kono
parents:
diff changeset
34 #define BACKTRACE_INTERNAL_H
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 /* We assume that <sys/types.h> and "backtrace.h" have already been
kono
parents:
diff changeset
37 included. */
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 #ifndef GCC_VERSION
kono
parents:
diff changeset
40 # define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
kono
parents:
diff changeset
41 #endif
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 #if (GCC_VERSION < 2007)
kono
parents:
diff changeset
44 # define __attribute__(x)
kono
parents:
diff changeset
45 #endif
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 #ifndef ATTRIBUTE_UNUSED
kono
parents:
diff changeset
48 # define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
kono
parents:
diff changeset
49 #endif
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 #ifndef ATTRIBUTE_MALLOC
kono
parents:
diff changeset
52 # if (GCC_VERSION >= 2096)
kono
parents:
diff changeset
53 # define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
kono
parents:
diff changeset
54 # else
kono
parents:
diff changeset
55 # define ATTRIBUTE_MALLOC
kono
parents:
diff changeset
56 # endif
kono
parents:
diff changeset
57 #endif
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 #ifndef HAVE_SYNC_FUNCTIONS
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 /* Define out the sync functions. These should never be called if
kono
parents:
diff changeset
62 they are not available. */
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 #define __sync_bool_compare_and_swap(A, B, C) (abort(), 1)
kono
parents:
diff changeset
65 #define __sync_lock_test_and_set(A, B) (abort(), 0)
kono
parents:
diff changeset
66 #define __sync_lock_release(A) abort()
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 #endif /* !defined (HAVE_SYNC_FUNCTIONS) */
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70 #ifdef HAVE_ATOMIC_FUNCTIONS
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 /* We have the atomic builtin functions. */
kono
parents:
diff changeset
73
kono
parents:
diff changeset
74 #define backtrace_atomic_load_pointer(p) \
kono
parents:
diff changeset
75 __atomic_load_n ((p), __ATOMIC_ACQUIRE)
kono
parents:
diff changeset
76 #define backtrace_atomic_load_int(p) \
kono
parents:
diff changeset
77 __atomic_load_n ((p), __ATOMIC_ACQUIRE)
kono
parents:
diff changeset
78 #define backtrace_atomic_store_pointer(p, v) \
kono
parents:
diff changeset
79 __atomic_store_n ((p), (v), __ATOMIC_RELEASE)
kono
parents:
diff changeset
80 #define backtrace_atomic_store_size_t(p, v) \
kono
parents:
diff changeset
81 __atomic_store_n ((p), (v), __ATOMIC_RELEASE)
kono
parents:
diff changeset
82 #define backtrace_atomic_store_int(p, v) \
kono
parents:
diff changeset
83 __atomic_store_n ((p), (v), __ATOMIC_RELEASE)
kono
parents:
diff changeset
84
kono
parents:
diff changeset
85 #else /* !defined (HAVE_ATOMIC_FUNCTIONS) */
kono
parents:
diff changeset
86 #ifdef HAVE_SYNC_FUNCTIONS
kono
parents:
diff changeset
87
kono
parents:
diff changeset
88 /* We have the sync functions but not the atomic functions. Define
kono
parents:
diff changeset
89 the atomic ones in terms of the sync ones. */
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 extern void *backtrace_atomic_load_pointer (void *);
kono
parents:
diff changeset
92 extern int backtrace_atomic_load_int (int *);
kono
parents:
diff changeset
93 extern void backtrace_atomic_store_pointer (void *, void *);
kono
parents:
diff changeset
94 extern void backtrace_atomic_store_size_t (size_t *, size_t);
kono
parents:
diff changeset
95 extern void backtrace_atomic_store_int (int *, int);
kono
parents:
diff changeset
96
kono
parents:
diff changeset
97 #else /* !defined (HAVE_SYNC_FUNCTIONS) */
kono
parents:
diff changeset
98
kono
parents:
diff changeset
99 /* We have neither the sync nor the atomic functions. These will
kono
parents:
diff changeset
100 never be called. */
kono
parents:
diff changeset
101
kono
parents:
diff changeset
102 #define backtrace_atomic_load_pointer(p) (abort(), (void *) NULL)
kono
parents:
diff changeset
103 #define backtrace_atomic_load_int(p) (abort(), 0)
kono
parents:
diff changeset
104 #define backtrace_atomic_store_pointer(p, v) abort()
kono
parents:
diff changeset
105 #define backtrace_atomic_store_size_t(p, v) abort()
kono
parents:
diff changeset
106 #define backtrace_atomic_store_int(p, v) abort()
kono
parents:
diff changeset
107
kono
parents:
diff changeset
108 #endif /* !defined (HAVE_SYNC_FUNCTIONS) */
kono
parents:
diff changeset
109 #endif /* !defined (HAVE_ATOMIC_FUNCTIONS) */
kono
parents:
diff changeset
110
kono
parents:
diff changeset
111 /* The type of the function that collects file/line information. This
kono
parents:
diff changeset
112 is like backtrace_pcinfo. */
kono
parents:
diff changeset
113
kono
parents:
diff changeset
114 typedef int (*fileline) (struct backtrace_state *state, uintptr_t pc,
kono
parents:
diff changeset
115 backtrace_full_callback callback,
kono
parents:
diff changeset
116 backtrace_error_callback error_callback, void *data);
kono
parents:
diff changeset
117
kono
parents:
diff changeset
118 /* The type of the function that collects symbol information. This is
kono
parents:
diff changeset
119 like backtrace_syminfo. */
kono
parents:
diff changeset
120
kono
parents:
diff changeset
121 typedef void (*syminfo) (struct backtrace_state *state, uintptr_t pc,
kono
parents:
diff changeset
122 backtrace_syminfo_callback callback,
kono
parents:
diff changeset
123 backtrace_error_callback error_callback, void *data);
kono
parents:
diff changeset
124
kono
parents:
diff changeset
125 /* What the backtrace state pointer points to. */
kono
parents:
diff changeset
126
kono
parents:
diff changeset
127 struct backtrace_state
kono
parents:
diff changeset
128 {
kono
parents:
diff changeset
129 /* The name of the executable. */
kono
parents:
diff changeset
130 const char *filename;
kono
parents:
diff changeset
131 /* Non-zero if threaded. */
kono
parents:
diff changeset
132 int threaded;
kono
parents:
diff changeset
133 /* The master lock for fileline_fn, fileline_data, syminfo_fn,
kono
parents:
diff changeset
134 syminfo_data, fileline_initialization_failed and everything the
kono
parents:
diff changeset
135 data pointers point to. */
kono
parents:
diff changeset
136 void *lock;
kono
parents:
diff changeset
137 /* The function that returns file/line information. */
kono
parents:
diff changeset
138 fileline fileline_fn;
kono
parents:
diff changeset
139 /* The data to pass to FILELINE_FN. */
kono
parents:
diff changeset
140 void *fileline_data;
kono
parents:
diff changeset
141 /* The function that returns symbol information. */
kono
parents:
diff changeset
142 syminfo syminfo_fn;
kono
parents:
diff changeset
143 /* The data to pass to SYMINFO_FN. */
kono
parents:
diff changeset
144 void *syminfo_data;
kono
parents:
diff changeset
145 /* Whether initializing the file/line information failed. */
kono
parents:
diff changeset
146 int fileline_initialization_failed;
kono
parents:
diff changeset
147 /* The lock for the freelist. */
kono
parents:
diff changeset
148 int lock_alloc;
kono
parents:
diff changeset
149 /* The freelist when using mmap. */
kono
parents:
diff changeset
150 struct backtrace_freelist_struct *freelist;
kono
parents:
diff changeset
151 };
kono
parents:
diff changeset
152
kono
parents:
diff changeset
153 /* Open a file for reading. Returns -1 on error. If DOES_NOT_EXIST
kono
parents:
diff changeset
154 is not NULL, *DOES_NOT_EXIST will be set to 0 normally and set to 1
kono
parents:
diff changeset
155 if the file does not exist. If the file does not exist and
kono
parents:
diff changeset
156 DOES_NOT_EXIST is not NULL, the function will return -1 and will
kono
parents:
diff changeset
157 not call ERROR_CALLBACK. On other errors, or if DOES_NOT_EXIST is
kono
parents:
diff changeset
158 NULL, the function will call ERROR_CALLBACK before returning. */
kono
parents:
diff changeset
159 extern int backtrace_open (const char *filename,
kono
parents:
diff changeset
160 backtrace_error_callback error_callback,
kono
parents:
diff changeset
161 void *data,
kono
parents:
diff changeset
162 int *does_not_exist);
kono
parents:
diff changeset
163
kono
parents:
diff changeset
164 /* A view of the contents of a file. This supports mmap when
kono
parents:
diff changeset
165 available. A view will remain in memory even after backtrace_close
kono
parents:
diff changeset
166 is called on the file descriptor from which the view was
kono
parents:
diff changeset
167 obtained. */
kono
parents:
diff changeset
168
kono
parents:
diff changeset
169 struct backtrace_view
kono
parents:
diff changeset
170 {
kono
parents:
diff changeset
171 /* The data that the caller requested. */
kono
parents:
diff changeset
172 const void *data;
kono
parents:
diff changeset
173 /* The base of the view. */
kono
parents:
diff changeset
174 void *base;
kono
parents:
diff changeset
175 /* The total length of the view. */
kono
parents:
diff changeset
176 size_t len;
kono
parents:
diff changeset
177 };
kono
parents:
diff changeset
178
kono
parents:
diff changeset
179 /* Create a view of SIZE bytes from DESCRIPTOR at OFFSET. Store the
kono
parents:
diff changeset
180 result in *VIEW. Returns 1 on success, 0 on error. */
kono
parents:
diff changeset
181 extern int backtrace_get_view (struct backtrace_state *state, int descriptor,
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
182 off_t offset, uint64_t size,
111
kono
parents:
diff changeset
183 backtrace_error_callback error_callback,
kono
parents:
diff changeset
184 void *data, struct backtrace_view *view);
kono
parents:
diff changeset
185
kono
parents:
diff changeset
186 /* Release a view created by backtrace_get_view. */
kono
parents:
diff changeset
187 extern void backtrace_release_view (struct backtrace_state *state,
kono
parents:
diff changeset
188 struct backtrace_view *view,
kono
parents:
diff changeset
189 backtrace_error_callback error_callback,
kono
parents:
diff changeset
190 void *data);
kono
parents:
diff changeset
191
kono
parents:
diff changeset
192 /* Close a file opened by backtrace_open. Returns 1 on success, 0 on
kono
parents:
diff changeset
193 error. */
kono
parents:
diff changeset
194
kono
parents:
diff changeset
195 extern int backtrace_close (int descriptor,
kono
parents:
diff changeset
196 backtrace_error_callback error_callback,
kono
parents:
diff changeset
197 void *data);
kono
parents:
diff changeset
198
kono
parents:
diff changeset
199 /* Sort without using memory. */
kono
parents:
diff changeset
200
kono
parents:
diff changeset
201 extern void backtrace_qsort (void *base, size_t count, size_t size,
kono
parents:
diff changeset
202 int (*compar) (const void *, const void *));
kono
parents:
diff changeset
203
kono
parents:
diff changeset
204 /* Allocate memory. This is like malloc. If ERROR_CALLBACK is NULL,
kono
parents:
diff changeset
205 this does not report an error, it just returns NULL. */
kono
parents:
diff changeset
206
kono
parents:
diff changeset
207 extern void *backtrace_alloc (struct backtrace_state *state, size_t size,
kono
parents:
diff changeset
208 backtrace_error_callback error_callback,
kono
parents:
diff changeset
209 void *data) ATTRIBUTE_MALLOC;
kono
parents:
diff changeset
210
kono
parents:
diff changeset
211 /* Free memory allocated by backtrace_alloc. If ERROR_CALLBACK is
kono
parents:
diff changeset
212 NULL, this does not report an error. */
kono
parents:
diff changeset
213
kono
parents:
diff changeset
214 extern void backtrace_free (struct backtrace_state *state, void *mem,
kono
parents:
diff changeset
215 size_t size,
kono
parents:
diff changeset
216 backtrace_error_callback error_callback,
kono
parents:
diff changeset
217 void *data);
kono
parents:
diff changeset
218
kono
parents:
diff changeset
219 /* A growable vector of some struct. This is used for more efficient
kono
parents:
diff changeset
220 allocation when we don't know the final size of some group of data
kono
parents:
diff changeset
221 that we want to represent as an array. */
kono
parents:
diff changeset
222
kono
parents:
diff changeset
223 struct backtrace_vector
kono
parents:
diff changeset
224 {
kono
parents:
diff changeset
225 /* The base of the vector. */
kono
parents:
diff changeset
226 void *base;
kono
parents:
diff changeset
227 /* The number of bytes in the vector. */
kono
parents:
diff changeset
228 size_t size;
kono
parents:
diff changeset
229 /* The number of bytes available at the current allocation. */
kono
parents:
diff changeset
230 size_t alc;
kono
parents:
diff changeset
231 };
kono
parents:
diff changeset
232
kono
parents:
diff changeset
233 /* Grow VEC by SIZE bytes. Return a pointer to the newly allocated
kono
parents:
diff changeset
234 bytes. Note that this may move the entire vector to a new memory
kono
parents:
diff changeset
235 location. Returns NULL on failure. */
kono
parents:
diff changeset
236
kono
parents:
diff changeset
237 extern void *backtrace_vector_grow (struct backtrace_state *state, size_t size,
kono
parents:
diff changeset
238 backtrace_error_callback error_callback,
kono
parents:
diff changeset
239 void *data,
kono
parents:
diff changeset
240 struct backtrace_vector *vec);
kono
parents:
diff changeset
241
kono
parents:
diff changeset
242 /* Finish the current allocation on VEC. Prepare to start a new
kono
parents:
diff changeset
243 allocation. The finished allocation will never be freed. Returns
kono
parents:
diff changeset
244 a pointer to the base of the finished entries, or NULL on
kono
parents:
diff changeset
245 failure. */
kono
parents:
diff changeset
246
kono
parents:
diff changeset
247 extern void* backtrace_vector_finish (struct backtrace_state *state,
kono
parents:
diff changeset
248 struct backtrace_vector *vec,
kono
parents:
diff changeset
249 backtrace_error_callback error_callback,
kono
parents:
diff changeset
250 void *data);
kono
parents:
diff changeset
251
kono
parents:
diff changeset
252 /* Release any extra space allocated for VEC. This may change
kono
parents:
diff changeset
253 VEC->base. Returns 1 on success, 0 on failure. */
kono
parents:
diff changeset
254
kono
parents:
diff changeset
255 extern int backtrace_vector_release (struct backtrace_state *state,
kono
parents:
diff changeset
256 struct backtrace_vector *vec,
kono
parents:
diff changeset
257 backtrace_error_callback error_callback,
kono
parents:
diff changeset
258 void *data);
kono
parents:
diff changeset
259
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
260 /* Free the space managed by VEC. This will reset VEC. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
261
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
262 static inline void
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
263 backtrace_vector_free (struct backtrace_state *state,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
264 struct backtrace_vector *vec,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
265 backtrace_error_callback error_callback, void *data)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
266 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
267 vec->alc += vec->size;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
268 vec->size = 0;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
269 backtrace_vector_release (state, vec, error_callback, data);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
270 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
271
111
kono
parents:
diff changeset
272 /* Read initial debug data from a descriptor, and set the
kono
parents:
diff changeset
273 fileline_data, syminfo_fn, and syminfo_data fields of STATE.
kono
parents:
diff changeset
274 Return the fileln_fn field in *FILELN_FN--this is done this way so
kono
parents:
diff changeset
275 that the synchronization code is only implemented once. This is
kono
parents:
diff changeset
276 called after the descriptor has first been opened. It will close
kono
parents:
diff changeset
277 the descriptor if it is no longer needed. Returns 1 on success, 0
kono
parents:
diff changeset
278 on error. There will be multiple implementations of this function,
kono
parents:
diff changeset
279 for different file formats. Each system will compile the
kono
parents:
diff changeset
280 appropriate one. */
kono
parents:
diff changeset
281
kono
parents:
diff changeset
282 extern int backtrace_initialize (struct backtrace_state *state,
kono
parents:
diff changeset
283 const char *filename,
kono
parents:
diff changeset
284 int descriptor,
kono
parents:
diff changeset
285 backtrace_error_callback error_callback,
kono
parents:
diff changeset
286 void *data,
kono
parents:
diff changeset
287 fileline *fileline_fn);
kono
parents:
diff changeset
288
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
289 /* An enum for the DWARF sections we care about. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
290
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
291 enum dwarf_section
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
292 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
293 DEBUG_INFO,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
294 DEBUG_LINE,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
295 DEBUG_ABBREV,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
296 DEBUG_RANGES,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
297 DEBUG_STR,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
298 DEBUG_ADDR,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
299 DEBUG_STR_OFFSETS,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
300 DEBUG_LINE_STR,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
301 DEBUG_RNGLISTS,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
302
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
303 DEBUG_MAX
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
304 };
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
305
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
306 /* Data for the DWARF sections we care about. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
307
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
308 struct dwarf_sections
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
309 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
310 const unsigned char *data[DEBUG_MAX];
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
311 size_t size[DEBUG_MAX];
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
312 };
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
313
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
314 /* DWARF data read from a file, used for .gnu_debugaltlink. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
315
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
316 struct dwarf_data;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
317
111
kono
parents:
diff changeset
318 /* Add file/line information for a DWARF module. */
kono
parents:
diff changeset
319
kono
parents:
diff changeset
320 extern int backtrace_dwarf_add (struct backtrace_state *state,
kono
parents:
diff changeset
321 uintptr_t base_address,
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
322 const struct dwarf_sections *dwarf_sections,
111
kono
parents:
diff changeset
323 int is_bigendian,
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
324 struct dwarf_data *fileline_altlink,
111
kono
parents:
diff changeset
325 backtrace_error_callback error_callback,
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
326 void *data, fileline *fileline_fn,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
327 struct dwarf_data **fileline_entry);
111
kono
parents:
diff changeset
328
kono
parents:
diff changeset
329 /* A test-only hook for elf_uncompress_zdebug. */
kono
parents:
diff changeset
330
kono
parents:
diff changeset
331 extern int backtrace_uncompress_zdebug (struct backtrace_state *,
kono
parents:
diff changeset
332 const unsigned char *compressed,
kono
parents:
diff changeset
333 size_t compressed_size,
kono
parents:
diff changeset
334 backtrace_error_callback, void *data,
kono
parents:
diff changeset
335 unsigned char **uncompressed,
kono
parents:
diff changeset
336 size_t *uncompressed_size);
kono
parents:
diff changeset
337
kono
parents:
diff changeset
338 #endif