diff options
Diffstat (limited to 'pathologist/src/pathologist/action.h')
-rw-r--r-- | pathologist/src/pathologist/action.h | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/pathologist/src/pathologist/action.h b/pathologist/src/pathologist/action.h new file mode 100644 index 0000000..57b748b --- /dev/null +++ b/pathologist/src/pathologist/action.h | |||
@@ -0,0 +1,100 @@ | |||
1 | /** | ||
2 | * @file monkey/MONKEY_action.h | ||
3 | * @brief Monkey API for actions taken by Monkey while debugging | ||
4 | */ | ||
5 | |||
6 | #ifndef MONKEY_ACTION_H | ||
7 | #define MONKEY_ACTION_H | ||
8 | |||
9 | #include "gdbmi.h" | ||
10 | #include "pathologist_xml_writer.h" | ||
11 | |||
12 | #ifdef __cplusplus | ||
13 | extern "C" | ||
14 | { | ||
15 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
16 | } | ||
17 | #endif | ||
18 | #endif | ||
19 | |||
20 | |||
21 | /* Debug constants */ | ||
22 | #define DEBUG_MODE_GDB 0 | ||
23 | #define GDB_STATE_STOPPED 1 | ||
24 | #define GDB_STATE_EXIT_NORMALLY 2 | ||
25 | #define GDB_STATE_ERROR 3 | ||
26 | #define GDB_SAFETY_COUNT 2 | ||
27 | #define DEBUG_MODE_VALGRIND 4 | ||
28 | #define DEBUG_MODE_REPORT_READY 5 | ||
29 | #define NO_BUG_DETECTED -1 | ||
30 | #define BUG_NULL_POINTER 6 | ||
31 | #define BUG_ABORT 7 | ||
32 | #define BUG_ARITHMETIC 8 | ||
33 | #define BUG_BAD_MEM_ACCESS 9 | ||
34 | #define BUG_SIG_BUS 10 | ||
35 | #define GDB_MI_ASYNC_WAIT 5 | ||
36 | |||
37 | /** | ||
38 | * Context for the Action API | ||
39 | */ | ||
40 | struct MONKEY_ACTION_Context | ||
41 | { | ||
42 | const char *binary_name; | ||
43 | char *binaryArgs; | ||
44 | const char *email_address; | ||
45 | const char *expression_database_path; | ||
46 | const char *gdb_binary_path; | ||
47 | const char *valgrind_binary_path; | ||
48 | const char *inspect_expression; | ||
49 | const char *inspect_function; | ||
50 | int debug_mode; | ||
51 | int bug_detected; | ||
52 | int has_null; | ||
53 | char *debug_report; | ||
54 | struct MONKEY_XML_Node *xml_report_node; | ||
55 | |||
56 | /* gdb debugging attributes */ | ||
57 | int run_reverse; | ||
58 | int scope_depth; | ||
59 | mi_h *gdb_handle; | ||
60 | int gdb_connected; | ||
61 | const char *gdb_in_use; | ||
62 | mi_stop *gdb_stop_reason; | ||
63 | mi_frames *gdb_frames; | ||
64 | const char *gdb_null_variable; | ||
65 | |||
66 | /* Valgrind memcheck attributes */ | ||
67 | char* valgrind_output_tmp_file_name; | ||
68 | }; | ||
69 | |||
70 | |||
71 | int MONKEY_ACTION_report_file (struct MONKEY_ACTION_Context | ||
72 | *cntxt, const char *dumpFileName, int isXML); | ||
73 | int MONKEY_ACTION_report_email (struct MONKEY_ACTION_Context | ||
74 | *cntxt, const char *dumpFileName); | ||
75 | int MONKEY_ACTION_inspect_expression_database (struct | ||
76 | MONKEY_ACTION_Context | ||
77 | *cntxt); | ||
78 | int MONKEY_ACTION_rerun_with_gdb (struct MONKEY_ACTION_Context | ||
79 | *cntxt); | ||
80 | int MONKEY_ACTION_start_reverse_execution(struct MONKEY_ACTION_Context * cntxt); | ||
81 | int MONKEY_ACTION_rerun_with_valgrind (struct | ||
82 | MONKEY_ACTION_Context | ||
83 | *cntxt); | ||
84 | int MONKEY_ACTION_format_report (struct MONKEY_ACTION_Context | ||
85 | *cntxt); | ||
86 | int | ||
87 | MONKEY_ACTION_format_report_xml (struct MONKEY_ACTION_Context | ||
88 | *cntxt); | ||
89 | int MONKEY_ACTION_delete_context(struct MONKEY_ACTION_Context *cntxt); | ||
90 | |||
91 | int MONKEY_ACTION_check_bug_redundancy (void); | ||
92 | |||
93 | |||
94 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
95 | { | ||
96 | #endif | ||
97 | #ifdef __cplusplus | ||
98 | } | ||
99 | #endif | ||
100 | #endif | ||