satyr  0.28
js/stacktrace.h
Go to the documentation of this file.
1 /*
2  js_stacktrace.h
3 
4  Copyright (C) 2016 ABRT Team
5  Copyright (C) 2016 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_JS_STACKTRACE_H
22 #define SATYR_JS_STACKTRACE_H
23 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #include "platform.h"
34 #include "../report_type.h"
35 #include <stdint.h>
36 
37 struct sr_js_frame;
38 struct sr_location;
39 struct sr_json_value;
40 
42 {
43  enum sr_report_type type;
44 
45  char *exception_name;
46 
47  struct sr_js_frame *frames;
48 
49  sr_js_platform_t platform;
50 };
51 
52 struct sr_js_stacktrace *
53 sr_js_stacktrace_new(void);
54 
55 void
56 sr_js_stacktrace_init(struct sr_js_stacktrace *stacktrace);
57 
58 void
59 sr_js_stacktrace_free(struct sr_js_stacktrace *stacktrace);
60 
61 struct sr_js_stacktrace *
62 sr_js_stacktrace_dup(struct sr_js_stacktrace *stacktrace);
63 
64 struct sr_js_stacktrace *
65 sr_js_stacktrace_parse(const char **input,
66  struct sr_location *location);
67 
68 struct sr_js_stacktrace *
69 sr_js_stacktrace_parse_v8(const char **input,
70  struct sr_location *location);
71 
72 char *
73 sr_js_stacktrace_get_reason(struct sr_js_stacktrace *stacktrace);
74 
75 char *
76 sr_js_stacktrace_to_json(struct sr_js_stacktrace *stacktrace);
77 
78 struct sr_js_stacktrace *
79 sr_js_stacktrace_from_json(struct sr_json_value *root, char **error_message);
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif
Platform JavaScript platform.
A location of a parser in the input stream.
Definition: location.h:42