forked from mruby/mruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.h
More file actions
65 lines (54 loc) · 1.48 KB
/
debug.h
File metadata and controls
65 lines (54 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
** mruby/debug.h - mruby debug info
**
** See Copyright Notice in mruby.h
*/
#ifndef MRUBY_DEBUG_H
#define MRUBY_DEBUG_H
#if defined(__cplusplus)
extern "C" {
#endif
typedef enum mrb_debug_line_type {
mrb_debug_line_ary = 0,
mrb_debug_line_flat_map = 1
} mrb_debug_line_type;
typedef struct mrb_irep_debug_info_line {
uint32_t start_pos;
uint16_t line;
} mrb_irep_debug_info_line;
typedef struct mrb_irep_debug_info_file {
uint32_t start_pos;
const char *filename;
mrb_sym filename_sym;
uint32_t line_entry_count;
mrb_debug_line_type line_type;
union {
void *line_ptr;
mrb_irep_debug_info_line *line_flat_map;
uint16_t *line_ary;
};
} mrb_irep_debug_info_file;
typedef struct mrb_irep_debug_info {
uint32_t pc_count;
uint16_t flen;
mrb_irep_debug_info_file **files;
} mrb_irep_debug_info;
/*
* get line from irep's debug info and program counter
* @return returns NULL if not found
*/
const char *mrb_debug_get_filename(mrb_irep *irep, uint32_t pc);
/*
* get line from irep's debug info and program counter
* @return returns -1 if not found
*/
int32_t mrb_debug_get_line(mrb_irep *irep, uint32_t pc);
mrb_irep_debug_info_file *mrb_debug_info_append_file(
mrb_state *mrb, mrb_irep *irep,
uint32_t start_pos, uint32_t end_pos);
mrb_irep_debug_info *mrb_debug_info_alloc(mrb_state *mrb, mrb_irep *irep);
void mrb_debug_info_free(mrb_state *mrb, mrb_irep_debug_info *d);
#if defined(__cplusplus)
} /* extern "C" { */
#endif
#endif /* MRUBY_DEBUG_H */