satyr  0.28
gdb/frame.h
Go to the documentation of this file.
1 /*
2  gdb_frame.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_GDB_FRAME_H
21 #define SATYR_GDB_FRAME_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_strbuf;
37 struct sr_location;
38 
39 typedef uint64_t sr_gdb_frame_address_t;
40 
48 {
49  enum sr_report_type type;
50 
56 
61 
67  uint32_t number;
68 
74  char *source_file;
75 
80  uint32_t source_line;
81 
86 
92  sr_gdb_frame_address_t address;
93 
97  char *library_name;
98 
104 };
105 
112 struct sr_gdb_frame *
113 sr_gdb_frame_new(void);
114 
121 void
122 sr_gdb_frame_init(struct sr_gdb_frame *frame);
123 
130 void
131 sr_gdb_frame_free(struct sr_gdb_frame *frame);
132 
146 struct sr_gdb_frame *
147 sr_gdb_frame_dup(struct sr_gdb_frame *frame,
148  bool siblings);
149 
165 bool
167  const char *function_name,
168  ...);
169 
186 int
187 sr_gdb_frame_cmp(struct sr_gdb_frame *frame1,
188  struct sr_gdb_frame *frame2,
189  bool compare_number);
190 
206 int
208  struct sr_gdb_frame *frame2);
209 
216 struct sr_gdb_frame *
217 sr_gdb_frame_append(struct sr_gdb_frame *dest,
218  struct sr_gdb_frame *item);
219 
227 void
229  struct sr_strbuf *dest,
230  bool verbose);
231 
248 struct sr_gdb_frame *
249 sr_gdb_frame_parse(const char **input,
250  struct sr_location *location);
251 
264 int
265 sr_gdb_frame_parse_frame_start(const char **input,
266  uint32_t *number);
267 
279 int
280 sr_gdb_frame_parseadd_operator(const char **input,
281  struct sr_strbuf *target);
282 
293 int
294 sr_gdb_frame_parse_function_name_chunk(const char **input,
295  bool space_allowed,
296  char **target);
297 
307 int
308 sr_gdb_frame_parse_function_name_braces(const char **input,
309  char **target);
310 
316 int
318  char **target);
319 
330 int
332  char **target);
333 
356 bool
357 sr_gdb_frame_parse_function_name(const char **input,
358  char **function_name,
359  char **function_type,
360  struct sr_location *location);
361 
373 bool
374 sr_gdb_frame_skip_function_args(const char **input,
375  struct sr_location *location);
376 
393 bool
394 sr_gdb_frame_parse_function_call(const char **input,
395  char **function_name,
396  char **function_type,
397  struct sr_location *location);
398 
421 bool
422 sr_gdb_frame_parse_address_in_function(const char **input,
423  uint64_t *address,
424  char **function_name,
425  char **function_type,
426  struct sr_location *location);
427 
444 bool
445 sr_gdb_frame_parse_file_location(const char **input,
446  char **file,
447  uint32_t *file_line,
448  struct sr_location *location);
449 
467 struct sr_gdb_frame *
468 sr_gdb_frame_parse_header(const char **input,
469  struct sr_location *location);
470 
471 #ifdef __cplusplus
472 }
473 #endif
474 
475 #endif
int sr_gdb_frame_cmp(struct sr_gdb_frame *frame1, struct sr_gdb_frame *frame2, bool compare_number)
void sr_gdb_frame_append_to_str(struct sr_gdb_frame *frame, struct sr_strbuf *dest, bool verbose)
bool sr_gdb_frame_parse_address_in_function(const char **input, uint64_t *address, char **function_name, char **function_type, struct sr_location *location)
int sr_gdb_frame_parse_function_name_braces(const char **input, char **target)
struct sr_gdb_frame * sr_gdb_frame_dup(struct sr_gdb_frame *frame, bool siblings)
bool sr_gdb_frame_skip_function_args(const char **input, struct sr_location *location)
sr_gdb_frame_address_t address
Definition: gdb/frame.h:92
char * function_type
Definition: gdb/frame.h:60
struct sr_gdb_frame * sr_gdb_frame_new(void)
int sr_gdb_frame_parse_frame_start(const char **input, uint32_t *number)
int sr_gdb_frame_parseadd_operator(const char **input, struct sr_strbuf *target)
A resizable string buffer.
Definition: strbuf.h:38
void sr_gdb_frame_free(struct sr_gdb_frame *frame)
char * library_name
Definition: gdb/frame.h:97
bool signal_handler_called
Definition: gdb/frame.h:85
bool sr_gdb_frame_parse_function_call(const char **input, char **function_name, char **function_type, struct sr_location *location)
struct sr_gdb_frame * next
Definition: gdb/frame.h:103
A function call of a GDB-produced stack trace.
Definition: gdb/frame.h:47
uint32_t source_line
Definition: gdb/frame.h:80
uint32_t number
Definition: gdb/frame.h:67
int sr_gdb_frame_cmp_distance(struct sr_gdb_frame *frame1, struct sr_gdb_frame *frame2)
struct sr_gdb_frame * sr_gdb_frame_append(struct sr_gdb_frame *dest, struct sr_gdb_frame *item)
struct sr_gdb_frame * sr_gdb_frame_parse(const char **input, struct sr_location *location)
char * source_file
Definition: gdb/frame.h:74
void sr_gdb_frame_init(struct sr_gdb_frame *frame)
A location of a parser in the input stream.
Definition: location.h:42
char * function_name
Definition: gdb/frame.h:55
struct sr_gdb_frame * sr_gdb_frame_parse_header(const char **input, struct sr_location *location)
bool sr_gdb_frame_calls_func(struct sr_gdb_frame *frame, const char *function_name,...)
int sr_gdb_frame_parse_function_name_chunk(const char **input, bool space_allowed, char **target)
bool sr_gdb_frame_parse_function_name(const char **input, char **function_name, char **function_type, struct sr_location *location)
int sr_gdb_frame_parse_function_name_template(const char **input, char **target)
bool sr_gdb_frame_parse_file_location(const char **input, char **file, uint32_t *file_line, struct sr_location *location)
int sr_gdb_frame_parse_function_name_template_args(const char **input, char **target)