mruby 3.3.0
mruby is the lightweight implementation of the Ruby language
Loading...
Searching...
No Matches
debug.h
Go to the documentation of this file.
1
7#ifndef MRUBY_DEBUG_H
8#define MRUBY_DEBUG_H
9
10#include "common.h"
11
16
17typedef enum mrb_debug_line_type {
18 mrb_debug_line_ary = 0,
19 mrb_debug_line_flat_map,
20 mrb_debug_line_packed_map
22
24 uint32_t start_pos;
25 uint16_t line;
27
29 uint32_t start_pos;
30 mrb_sym filename_sym;
31 uint32_t line_entry_count;
32 mrb_debug_line_type line_type;
33 union {
34 const char *s;
35 void *ptr;
36 const uint16_t *ary;
37 const mrb_irep_debug_info_line *flat_map;
38 const uint8_t *packed_map;
39 } lines;
41
42typedef struct mrb_irep_debug_info {
43 uint32_t pc_count;
44 uint16_t flen;
47
48/*
49 * get filename from irep's debug info and program counter
50 * @return returns NULL if not found
51 */
52MRB_API const char *mrb_debug_get_filename(mrb_state *mrb, const mrb_irep *irep, uint32_t pc);
53
54/*
55 * get line from irep's debug info and program counter
56 * @return returns -1 if not found
57 */
58MRB_API int32_t mrb_debug_get_line(mrb_state *mrb, const mrb_irep *irep, uint32_t pc);
59
60/*
61 * get line and filename from irep's debug info and program counter
62 * @return returns FALSE if not found
63 */
64MRB_API mrb_bool mrb_debug_get_position(mrb_state *mrb, const mrb_irep *irep, uint32_t pc, int32_t *lp, const char **fp);
65
66MRB_API mrb_irep_debug_info *mrb_debug_info_alloc(mrb_state *mrb, mrb_irep *irep);
67MRB_API mrb_irep_debug_info_file *mrb_debug_info_append_file(
69 const char *filename, uint16_t *lines,
70 uint32_t start_pos, uint32_t end_pos);
71MRB_API void mrb_debug_info_free(mrb_state *mrb, mrb_irep_debug_info *d);
72
74
75#endif /* MRUBY_DEBUG_H */
mruby Boolean.
mruby Symbol.
mruby common platform definition"
#define MRB_END_DECL
End declarations in C mode.
Definition common.h:28
#define MRB_BEGIN_DECL
Start declarations in C mode.
Definition common.h:26
#define MRB_API
Declare a public mruby API function.
Definition common.h:79
mrb_debug_line_type
mruby Debugging.
Definition debug.h:17
Definition debug.h:28
Definition debug.h:23
Definition debug.h:42
Definition irep.h:55
Definition mruby.h:256