satyr 0.43
Loading...
Searching...
No Matches
unwind.h
Go to the documentation of this file.
1/*
2 core_unwind.h
3
4 Copyright (C) 2010, 2011, 2012 Red Hat, Inc.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#ifndef SATYR_CORE_UNWIND_H
21#define SATYR_CORE_UNWIND_H
22
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#include <sys/types.h>
33
36struct sr_core_stracetrace_unwind_state;
37
38struct sr_core_stacktrace *
39sr_parse_coredump(const char *coredump_filename,
40 const char *executable_filename,
41 char **error_message);
42
43struct sr_core_stacktrace *
44sr_core_stacktrace_from_gdb(const char *gdb_output,
45 const char *coredump_filename,
46 const char *executable_filename,
47 char **error_message);
48
49/* This function can be used to unwind stack of live ("dying") process, invoked
50 * from the core dump hook (/proc/sys/kernel/core_pattern).
51 *
52 * Beware:
53 *
54 * - It can only unwind one thread of the process, the thread that caused the
55 * terminating signal to be sent. You must supply that thread's tid.
56 * - The function calls close() on stdin, meaning that in the core handler you
57 * cannot access the core image after calling this function.
58 */
59struct sr_core_stacktrace *
60sr_core_stacktrace_from_core_hook(pid_t thread_id,
61 const char *executable_filename,
62 int signum,
63 char **error_message);
64
65struct sr_core_stracetrace_unwind_state *
66sr_core_stacktrace_from_core_hook_prepare(pid_t tid, char **error_msg);
67
68struct sr_core_stacktrace *
69sr_core_stacktrace_from_core_hook_generate(pid_t tid,
70 const char *executable,
71 int signum,
72 struct sr_core_stracetrace_unwind_state *state,
73 char **error_msg);
74
75void
76sr_core_stacktrace_unwind_state_free(struct sr_core_stracetrace_unwind_state *state);
77
78#ifdef __cplusplus
79}
80#endif
81
82#endif
A stack trace of a core dump.
A stack trace produced by GDB.