satyr  0.28
gdb/stacktrace.h
Go to the documentation of this file.
1 /*
2  gdb_stacktrace.h
3 
4  Copyright (C) 2012 ABRT Team
5  Copyright (C) 2012 Red Hat, Inc.
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License along
18  with this program; if not, write to the Free Software Foundation, Inc.,
19  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 */
21 #ifndef SATYR_GDB_STACKTRACE_H
22 #define SATYR_GDB_STACKTRACE_H
23 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #include "../report_type.h"
34 #include <stdbool.h>
35 #include <stdint.h>
36 
37 struct sr_gdb_thread;
38 struct sr_gdb_frame;
39 struct sr_location;
40 
51 {
52  enum sr_report_type type;
53 
54  struct sr_gdb_thread *threads;
55 
63 
68 
79  uint32_t crash_tid;
80 };
81 
88 struct sr_gdb_stacktrace *
90 
97 void
98 sr_gdb_stacktrace_init(struct sr_gdb_stacktrace *stacktrace);
99 
106 void
107 sr_gdb_stacktrace_free(struct sr_gdb_stacktrace *stacktrace);
108 
117 struct sr_gdb_stacktrace *
118 sr_gdb_stacktrace_dup(struct sr_gdb_stacktrace *stacktrace);
119 
125 int
127 
136 void
138  struct sr_gdb_thread *thread);
139 
147 struct sr_gdb_thread *
149 
156 void
158  int depth);
159 
172 float
174 
189 float
191 
201 char *
203  bool verbose);
204 
216 struct sr_gdb_frame *
218 
226 void
228  uint32_t tid);
229 
270 struct sr_gdb_stacktrace *
271 sr_gdb_stacktrace_parse(const char **input,
272  struct sr_location *location);
273 
296 bool
297 sr_gdb_stacktrace_parse_header(const char **input,
298  struct sr_gdb_frame **frame,
299  struct sr_location *location);
300 
305 void
307 
322 char *
324  int max_frames);
325 
326 #ifdef __cplusplus
327 }
328 #endif
329 
330 #endif
void sr_gdb_stacktrace_set_libnames(struct sr_gdb_stacktrace *stacktrace)
char * sr_gdb_stacktrace_to_short_text(struct sr_gdb_stacktrace *stacktrace, int max_frames)
float sr_gdb_stacktrace_quality_complex(struct sr_gdb_stacktrace *stacktrace)
float sr_gdb_stacktrace_quality_simple(struct sr_gdb_stacktrace *stacktrace)
A thread of execution of a GDB-produced stack trace.
Definition: gdb/thread.h:46
void sr_gdb_stacktrace_remove_threads_except_one(struct sr_gdb_stacktrace *stacktrace, struct sr_gdb_thread *thread)
struct sr_gdb_stacktrace * sr_gdb_stacktrace_dup(struct sr_gdb_stacktrace *stacktrace)
struct sr_gdb_sharedlib * libs
bool sr_gdb_stacktrace_parse_header(const char **input, struct sr_gdb_frame **frame, struct sr_location *location)
struct sr_gdb_frame * crash
A function call of a GDB-produced stack trace.
Definition: gdb/frame.h:47
struct sr_gdb_stacktrace * sr_gdb_stacktrace_parse(const char **input, struct sr_location *location)
struct sr_gdb_stacktrace * sr_gdb_stacktrace_new(void)
A stack trace produced by GDB.
void sr_gdb_stacktrace_free(struct sr_gdb_stacktrace *stacktrace)
void sr_gdb_stacktrace_set_crash_tid(struct sr_gdb_stacktrace *stacktrace, uint32_t tid)
void sr_gdb_stacktrace_init(struct sr_gdb_stacktrace *stacktrace)
A location of a parser in the input stream.
Definition: location.h:42
struct sr_gdb_thread * sr_gdb_stacktrace_find_crash_thread(struct sr_gdb_stacktrace *stacktrace)
void sr_gdb_stacktrace_limit_frame_depth(struct sr_gdb_stacktrace *stacktrace, int depth)
A shared library memory location as reported by GDB.
Definition: sharedlib.h:45
int sr_gdb_stacktrace_get_thread_count(struct sr_gdb_stacktrace *stacktrace)
char * sr_gdb_stacktrace_to_text(struct sr_gdb_stacktrace *stacktrace, bool verbose)
struct sr_gdb_frame * sr_gdb_stacktrace_get_crash_frame(struct sr_gdb_stacktrace *stacktrace)