satyr  0.37
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
99 
106 void
108 
117 struct sr_gdb_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
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
sr_gdb_stacktrace_free
void sr_gdb_stacktrace_free(struct sr_gdb_stacktrace *stacktrace)
sr_gdb_stacktrace_to_text
char * sr_gdb_stacktrace_to_text(struct sr_gdb_stacktrace *stacktrace, bool verbose)
sr_gdb_stacktrace_get_crash_frame
struct sr_gdb_frame * sr_gdb_stacktrace_get_crash_frame(struct sr_gdb_stacktrace *stacktrace)
sr_gdb_stacktrace_dup
struct sr_gdb_stacktrace * sr_gdb_stacktrace_dup(struct sr_gdb_stacktrace *stacktrace)
sr_gdb_stacktrace
A stack trace produced by GDB.
Definition: gdb/stacktrace.h:51
sr_gdb_sharedlib
A shared library memory location as reported by GDB.
Definition: sharedlib.h:46
sr_gdb_stacktrace_find_crash_thread
struct sr_gdb_thread * sr_gdb_stacktrace_find_crash_thread(struct sr_gdb_stacktrace *stacktrace)
sr_gdb_stacktrace_to_short_text
char * sr_gdb_stacktrace_to_short_text(struct sr_gdb_stacktrace *stacktrace, int max_frames)
sr_gdb_stacktrace_set_crash_tid
void sr_gdb_stacktrace_set_crash_tid(struct sr_gdb_stacktrace *stacktrace, uint32_t tid)
sr_gdb_stacktrace_init
void sr_gdb_stacktrace_init(struct sr_gdb_stacktrace *stacktrace)
sr_gdb_stacktrace_set_libnames
void sr_gdb_stacktrace_set_libnames(struct sr_gdb_stacktrace *stacktrace)
sr_gdb_stacktrace::crash_tid
uint32_t crash_tid
Definition: gdb/stacktrace.h:79
sr_gdb_frame
A function call of a GDB-produced stack trace.
Definition: gdb/frame.h:48
sr_gdb_stacktrace_get_thread_count
int sr_gdb_stacktrace_get_thread_count(struct sr_gdb_stacktrace *stacktrace)
sr_gdb_stacktrace_parse_header
bool sr_gdb_stacktrace_parse_header(const char **input, struct sr_gdb_frame **frame, struct sr_location *location)
sr_location
A location of a parser in the input stream.
Definition: location.h:43
sr_gdb_stacktrace_quality_complex
float sr_gdb_stacktrace_quality_complex(struct sr_gdb_stacktrace *stacktrace)
sr_gdb_stacktrace::crash
struct sr_gdb_frame * crash
Definition: gdb/stacktrace.h:62
sr_gdb_stacktrace_quality_simple
float sr_gdb_stacktrace_quality_simple(struct sr_gdb_stacktrace *stacktrace)
sr_gdb_stacktrace_remove_threads_except_one
void sr_gdb_stacktrace_remove_threads_except_one(struct sr_gdb_stacktrace *stacktrace, struct sr_gdb_thread *thread)
sr_gdb_stacktrace_parse
struct sr_gdb_stacktrace * sr_gdb_stacktrace_parse(const char **input, struct sr_location *location)
sr_gdb_stacktrace_new
struct sr_gdb_stacktrace * sr_gdb_stacktrace_new(void)
sr_gdb_thread
A thread of execution of a GDB-produced stack trace.
Definition: gdb/thread.h:47
sr_gdb_stacktrace_limit_frame_depth
void sr_gdb_stacktrace_limit_frame_depth(struct sr_gdb_stacktrace *stacktrace, int depth)
sr_gdb_stacktrace::libs
struct sr_gdb_sharedlib * libs
Definition: gdb/stacktrace.h:67