source: EcnlProtoTool/trunk/mruby-2.1.1/include/mruby/debug.h@ 439

Last change on this file since 439 was 439, checked in by coas-nagasima, 4 years ago

mrubyを2.1.1に更新

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 1.6 KB
Line 
1/**
2** @file mruby/debug.h - mruby debug info
3**
4** See Copyright Notice in mruby.h
5*/
6
7#ifndef MRUBY_DEBUG_H
8#define MRUBY_DEBUG_H
9
10#include "common.h"
11
12/**
13 * MRuby Debugging.
14 */
15MRB_BEGIN_DECL
16
17typedef enum mrb_debug_line_type {
18 mrb_debug_line_ary = 0,
19 mrb_debug_line_flat_map = 1
20} mrb_debug_line_type;
21
22typedef struct mrb_irep_debug_info_line {
23 uint32_t start_pos;
24 uint16_t line;
25} mrb_irep_debug_info_line;
26
27typedef struct mrb_irep_debug_info_file {
28 uint32_t start_pos;
29 mrb_sym filename_sym;
30 uint32_t line_entry_count;
31 mrb_debug_line_type line_type;
32 union {
33 void *ptr;
34 mrb_irep_debug_info_line *flat_map;
35 uint16_t *ary;
36 } lines;
37} mrb_irep_debug_info_file;
38
39typedef struct mrb_irep_debug_info {
40 uint32_t pc_count;
41 uint16_t flen;
42 mrb_irep_debug_info_file **files;
43} mrb_irep_debug_info;
44
45/*
46 * get line from irep's debug info and program counter
47 * @return returns NULL if not found
48 */
49MRB_API const char *mrb_debug_get_filename(mrb_state *mrb, mrb_irep *irep, ptrdiff_t pc);
50
51/*
52 * get line from irep's debug info and program counter
53 * @return returns -1 if not found
54 */
55MRB_API int32_t mrb_debug_get_line(mrb_state *mrb, mrb_irep *irep, ptrdiff_t pc);
56
57MRB_API mrb_irep_debug_info *mrb_debug_info_alloc(mrb_state *mrb, mrb_irep *irep);
58MRB_API mrb_irep_debug_info_file *mrb_debug_info_append_file(
59 mrb_state *mrb, mrb_irep_debug_info *info,
60 const char *filename, uint16_t *lines,
61 uint32_t start_pos, uint32_t end_pos);
62MRB_API void mrb_debug_info_free(mrb_state *mrb, mrb_irep_debug_info *d);
63
64MRB_END_DECL
65
66#endif /* MRUBY_DEBUG_H */
Note: See TracBrowser for help on using the repository browser.