satyr  0.24.15.g3735.dirty
gdb/thread.h
Go to the documentation of this file.
1 /*
2  gdb_thread.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_GDB_THREAD_H
21 #define SATYR_GDB_THREAD_H
22 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #include "../report_type.h"
33 #include <stdbool.h>
34 #include <stdint.h>
35 
36 struct sr_gdb_frame;
37 struct sr_strbuf;
38 struct sr_location;
39 struct sr_gdb_sharedlib;
40 
47 {
48  enum sr_report_type type;
49 
50  uint32_t number;
51 
56 
62 
67  uint32_t tid;
68 };
69 
76 struct sr_gdb_thread *
77 sr_gdb_thread_new(void);
78 
85 void
86 sr_gdb_thread_init(struct sr_gdb_thread *thread);
87 
94 void
95 sr_gdb_thread_free(struct sr_gdb_thread *thread);
96 
107 struct sr_gdb_thread *
108 sr_gdb_thread_dup(struct sr_gdb_thread *thread,
109  bool siblings);
110 
119 int
120 sr_gdb_thread_cmp(struct sr_gdb_thread *thread1,
121  struct sr_gdb_thread *thread2);
122 
128 struct sr_gdb_thread *
130  struct sr_gdb_thread *item);
131 
141 void
143  int *ok_count,
144  int *all_count);
145 
158 float
159 sr_gdb_thread_quality(struct sr_gdb_thread *thread);
160 
167 bool
169  struct sr_gdb_frame *frame);
170 
179 bool
181  struct sr_gdb_frame *frame);
182 
186 void
188  int n);
189 
193 void
195  struct sr_strbuf *dest,
196  bool verbose);
197 
213 struct sr_gdb_thread *
214 sr_gdb_thread_parse(const char **input,
215  struct sr_location *location);
216 
227 int
228 sr_gdb_thread_parse_lwp(const char **input, uint32_t *tid);
229 
233 int
234 sr_gdb_thread_skip_lwp(const char **input);
235 
245 struct sr_gdb_thread *
246 sr_gdb_thread_parse_funs(const char *input);
247 
256 char *
258 
263 void
265  struct sr_gdb_sharedlib *libs);
266 
270 struct sr_gdb_thread *
272  struct sr_gdb_sharedlib *libs, int max_frames);
273 #ifdef __cplusplus
274 }
275 #endif
276 
277 #endif
int sr_gdb_thread_cmp(struct sr_gdb_thread *thread1, struct sr_gdb_thread *thread2)
char * sr_gdb_thread_format_funs(struct sr_gdb_thread *thread)
A thread of execution of a GDB-produced stack trace.
Definition: gdb/thread.h:46
struct sr_gdb_thread * sr_gdb_thread_parse(const char **input, struct sr_location *location)
int sr_gdb_thread_skip_lwp(const char **input)
struct sr_gdb_thread * sr_gdb_thread_new(void)
struct sr_gdb_frame * frames
Definition: gdb/thread.h:55
void sr_gdb_thread_free(struct sr_gdb_thread *thread)
A resizable string buffer.
Definition: strbuf.h:38
uint32_t tid
Definition: gdb/thread.h:67
float sr_gdb_thread_quality(struct sr_gdb_thread *thread)
struct sr_gdb_thread * sr_gdb_thread_parse_funs(const char *input)
void sr_gdb_thread_init(struct sr_gdb_thread *thread)
struct sr_gdb_thread * sr_gdb_thread_dup(struct sr_gdb_thread *thread, bool siblings)
bool sr_gdb_thread_remove_frame(struct sr_gdb_thread *thread, struct sr_gdb_frame *frame)
bool sr_gdb_thread_remove_frames_above(struct sr_gdb_thread *thread, struct sr_gdb_frame *frame)
A function call of a GDB-produced stack trace.
Definition: gdb/frame.h:47
struct sr_gdb_thread * next
Definition: gdb/thread.h:61
struct sr_gdb_thread * sr_gdb_thread_append(struct sr_gdb_thread *dest, struct sr_gdb_thread *item)
void sr_gdb_thread_remove_frames_below_n(struct sr_gdb_thread *thread, int n)
struct sr_gdb_thread * sr_gdb_thread_get_optimized(struct sr_gdb_thread *thread, struct sr_gdb_sharedlib *libs, int max_frames)
A location of a parser in the input stream.
Definition: location.h:42
void sr_gdb_thread_set_libnames(struct sr_gdb_thread *thread, struct sr_gdb_sharedlib *libs)
A shared library memory location as reported by GDB.
Definition: sharedlib.h:45
void sr_gdb_thread_quality_counts(struct sr_gdb_thread *thread, int *ok_count, int *all_count)
void sr_gdb_thread_append_to_str(struct sr_gdb_thread *thread, struct sr_strbuf *dest, bool verbose)
int sr_gdb_thread_parse_lwp(const char **input, uint32_t *tid)