ruby-debug-base19x 0.11.28 → 0.11.29
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +10 -10
- data/CHANGES +334 -334
- data/LICENSE +22 -22
- data/README +122 -122
- data/Rakefile +27 -138
- data/ext/ruby_debug/breakpoint.c +586 -586
- data/ext/ruby_debug/extconf.rb +27 -23
- data/ext/ruby_debug/ruby_debug.c +2609 -2642
- data/ext/ruby_debug/ruby_debug.h +148 -148
- data/lib/ChangeLog +1065 -1065
- data/lib/ruby-debug-base.rb +304 -304
- metadata +20 -42
- data/test/base/base.rb +0 -74
- data/test/base/binding.rb +0 -31
- data/test/base/catchpoint.rb +0 -26
data/ext/ruby_debug/ruby_debug.h
CHANGED
@@ -1,148 +1,148 @@
|
|
1
|
-
/* Context info */
|
2
|
-
enum ctx_stop_reason {CTX_STOP_NONE, CTX_STOP_STEP, CTX_STOP_BREAKPOINT,
|
3
|
-
CTX_STOP_CATCHPOINT};
|
4
|
-
|
5
|
-
/* Context flags */
|
6
|
-
#define CTX_FL_SUSPEND (1<<1)
|
7
|
-
#define CTX_FL_TRACING (1<<2)
|
8
|
-
#define CTX_FL_SKIPPED (1<<3)
|
9
|
-
#define CTX_FL_IGNORE (1<<4)
|
10
|
-
#define CTX_FL_DEAD (1<<5)
|
11
|
-
#define CTX_FL_WAS_RUNNING (1<<6)
|
12
|
-
#define CTX_FL_ENABLE_BKPT (1<<7)
|
13
|
-
#define CTX_FL_STEPPED (1<<8)
|
14
|
-
#define CTX_FL_FORCE_MOVE (1<<9)
|
15
|
-
#define CTX_FL_CATCHING (1<<10)
|
16
|
-
|
17
|
-
#define CTX_FL_TEST(c,f) ((c)->flags & (f))
|
18
|
-
#define CTX_FL_SET(c,f) do { (c)->flags |= (f); } while (0)
|
19
|
-
#define CTX_FL_UNSET(c,f) do { (c)->flags &= ~(f); } while (0)
|
20
|
-
|
21
|
-
typedef struct {
|
22
|
-
struct iseq_catch_table_entry tmp_catch_table;
|
23
|
-
struct iseq_catch_table_entry *old_catch_table;
|
24
|
-
int old_catch_table_size;
|
25
|
-
VALUE mod_name;
|
26
|
-
VALUE errinfo;
|
27
|
-
} debug_catch_t;
|
28
|
-
|
29
|
-
typedef struct {
|
30
|
-
struct rb_iseq_struct *iseq;
|
31
|
-
struct iseq_catch_table_entry *catch_table;
|
32
|
-
int catch_table_size;
|
33
|
-
} iseq_catch_t;
|
34
|
-
|
35
|
-
typedef struct {
|
36
|
-
int argc; /* Number of arguments a frame should have. */
|
37
|
-
VALUE binding;
|
38
|
-
ID id;
|
39
|
-
ID orig_id;
|
40
|
-
int line;
|
41
|
-
const char * file;
|
42
|
-
short dead;
|
43
|
-
VALUE self;
|
44
|
-
VALUE arg_ary;
|
45
|
-
union {
|
46
|
-
struct {
|
47
|
-
rb_control_frame_t *cfp;
|
48
|
-
VALUE *bp;
|
49
|
-
struct rb_iseq_struct *block_iseq;
|
50
|
-
VALUE *block_pc;
|
51
|
-
VALUE *last_pc;
|
52
|
-
} runtime;
|
53
|
-
struct {
|
54
|
-
VALUE args;
|
55
|
-
VALUE locals;
|
56
|
-
VALUE arg_ary;
|
57
|
-
} copy;
|
58
|
-
} info;
|
59
|
-
} debug_frame_t;
|
60
|
-
|
61
|
-
typedef struct {
|
62
|
-
VALUE thread_id;
|
63
|
-
int thnum;
|
64
|
-
int flags;
|
65
|
-
enum ctx_stop_reason stop_reason;
|
66
|
-
int stop_next;
|
67
|
-
int dest_frame;
|
68
|
-
int stop_line;
|
69
|
-
int stop_frame;
|
70
|
-
int stack_size;
|
71
|
-
int stack_len;
|
72
|
-
debug_frame_t *frames;
|
73
|
-
const char * last_file;
|
74
|
-
int last_line;
|
75
|
-
VALUE breakpoint;
|
76
|
-
debug_catch_t catch_table;
|
77
|
-
VALUE saved_jump_ins[2];
|
78
|
-
rb_control_frame_t *jump_cfp;
|
79
|
-
VALUE *jump_pc;
|
80
|
-
iseq_catch_t *old_iseq_catch;
|
81
|
-
volatile int thread_pause;
|
82
|
-
} debug_context_t;
|
83
|
-
|
84
|
-
/* variables in ruby_debug.c */
|
85
|
-
extern VALUE mDebugger;
|
86
|
-
extern VALUE rdebug_breakpoints;
|
87
|
-
extern VALUE rdebug_catchpoints;
|
88
|
-
extern VALUE rdebug_threads_tbl;
|
89
|
-
|
90
|
-
/* routines in ruby_debug.c */
|
91
|
-
extern int filename_cmp(VALUE source, char *file);
|
92
|
-
|
93
|
-
#define IS_STARTED (rdebug_threads_tbl != Qnil)
|
94
|
-
static inline void
|
95
|
-
debug_check_started()
|
96
|
-
{
|
97
|
-
if(!IS_STARTED)
|
98
|
-
{
|
99
|
-
rb_raise(rb_eRuntimeError, "Debugger.start is not called yet.");
|
100
|
-
}
|
101
|
-
}
|
102
|
-
|
103
|
-
static inline int
|
104
|
-
classname_cmp(VALUE name, VALUE klass)
|
105
|
-
{
|
106
|
-
VALUE mod_name;
|
107
|
-
VALUE class_name = (Qnil == name) ? rb_str_new2("main") : name;
|
108
|
-
if (klass == Qnil) return(0);
|
109
|
-
mod_name = rb_mod_name(klass);
|
110
|
-
return (mod_name != Qnil
|
111
|
-
&& rb_str_cmp(class_name, mod_name) == 0);
|
112
|
-
}
|
113
|
-
|
114
|
-
/* Breakpoint information */
|
115
|
-
enum bp_type {BP_POS_TYPE, BP_METHOD_TYPE};
|
116
|
-
enum hit_condition {HIT_COND_NONE, HIT_COND_GE, HIT_COND_EQ, HIT_COND_MOD};
|
117
|
-
|
118
|
-
typedef struct {
|
119
|
-
int id;
|
120
|
-
enum bp_type type;
|
121
|
-
VALUE source;
|
122
|
-
union
|
123
|
-
{
|
124
|
-
int line;
|
125
|
-
ID mid;
|
126
|
-
} pos;
|
127
|
-
VALUE expr;
|
128
|
-
VALUE enabled;
|
129
|
-
int hit_count;
|
130
|
-
int hit_value;
|
131
|
-
enum hit_condition hit_condition;
|
132
|
-
} debug_breakpoint_t;
|
133
|
-
|
134
|
-
/* routines in breakpoint.c */
|
135
|
-
extern int check_breakpoint_expression(VALUE breakpoint, VALUE binding);
|
136
|
-
extern int check_breakpoint_hit_condition(VALUE breakpoint);
|
137
|
-
extern VALUE check_breakpoints_by_method(debug_context_t *debug_context,
|
138
|
-
VALUE klass, ID mid, VALUE self);
|
139
|
-
extern VALUE check_breakpoints_by_pos(debug_context_t *debug_context,
|
140
|
-
char *file, int line);
|
141
|
-
extern VALUE create_breakpoint_from_args(int argc, VALUE *argv, int id);
|
142
|
-
extern VALUE context_breakpoint(VALUE self);
|
143
|
-
extern VALUE context_set_breakpoint(int argc, VALUE *argv, VALUE self);
|
144
|
-
extern VALUE rdebug_add_catchpoint(VALUE self, VALUE value);
|
145
|
-
extern VALUE debug_catchpoints(VALUE self);
|
146
|
-
extern VALUE rdebug_remove_breakpoint(VALUE self, VALUE id_value);
|
147
|
-
|
148
|
-
extern void Init_breakpoint();
|
1
|
+
/* Context info */
|
2
|
+
enum ctx_stop_reason {CTX_STOP_NONE, CTX_STOP_STEP, CTX_STOP_BREAKPOINT,
|
3
|
+
CTX_STOP_CATCHPOINT};
|
4
|
+
|
5
|
+
/* Context flags */
|
6
|
+
#define CTX_FL_SUSPEND (1<<1)
|
7
|
+
#define CTX_FL_TRACING (1<<2)
|
8
|
+
#define CTX_FL_SKIPPED (1<<3)
|
9
|
+
#define CTX_FL_IGNORE (1<<4)
|
10
|
+
#define CTX_FL_DEAD (1<<5)
|
11
|
+
#define CTX_FL_WAS_RUNNING (1<<6)
|
12
|
+
#define CTX_FL_ENABLE_BKPT (1<<7)
|
13
|
+
#define CTX_FL_STEPPED (1<<8)
|
14
|
+
#define CTX_FL_FORCE_MOVE (1<<9)
|
15
|
+
#define CTX_FL_CATCHING (1<<10)
|
16
|
+
|
17
|
+
#define CTX_FL_TEST(c,f) ((c)->flags & (f))
|
18
|
+
#define CTX_FL_SET(c,f) do { (c)->flags |= (f); } while (0)
|
19
|
+
#define CTX_FL_UNSET(c,f) do { (c)->flags &= ~(f); } while (0)
|
20
|
+
|
21
|
+
typedef struct {
|
22
|
+
struct iseq_catch_table_entry tmp_catch_table;
|
23
|
+
struct iseq_catch_table_entry *old_catch_table;
|
24
|
+
int old_catch_table_size;
|
25
|
+
VALUE mod_name;
|
26
|
+
VALUE errinfo;
|
27
|
+
} debug_catch_t;
|
28
|
+
|
29
|
+
typedef struct {
|
30
|
+
struct rb_iseq_struct *iseq;
|
31
|
+
struct iseq_catch_table_entry *catch_table;
|
32
|
+
int catch_table_size;
|
33
|
+
} iseq_catch_t;
|
34
|
+
|
35
|
+
typedef struct {
|
36
|
+
int argc; /* Number of arguments a frame should have. */
|
37
|
+
VALUE binding;
|
38
|
+
ID id;
|
39
|
+
ID orig_id;
|
40
|
+
int line;
|
41
|
+
const char * file;
|
42
|
+
short dead;
|
43
|
+
VALUE self;
|
44
|
+
VALUE arg_ary;
|
45
|
+
union {
|
46
|
+
struct {
|
47
|
+
rb_control_frame_t *cfp;
|
48
|
+
VALUE *bp;
|
49
|
+
struct rb_iseq_struct *block_iseq;
|
50
|
+
VALUE *block_pc;
|
51
|
+
VALUE *last_pc;
|
52
|
+
} runtime;
|
53
|
+
struct {
|
54
|
+
VALUE args;
|
55
|
+
VALUE locals;
|
56
|
+
VALUE arg_ary;
|
57
|
+
} copy;
|
58
|
+
} info;
|
59
|
+
} debug_frame_t;
|
60
|
+
|
61
|
+
typedef struct {
|
62
|
+
VALUE thread_id;
|
63
|
+
int thnum;
|
64
|
+
int flags;
|
65
|
+
enum ctx_stop_reason stop_reason;
|
66
|
+
int stop_next;
|
67
|
+
int dest_frame;
|
68
|
+
int stop_line;
|
69
|
+
int stop_frame;
|
70
|
+
int stack_size;
|
71
|
+
int stack_len;
|
72
|
+
debug_frame_t *frames;
|
73
|
+
const char * last_file;
|
74
|
+
int last_line;
|
75
|
+
VALUE breakpoint;
|
76
|
+
debug_catch_t catch_table;
|
77
|
+
VALUE saved_jump_ins[2];
|
78
|
+
rb_control_frame_t *jump_cfp;
|
79
|
+
VALUE *jump_pc;
|
80
|
+
iseq_catch_t *old_iseq_catch;
|
81
|
+
volatile int thread_pause;
|
82
|
+
} debug_context_t;
|
83
|
+
|
84
|
+
/* variables in ruby_debug.c */
|
85
|
+
extern VALUE mDebugger;
|
86
|
+
extern VALUE rdebug_breakpoints;
|
87
|
+
extern VALUE rdebug_catchpoints;
|
88
|
+
extern VALUE rdebug_threads_tbl;
|
89
|
+
|
90
|
+
/* routines in ruby_debug.c */
|
91
|
+
extern int filename_cmp(VALUE source, char *file);
|
92
|
+
|
93
|
+
#define IS_STARTED (rdebug_threads_tbl != Qnil)
|
94
|
+
static inline void
|
95
|
+
debug_check_started()
|
96
|
+
{
|
97
|
+
if(!IS_STARTED)
|
98
|
+
{
|
99
|
+
rb_raise(rb_eRuntimeError, "Debugger.start is not called yet.");
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
103
|
+
static inline int
|
104
|
+
classname_cmp(VALUE name, VALUE klass)
|
105
|
+
{
|
106
|
+
VALUE mod_name;
|
107
|
+
VALUE class_name = (Qnil == name) ? rb_str_new2("main") : name;
|
108
|
+
if (klass == Qnil) return(0);
|
109
|
+
mod_name = rb_mod_name(klass);
|
110
|
+
return (mod_name != Qnil
|
111
|
+
&& rb_str_cmp(class_name, mod_name) == 0);
|
112
|
+
}
|
113
|
+
|
114
|
+
/* Breakpoint information */
|
115
|
+
enum bp_type {BP_POS_TYPE, BP_METHOD_TYPE};
|
116
|
+
enum hit_condition {HIT_COND_NONE, HIT_COND_GE, HIT_COND_EQ, HIT_COND_MOD};
|
117
|
+
|
118
|
+
typedef struct {
|
119
|
+
int id;
|
120
|
+
enum bp_type type;
|
121
|
+
VALUE source;
|
122
|
+
union
|
123
|
+
{
|
124
|
+
int line;
|
125
|
+
ID mid;
|
126
|
+
} pos;
|
127
|
+
VALUE expr;
|
128
|
+
VALUE enabled;
|
129
|
+
int hit_count;
|
130
|
+
int hit_value;
|
131
|
+
enum hit_condition hit_condition;
|
132
|
+
} debug_breakpoint_t;
|
133
|
+
|
134
|
+
/* routines in breakpoint.c */
|
135
|
+
extern int check_breakpoint_expression(VALUE breakpoint, VALUE binding);
|
136
|
+
extern int check_breakpoint_hit_condition(VALUE breakpoint);
|
137
|
+
extern VALUE check_breakpoints_by_method(debug_context_t *debug_context,
|
138
|
+
VALUE klass, ID mid, VALUE self);
|
139
|
+
extern VALUE check_breakpoints_by_pos(debug_context_t *debug_context,
|
140
|
+
char *file, int line);
|
141
|
+
extern VALUE create_breakpoint_from_args(int argc, VALUE *argv, int id);
|
142
|
+
extern VALUE context_breakpoint(VALUE self);
|
143
|
+
extern VALUE context_set_breakpoint(int argc, VALUE *argv, VALUE self);
|
144
|
+
extern VALUE rdebug_add_catchpoint(VALUE self, VALUE value);
|
145
|
+
extern VALUE debug_catchpoints(VALUE self);
|
146
|
+
extern VALUE rdebug_remove_breakpoint(VALUE self, VALUE id_value);
|
147
|
+
|
148
|
+
extern void Init_breakpoint();
|