satyr  0.37
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 #include <glib.h>
36 
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 *
114 
121 void
123 
130 void
132 
146 struct sr_gdb_frame *
148  bool siblings);
149 
165 bool
167  const char *function_name,
168  ...);
169 
186 int
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 *
218  struct sr_gdb_frame *item);
219 
227 void
229  GString *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
266  uint32_t *number);
267 
279 int
281  GString *target);
282 
293 int
295  bool space_allowed,
296  char **target);
297 
307 int
309  char **target);
310 
316 int
318  char **target);
319 
330 int
332  char **target);
333 
356 bool
358  char **function_name,
359  char **function_type,
360  struct sr_location *location);
361 
373 bool
375  struct sr_location *location);
376 
393 bool
395  char **function_name,
396  char **function_type,
397  struct sr_location *location);
398 
421 bool
423  uint64_t *address,
424  char **function_name,
425  char **function_type,
426  struct sr_location *location);
427 
444 bool
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
sr_gdb_frame_parse_header
struct sr_gdb_frame * sr_gdb_frame_parse_header(const char **input, struct sr_location *location)
sr_gdb_frame_free
void sr_gdb_frame_free(struct sr_gdb_frame *frame)
sr_gdb_frame_cmp
int sr_gdb_frame_cmp(struct sr_gdb_frame *frame1, struct sr_gdb_frame *frame2, bool compare_number)
sr_gdb_frame_new
struct sr_gdb_frame * sr_gdb_frame_new(void)
sr_gdb_frame_parse_function_name_chunk
int sr_gdb_frame_parse_function_name_chunk(const char **input, bool space_allowed, char **target)
sr_gdb_frame::next
struct sr_gdb_frame * next
Definition: gdb/frame.h:103
sr_gdb_frame_cmp_distance
int sr_gdb_frame_cmp_distance(struct sr_gdb_frame *frame1, struct sr_gdb_frame *frame2)
sr_gdb_frame_parse_function_name_braces
int sr_gdb_frame_parse_function_name_braces(const char **input, char **target)
sr_gdb_frame::address
sr_gdb_frame_address_t address
Definition: gdb/frame.h:92
sr_gdb_frame_parse_frame_start
int sr_gdb_frame_parse_frame_start(const char **input, uint32_t *number)
sr_gdb_frame::function_name
char * function_name
Definition: gdb/frame.h:55
sr_gdb_frame_parse_function_name
bool sr_gdb_frame_parse_function_name(const char **input, char **function_name, char **function_type, struct sr_location *location)
sr_gdb_frame_append
struct sr_gdb_frame * sr_gdb_frame_append(struct sr_gdb_frame *dest, struct sr_gdb_frame *item)
sr_gdb_frame_parse_function_name_template_args
int sr_gdb_frame_parse_function_name_template_args(const char **input, char **target)
sr_gdb_frame_init
void sr_gdb_frame_init(struct sr_gdb_frame *frame)
sr_gdb_frame
A function call of a GDB-produced stack trace.
Definition: gdb/frame.h:48
sr_gdb_frame::library_name
char * library_name
Definition: gdb/frame.h:97
sr_gdb_frame_parse_function_call
bool sr_gdb_frame_parse_function_call(const char **input, char **function_name, char **function_type, struct sr_location *location)
sr_gdb_frame::signal_handler_called
bool signal_handler_called
Definition: gdb/frame.h:85
sr_gdb_frame::function_type
char * function_type
Definition: gdb/frame.h:60
sr_gdb_frame_parse_file_location
bool sr_gdb_frame_parse_file_location(const char **input, char **file, uint32_t *file_line, struct sr_location *location)
sr_gdb_frame_append_to_str
void sr_gdb_frame_append_to_str(struct sr_gdb_frame *frame, GString *dest, bool verbose)
sr_gdb_frame_dup
struct sr_gdb_frame * sr_gdb_frame_dup(struct sr_gdb_frame *frame, bool siblings)
sr_gdb_frame_parse_function_name_template
int sr_gdb_frame_parse_function_name_template(const char **input, char **target)
sr_gdb_frame::source_line
uint32_t source_line
Definition: gdb/frame.h:80
sr_location
A location of a parser in the input stream.
Definition: location.h:43
sr_gdb_frame_parse_address_in_function
bool sr_gdb_frame_parse_address_in_function(const char **input, uint64_t *address, char **function_name, char **function_type, struct sr_location *location)
sr_gdb_frame::source_file
char * source_file
Definition: gdb/frame.h:74
sr_gdb_frame_parse
struct sr_gdb_frame * sr_gdb_frame_parse(const char **input, struct sr_location *location)
sr_gdb_frame_calls_func
bool sr_gdb_frame_calls_func(struct sr_gdb_frame *frame, const char *function_name,...)
sr_gdb_frame_skip_function_args
bool sr_gdb_frame_skip_function_args(const char **input, struct sr_location *location)
sr_gdb_frame_parseadd_operator
int sr_gdb_frame_parseadd_operator(const char **input, GString *target)
sr_gdb_frame::number
uint32_t number
Definition: gdb/frame.h:67