satyr  0.28
core/stacktrace.h
Go to the documentation of this file.
1 /*
2  core_stacktrace.h
3 
4  Copyright (C) 2010 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_STACKTRACE_H
21 #define SATYR_CORE_STACKTRACE_H
22 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #include "../report_type.h"
33 #include <inttypes.h>
34 #include <stdbool.h>
35 
36 struct sr_core_thread;
37 struct sr_location;
38 struct sr_json_value;
39 
44 {
45  enum sr_report_type type;
46 
48  uint16_t signal;
49 
50  char *executable;
51 
58 
59  struct sr_core_thread *threads;
60 
63 };
64 
71 struct sr_core_stacktrace *
73 
80 void
82 
88 void
90 
99 struct sr_core_stacktrace *
100 sr_core_stacktrace_dup(struct sr_core_stacktrace *stacktrace);
101 
107 int
109 
110 struct sr_core_thread *
111 sr_core_stacktrace_find_crash_thread(struct sr_core_stacktrace *stacktrace);
112 
118 struct sr_core_stacktrace *
120  char **error_message);
121 
122 struct sr_core_stacktrace *
123 sr_core_stacktrace_from_json_text(const char *text,
124  char **error_message);
125 
129 char *
131 
139 char *
141 
142 struct sr_core_stacktrace *
143 sr_core_stacktrace_create(const char *gdb_stacktrace_text,
144  const char *unstrip_text,
145  const char *executable_path);
146 
147 #ifdef __cplusplus
148 }
149 #endif
150 
151 #endif
struct sr_core_stacktrace * sr_core_stacktrace_from_json(struct sr_json_value *root, char **error_message)
struct sr_core_thread * crash_thread
Thread responsible for the crash.
A stack trace of a core dump.
int sr_core_stacktrace_get_thread_count(struct sr_core_stacktrace *stacktrace)
struct sr_core_stacktrace * sr_core_stacktrace_new(void)
void sr_core_stacktrace_free(struct sr_core_stacktrace *stacktrace)
A thread of execution on call stack of a core dump.
Definition: core/thread.h:44
struct sr_core_stacktrace * sr_core_stacktrace_dup(struct sr_core_stacktrace *stacktrace)
char * sr_core_stacktrace_to_json(struct sr_core_stacktrace *stacktrace)
char * sr_core_stacktrace_get_reason(struct sr_core_stacktrace *stacktrace)
A location of a parser in the input stream.
Definition: location.h:42
void sr_core_stacktrace_init(struct sr_core_stacktrace *stacktrace)