byebug 9.1.0 → 10.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +24 -3
- data/CONTRIBUTING.md +39 -18
- data/GUIDE.md +16 -17
- data/README.md +64 -52
- data/exe/byebug +6 -0
- data/ext/byebug/breakpoint.c +1 -1
- data/ext/byebug/byebug.c +16 -16
- data/ext/byebug/byebug.h +40 -26
- data/ext/byebug/context.c +26 -26
- data/ext/byebug/extconf.rb +7 -5
- data/ext/byebug/threads.c +8 -8
- data/lib/byebug.rb +3 -1
- data/lib/byebug/attacher.rb +17 -3
- data/lib/byebug/breakpoint.rb +25 -3
- data/lib/byebug/command.rb +20 -14
- data/lib/byebug/command_list.rb +3 -1
- data/lib/byebug/commands.rb +39 -37
- data/lib/byebug/commands/break.rb +33 -15
- data/lib/byebug/commands/catch.rb +16 -14
- data/lib/byebug/commands/condition.rb +11 -9
- data/lib/byebug/commands/continue.rb +9 -7
- data/lib/byebug/commands/debug.rb +7 -5
- data/lib/byebug/commands/delete.rb +11 -9
- data/lib/byebug/commands/disable.rb +8 -6
- data/lib/byebug/commands/disable/breakpoints.rb +7 -5
- data/lib/byebug/commands/disable/display.rb +7 -5
- data/lib/byebug/commands/display.rb +11 -9
- data/lib/byebug/commands/down.rb +10 -8
- data/lib/byebug/commands/edit.rb +10 -8
- data/lib/byebug/commands/enable.rb +8 -6
- data/lib/byebug/commands/enable/breakpoints.rb +7 -5
- data/lib/byebug/commands/enable/display.rb +7 -5
- data/lib/byebug/commands/finish.rb +8 -6
- data/lib/byebug/commands/frame.rb +11 -9
- data/lib/byebug/commands/help.rb +7 -5
- data/lib/byebug/commands/history.rb +7 -5
- data/lib/byebug/commands/info.rb +11 -9
- data/lib/byebug/commands/info/breakpoints.rb +17 -11
- data/lib/byebug/commands/info/display.rb +16 -7
- data/lib/byebug/commands/info/file.rb +12 -10
- data/lib/byebug/commands/info/line.rb +5 -3
- data/lib/byebug/commands/info/program.rb +8 -6
- data/lib/byebug/commands/interrupt.rb +8 -4
- data/lib/byebug/commands/irb.rb +9 -7
- data/lib/byebug/commands/kill.rb +9 -7
- data/lib/byebug/commands/list.rb +41 -46
- data/lib/byebug/commands/method.rb +10 -8
- data/lib/byebug/commands/next.rb +8 -6
- data/lib/byebug/commands/pry.rb +10 -8
- data/lib/byebug/commands/quit.rb +7 -5
- data/lib/byebug/commands/restart.rb +13 -11
- data/lib/byebug/commands/save.rb +9 -7
- data/lib/byebug/commands/set.rb +12 -10
- data/lib/byebug/commands/show.rb +7 -5
- data/lib/byebug/commands/source.rb +7 -5
- data/lib/byebug/commands/step.rb +8 -6
- data/lib/byebug/commands/thread.rb +11 -9
- data/lib/byebug/commands/thread/current.rb +6 -4
- data/lib/byebug/commands/thread/list.rb +7 -5
- data/lib/byebug/commands/thread/resume.rb +7 -5
- data/lib/byebug/commands/thread/stop.rb +6 -4
- data/lib/byebug/commands/thread/switch.rb +6 -4
- data/lib/byebug/commands/tracevar.rb +10 -8
- data/lib/byebug/commands/undisplay.rb +10 -8
- data/lib/byebug/commands/untracevar.rb +8 -6
- data/lib/byebug/commands/up.rb +10 -8
- data/lib/byebug/commands/var.rb +12 -10
- data/lib/byebug/commands/var/all.rb +7 -5
- data/lib/byebug/commands/var/args.rb +6 -4
- data/lib/byebug/commands/var/const.rb +9 -7
- data/lib/byebug/commands/var/global.rb +5 -3
- data/lib/byebug/commands/var/instance.rb +6 -4
- data/lib/byebug/commands/var/local.rb +6 -4
- data/lib/byebug/commands/where.rb +9 -7
- data/lib/byebug/context.rb +7 -5
- data/lib/byebug/core.rb +25 -25
- data/lib/byebug/errors.rb +4 -2
- data/lib/byebug/frame.rb +16 -16
- data/lib/byebug/helpers/bin.rb +28 -7
- data/lib/byebug/helpers/eval.rb +8 -6
- data/lib/byebug/helpers/file.rb +4 -2
- data/lib/byebug/helpers/frame.rb +5 -3
- data/lib/byebug/helpers/parse.rb +5 -3
- data/lib/byebug/helpers/path.rb +7 -5
- data/lib/byebug/helpers/reflection.rb +2 -0
- data/lib/byebug/helpers/string.rb +4 -2
- data/lib/byebug/helpers/thread.rb +10 -8
- data/lib/byebug/helpers/toggle.rb +10 -8
- data/lib/byebug/helpers/var.rb +8 -6
- data/lib/byebug/history.rb +7 -5
- data/lib/byebug/interface.rb +13 -11
- data/lib/byebug/interfaces/local_interface.rb +4 -4
- data/lib/byebug/interfaces/remote_interface.rb +21 -9
- data/lib/byebug/interfaces/script_interface.rb +2 -0
- data/lib/byebug/interfaces/test_interface.rb +5 -3
- data/lib/byebug/option_setter.rb +14 -12
- data/lib/byebug/printers/base.rb +6 -6
- data/lib/byebug/printers/plain.rb +8 -6
- data/lib/byebug/printers/texts/base.yml +3 -3
- data/lib/byebug/processors/command_processor.rb +11 -12
- data/lib/byebug/processors/control_processor.rb +4 -6
- data/lib/byebug/processors/post_mortem_processor.rb +4 -2
- data/lib/byebug/processors/script_processor.rb +7 -3
- data/lib/byebug/remote.rb +45 -65
- data/lib/byebug/remote/client.rb +55 -0
- data/lib/byebug/remote/server.rb +47 -0
- data/lib/byebug/runner.rb +26 -19
- data/lib/byebug/setting.rb +10 -4
- data/lib/byebug/settings/autoirb.rb +5 -3
- data/lib/byebug/settings/autolist.rb +5 -3
- data/lib/byebug/settings/autopry.rb +5 -3
- data/lib/byebug/settings/autosave.rb +4 -2
- data/lib/byebug/settings/basename.rb +4 -2
- data/lib/byebug/settings/callstyle.rb +3 -3
- data/lib/byebug/settings/fullpath.rb +4 -2
- data/lib/byebug/settings/histfile.rb +5 -3
- data/lib/byebug/settings/histsize.rb +4 -2
- data/lib/byebug/settings/linetrace.rb +4 -2
- data/lib/byebug/settings/listsize.rb +4 -2
- data/lib/byebug/settings/post_mortem.rb +4 -2
- data/lib/byebug/settings/savefile.rb +4 -2
- data/lib/byebug/settings/stack_on_error.rb +4 -2
- data/lib/byebug/settings/width.rb +3 -1
- data/lib/byebug/source_file_formatter.rb +71 -0
- data/lib/byebug/subcommands.rb +6 -4
- data/lib/byebug/version.rb +1 -1
- metadata +8 -5
- data/bin/byebug +0 -9
data/ext/byebug/byebug.c
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#include "byebug.h"
|
2
2
|
|
3
|
-
static VALUE mByebug;
|
3
|
+
static VALUE mByebug; /* Ruby Byebug Module object */
|
4
4
|
|
5
5
|
static VALUE tracing = Qfalse;
|
6
6
|
static VALUE post_mortem = Qfalse;
|
@@ -75,7 +75,7 @@ check_started()
|
|
75
75
|
}
|
76
76
|
|
77
77
|
static void
|
78
|
-
trace_print(rb_trace_arg_t *
|
78
|
+
trace_print(rb_trace_arg_t *trace_arg, debug_context_t *dc,
|
79
79
|
const char *file_filter, const char *debug_msg)
|
80
80
|
{
|
81
81
|
char *fullpath = NULL;
|
@@ -127,7 +127,7 @@ trace_print(rb_trace_arg_t * trace_arg, debug_context_t * dc,
|
|
127
127
|
}
|
128
128
|
|
129
129
|
static void
|
130
|
-
cleanup(debug_context_t *
|
130
|
+
cleanup(debug_context_t *dc)
|
131
131
|
{
|
132
132
|
dc->stop_reason = CTX_STOP_NONE;
|
133
133
|
|
@@ -156,11 +156,11 @@ cleanup(debug_context_t * dc)
|
|
156
156
|
if (CTX_FL_TEST(dc, CTX_FL_IGNORE)) \
|
157
157
|
return; \
|
158
158
|
\
|
159
|
-
acquire_lock(dc);
|
160
|
-
|
159
|
+
acquire_lock(dc);
|
160
|
+
|
161
161
|
|
162
|
-
#define CALL_EVENT_SETUP
|
163
|
-
dc->calced_stack_size++;
|
162
|
+
#define CALL_EVENT_SETUP \
|
163
|
+
dc->calced_stack_size++; \
|
164
164
|
dc->steps_out = dc->steps_out < 0 ? -1 : dc->steps_out + 1;
|
165
165
|
|
166
166
|
#define RETURN_EVENT_SETUP \
|
@@ -176,7 +176,7 @@ cleanup(debug_context_t * dc)
|
|
176
176
|
/* Functions that return control to byebug after the different events */
|
177
177
|
|
178
178
|
static VALUE
|
179
|
-
call_at(VALUE ctx, debug_context_t *
|
179
|
+
call_at(VALUE ctx, debug_context_t *dc, ID mid, int argc, VALUE arg)
|
180
180
|
{
|
181
181
|
struct call_with_inspection_data cwi;
|
182
182
|
VALUE argv[1];
|
@@ -193,19 +193,19 @@ call_at(VALUE ctx, debug_context_t * dc, ID mid, int argc, VALUE arg)
|
|
193
193
|
}
|
194
194
|
|
195
195
|
static VALUE
|
196
|
-
call_at_line(VALUE ctx, debug_context_t *
|
196
|
+
call_at_line(VALUE ctx, debug_context_t *dc)
|
197
197
|
{
|
198
198
|
return call_at(ctx, dc, rb_intern("at_line"), 0, Qnil);
|
199
199
|
}
|
200
200
|
|
201
201
|
static VALUE
|
202
|
-
call_at_tracing(VALUE ctx, debug_context_t *
|
202
|
+
call_at_tracing(VALUE ctx, debug_context_t *dc)
|
203
203
|
{
|
204
204
|
return call_at(ctx, dc, rb_intern("at_tracing"), 0, Qnil);
|
205
205
|
}
|
206
206
|
|
207
207
|
static VALUE
|
208
|
-
call_at_breakpoint(VALUE ctx, debug_context_t *
|
208
|
+
call_at_breakpoint(VALUE ctx, debug_context_t *dc, VALUE breakpoint)
|
209
209
|
{
|
210
210
|
dc->stop_reason = CTX_STOP_BREAKPOINT;
|
211
211
|
|
@@ -213,7 +213,7 @@ call_at_breakpoint(VALUE ctx, debug_context_t * dc, VALUE breakpoint)
|
|
213
213
|
}
|
214
214
|
|
215
215
|
static VALUE
|
216
|
-
call_at_catchpoint(VALUE ctx, debug_context_t *
|
216
|
+
call_at_catchpoint(VALUE ctx, debug_context_t *dc, VALUE exp)
|
217
217
|
{
|
218
218
|
dc->stop_reason = CTX_STOP_CATCHPOINT;
|
219
219
|
|
@@ -221,7 +221,7 @@ call_at_catchpoint(VALUE ctx, debug_context_t * dc, VALUE exp)
|
|
221
221
|
}
|
222
222
|
|
223
223
|
static VALUE
|
224
|
-
call_at_return(VALUE ctx, debug_context_t *
|
224
|
+
call_at_return(VALUE ctx, debug_context_t *dc, VALUE return_value)
|
225
225
|
{
|
226
226
|
dc->stop_reason = CTX_STOP_BREAKPOINT;
|
227
227
|
|
@@ -229,7 +229,7 @@ call_at_return(VALUE ctx, debug_context_t * dc, VALUE return_value)
|
|
229
229
|
}
|
230
230
|
|
231
231
|
static VALUE
|
232
|
-
call_at_end(VALUE ctx, debug_context_t *
|
232
|
+
call_at_end(VALUE ctx, debug_context_t *dc)
|
233
233
|
{
|
234
234
|
dc->stop_reason = CTX_STOP_BREAKPOINT;
|
235
235
|
|
@@ -237,7 +237,7 @@ call_at_end(VALUE ctx, debug_context_t * dc)
|
|
237
237
|
}
|
238
238
|
|
239
239
|
static void
|
240
|
-
call_at_line_check(VALUE ctx, debug_context_t *
|
240
|
+
call_at_line_check(VALUE ctx, debug_context_t *dc, VALUE breakpoint)
|
241
241
|
{
|
242
242
|
dc->stop_reason = CTX_STOP_STEP;
|
243
243
|
|
@@ -721,7 +721,7 @@ Start(VALUE self)
|
|
721
721
|
* +stop+ parameter forces byebug to stop at the first line of code in +file+
|
722
722
|
*/
|
723
723
|
static VALUE
|
724
|
-
Debug_load(int argc, VALUE *
|
724
|
+
Debug_load(int argc, VALUE *argv, VALUE self)
|
725
725
|
{
|
726
726
|
VALUE file, stop, context;
|
727
727
|
debug_context_t *dc;
|
data/ext/byebug/byebug.h
CHANGED
@@ -8,22 +8,29 @@
|
|
8
8
|
#define UNUSED(x) (void)(x)
|
9
9
|
|
10
10
|
/* flags */
|
11
|
-
#define CTX_FL_DEAD
|
12
|
-
#define CTX_FL_IGNORE
|
13
|
-
#define CTX_FL_SUSPEND
|
14
|
-
#define CTX_FL_TRACING
|
15
|
-
#define CTX_FL_WAS_RUNNING
|
16
|
-
#define CTX_FL_STOP_ON_RET
|
17
|
-
#define CTX_FL_IGNORE_STEPS (1<<7)
|
11
|
+
#define CTX_FL_DEAD (1 << 1) /* this context belonged to a dead thread */
|
12
|
+
#define CTX_FL_IGNORE (1 << 2) /* this context belongs to ignored thread */
|
13
|
+
#define CTX_FL_SUSPEND (1 << 3) /* thread currently suspended */
|
14
|
+
#define CTX_FL_TRACING (1 << 4) /* call at_tracing method */
|
15
|
+
#define CTX_FL_WAS_RUNNING (1 << 5) /* thread was previously running */
|
16
|
+
#define CTX_FL_STOP_ON_RET (1 << 6) /* can stop on method 'end' */
|
17
|
+
#define CTX_FL_IGNORE_STEPS (1 << 7) /* doesn't countdown steps to break */
|
18
18
|
|
19
19
|
/* macro functions */
|
20
|
-
#define CTX_FL_TEST(c,f) ((c)->flags & (f))
|
21
|
-
#define CTX_FL_SET(c,
|
22
|
-
|
20
|
+
#define CTX_FL_TEST(c, f) ((c)->flags & (f))
|
21
|
+
#define CTX_FL_SET(c, f) \
|
22
|
+
do \
|
23
|
+
{ \
|
24
|
+
(c)->flags |= (f); \
|
25
|
+
} while (0)
|
26
|
+
#define CTX_FL_UNSET(c, f) \
|
27
|
+
do \
|
28
|
+
{ \
|
29
|
+
(c)->flags &= ~(f); \
|
30
|
+
} while (0)
|
23
31
|
|
24
32
|
/* types */
|
25
|
-
typedef enum
|
26
|
-
{
|
33
|
+
typedef enum {
|
27
34
|
CTX_STOP_NONE,
|
28
35
|
CTX_STOP_STEP,
|
29
36
|
CTX_STOP_BREAKPOINT,
|
@@ -39,16 +46,15 @@ typedef struct
|
|
39
46
|
VALUE thread;
|
40
47
|
int thnum;
|
41
48
|
|
42
|
-
int dest_frame;
|
43
|
-
int lines;
|
44
|
-
int steps;
|
45
|
-
int steps_out;
|
49
|
+
int dest_frame; /* next stop's frame if stopped by next */
|
50
|
+
int lines; /* # of lines in dest_frame before stopping */
|
51
|
+
int steps; /* # of steps before stopping */
|
52
|
+
int steps_out; /* # of returns before stopping */
|
46
53
|
|
47
|
-
VALUE backtrace;
|
54
|
+
VALUE backtrace; /* [[loc, self, klass, binding], ...] */
|
48
55
|
} debug_context_t;
|
49
56
|
|
50
|
-
typedef enum
|
51
|
-
{
|
57
|
+
typedef enum {
|
52
58
|
LOCATION,
|
53
59
|
SELF,
|
54
60
|
CLASS,
|
@@ -70,10 +76,18 @@ typedef struct
|
|
70
76
|
} threads_table_t;
|
71
77
|
|
72
78
|
enum bp_type
|
73
|
-
{
|
79
|
+
{
|
80
|
+
BP_POS_TYPE,
|
81
|
+
BP_METHOD_TYPE
|
82
|
+
};
|
74
83
|
|
75
84
|
enum hit_condition
|
76
|
-
{
|
85
|
+
{
|
86
|
+
HIT_COND_NONE,
|
87
|
+
HIT_COND_GE,
|
88
|
+
HIT_COND_EQ,
|
89
|
+
HIT_COND_MOD
|
90
|
+
};
|
77
91
|
|
78
92
|
typedef struct
|
79
93
|
{
|
@@ -100,9 +114,9 @@ extern void remove_from_locked(VALUE thread);
|
|
100
114
|
/* functions from threads.c */
|
101
115
|
extern void Init_threads_table(VALUE mByebug);
|
102
116
|
extern VALUE create_threads_table(void);
|
103
|
-
extern void thread_context_lookup(VALUE thread, VALUE *
|
117
|
+
extern void thread_context_lookup(VALUE thread, VALUE *context);
|
104
118
|
extern int is_living_thread(VALUE thread);
|
105
|
-
extern void acquire_lock(debug_context_t *
|
119
|
+
extern void acquire_lock(debug_context_t *dc);
|
106
120
|
extern void release_lock(void);
|
107
121
|
|
108
122
|
/* global variables */
|
@@ -112,10 +126,10 @@ extern VALUE next_thread;
|
|
112
126
|
/* functions from context.c */
|
113
127
|
extern void Init_context(VALUE mByebug);
|
114
128
|
extern VALUE context_create(VALUE thread);
|
115
|
-
extern VALUE context_dup(debug_context_t *
|
116
|
-
extern void reset_stepping_stop_points(debug_context_t *
|
129
|
+
extern VALUE context_dup(debug_context_t *context);
|
130
|
+
extern void reset_stepping_stop_points(debug_context_t *context);
|
117
131
|
extern VALUE call_with_debug_inspector(struct call_with_inspection_data *data);
|
118
|
-
extern VALUE context_backtrace_set(const rb_debug_inspector_t *
|
132
|
+
extern VALUE context_backtrace_set(const rb_debug_inspector_t *inspector,
|
119
133
|
void *data);
|
120
134
|
|
121
135
|
/* functions from breakpoint.c */
|
data/ext/byebug/context.c
CHANGED
@@ -7,7 +7,7 @@ static int thnum_max = 0;
|
|
7
7
|
/* "Step", "Next" and "Finish" do their work by saving information about where
|
8
8
|
* to stop next. reset_stepping_stop_points removes/resets this information. */
|
9
9
|
extern void
|
10
|
-
reset_stepping_stop_points(debug_context_t *
|
10
|
+
reset_stepping_stop_points(debug_context_t *context)
|
11
11
|
{
|
12
12
|
context->dest_frame = -1;
|
13
13
|
context->lines = -1;
|
@@ -34,19 +34,19 @@ Context_dead(VALUE self)
|
|
34
34
|
static void
|
35
35
|
context_mark(void *data)
|
36
36
|
{
|
37
|
-
debug_context_t *context = (debug_context_t *)
|
37
|
+
debug_context_t *context = (debug_context_t *)data;
|
38
38
|
|
39
39
|
rb_gc_mark(context->backtrace);
|
40
40
|
}
|
41
41
|
|
42
42
|
static VALUE
|
43
|
-
dc_backtrace(const debug_context_t *
|
43
|
+
dc_backtrace(const debug_context_t *context)
|
44
44
|
{
|
45
45
|
return context->backtrace;
|
46
46
|
}
|
47
47
|
|
48
48
|
static int
|
49
|
-
dc_stack_size(debug_context_t *
|
49
|
+
dc_stack_size(debug_context_t *context)
|
50
50
|
{
|
51
51
|
|
52
52
|
if (NIL_P(dc_backtrace(context)))
|
@@ -76,7 +76,7 @@ context_create(VALUE thread)
|
|
76
76
|
}
|
77
77
|
|
78
78
|
extern VALUE
|
79
|
-
context_dup(debug_context_t *
|
79
|
+
context_dup(debug_context_t *context)
|
80
80
|
{
|
81
81
|
debug_context_t *new_context = ALLOC(debug_context_t);
|
82
82
|
|
@@ -90,7 +90,7 @@ context_dup(debug_context_t * context)
|
|
90
90
|
|
91
91
|
|
92
92
|
static VALUE
|
93
|
-
dc_frame_get(const debug_context_t *
|
93
|
+
dc_frame_get(const debug_context_t *context, int frame_index, frame_part type)
|
94
94
|
{
|
95
95
|
VALUE frame;
|
96
96
|
|
@@ -105,31 +105,31 @@ dc_frame_get(const debug_context_t * context, int frame_index, frame_part type)
|
|
105
105
|
}
|
106
106
|
|
107
107
|
static VALUE
|
108
|
-
dc_frame_location(const debug_context_t *
|
108
|
+
dc_frame_location(const debug_context_t *context, int frame_index)
|
109
109
|
{
|
110
110
|
return dc_frame_get(context, frame_index, LOCATION);
|
111
111
|
}
|
112
112
|
|
113
113
|
static VALUE
|
114
|
-
dc_frame_self(const debug_context_t *
|
114
|
+
dc_frame_self(const debug_context_t *context, int frame_index)
|
115
115
|
{
|
116
116
|
return dc_frame_get(context, frame_index, SELF);
|
117
117
|
}
|
118
118
|
|
119
119
|
static VALUE
|
120
|
-
dc_frame_class(const debug_context_t *
|
120
|
+
dc_frame_class(const debug_context_t *context, int frame_index)
|
121
121
|
{
|
122
122
|
return dc_frame_get(context, frame_index, CLASS);
|
123
123
|
}
|
124
124
|
|
125
125
|
static VALUE
|
126
|
-
dc_frame_binding(const debug_context_t *
|
126
|
+
dc_frame_binding(const debug_context_t *context, int frame_index)
|
127
127
|
{
|
128
128
|
return dc_frame_get(context, frame_index, BINDING);
|
129
129
|
}
|
130
130
|
|
131
131
|
static VALUE
|
132
|
-
load_backtrace(const rb_debug_inspector_t *
|
132
|
+
load_backtrace(const rb_debug_inspector_t *inspector)
|
133
133
|
{
|
134
134
|
VALUE backtrace = rb_ary_new();
|
135
135
|
VALUE locs = rb_debug_inspector_backtrace_locations(inspector);
|
@@ -151,9 +151,9 @@ load_backtrace(const rb_debug_inspector_t * inspector)
|
|
151
151
|
}
|
152
152
|
|
153
153
|
extern VALUE
|
154
|
-
context_backtrace_set(const rb_debug_inspector_t *
|
154
|
+
context_backtrace_set(const rb_debug_inspector_t *inspector, void *data)
|
155
155
|
{
|
156
|
-
debug_context_t *dc = (debug_context_t *)
|
156
|
+
debug_context_t *dc = (debug_context_t *)data;
|
157
157
|
|
158
158
|
dc->backtrace = load_backtrace(inspector);
|
159
159
|
|
@@ -161,7 +161,7 @@ context_backtrace_set(const rb_debug_inspector_t * inspector, void *data)
|
|
161
161
|
}
|
162
162
|
|
163
163
|
static VALUE
|
164
|
-
open_debug_inspector_i(const rb_debug_inspector_t *
|
164
|
+
open_debug_inspector_i(const rb_debug_inspector_t *inspector, void *data)
|
165
165
|
{
|
166
166
|
struct call_with_inspection_data *cwi =
|
167
167
|
(struct call_with_inspection_data *)data;
|
@@ -187,8 +187,8 @@ close_debug_inspector(struct call_with_inspection_data *cwi)
|
|
187
187
|
extern VALUE
|
188
188
|
call_with_debug_inspector(struct call_with_inspection_data *data)
|
189
189
|
{
|
190
|
-
return rb_ensure(open_debug_inspector, (VALUE)
|
191
|
-
(VALUE)
|
190
|
+
return rb_ensure(open_debug_inspector, (VALUE)data, close_debug_inspector,
|
191
|
+
(VALUE)data);
|
192
192
|
}
|
193
193
|
|
194
194
|
#define FRAME_SETUP \
|
@@ -208,7 +208,7 @@ call_with_debug_inspector(struct call_with_inspection_data *data)
|
|
208
208
|
* Returns frame's binding.
|
209
209
|
*/
|
210
210
|
static VALUE
|
211
|
-
Context_frame_binding(int argc, VALUE *
|
211
|
+
Context_frame_binding(int argc, VALUE *argv, VALUE self)
|
212
212
|
{
|
213
213
|
FRAME_SETUP;
|
214
214
|
|
@@ -217,12 +217,12 @@ Context_frame_binding(int argc, VALUE * argv, VALUE self)
|
|
217
217
|
|
218
218
|
/*
|
219
219
|
* call-seq:
|
220
|
-
* context.frame_class(frame_position = 0) ->
|
220
|
+
* context.frame_class(frame_position = 0) -> class
|
221
221
|
*
|
222
222
|
* Returns frame's defined class.
|
223
223
|
*/
|
224
224
|
static VALUE
|
225
|
-
Context_frame_class(int argc, VALUE *
|
225
|
+
Context_frame_class(int argc, VALUE *argv, VALUE self)
|
226
226
|
{
|
227
227
|
FRAME_SETUP;
|
228
228
|
|
@@ -236,7 +236,7 @@ Context_frame_class(int argc, VALUE * argv, VALUE self)
|
|
236
236
|
* Returns the name of the file in the frame.
|
237
237
|
*/
|
238
238
|
static VALUE
|
239
|
-
Context_frame_file(int argc, VALUE *
|
239
|
+
Context_frame_file(int argc, VALUE *argv, VALUE self)
|
240
240
|
{
|
241
241
|
VALUE loc, absolute_path;
|
242
242
|
|
@@ -259,7 +259,7 @@ Context_frame_file(int argc, VALUE * argv, VALUE self)
|
|
259
259
|
* Returns the line number in the file in the frame.
|
260
260
|
*/
|
261
261
|
static VALUE
|
262
|
-
Context_frame_line(int argc, VALUE *
|
262
|
+
Context_frame_line(int argc, VALUE *argv, VALUE self)
|
263
263
|
{
|
264
264
|
VALUE loc;
|
265
265
|
|
@@ -277,7 +277,7 @@ Context_frame_line(int argc, VALUE * argv, VALUE self)
|
|
277
277
|
* Returns the sym of the method in the frame.
|
278
278
|
*/
|
279
279
|
static VALUE
|
280
|
-
Context_frame_method(int argc, VALUE *
|
280
|
+
Context_frame_method(int argc, VALUE *argv, VALUE self)
|
281
281
|
{
|
282
282
|
VALUE loc;
|
283
283
|
|
@@ -295,7 +295,7 @@ Context_frame_method(int argc, VALUE * argv, VALUE self)
|
|
295
295
|
* Returns self object of the frame.
|
296
296
|
*/
|
297
297
|
static VALUE
|
298
|
-
Context_frame_self(int argc, VALUE *
|
298
|
+
Context_frame_self(int argc, VALUE *argv, VALUE self)
|
299
299
|
{
|
300
300
|
FRAME_SETUP;
|
301
301
|
|
@@ -395,7 +395,7 @@ Context_stop_reason(VALUE self)
|
|
395
395
|
* +frame+ (by default the newest one).
|
396
396
|
*/
|
397
397
|
static VALUE
|
398
|
-
Context_step_into(int argc, VALUE *
|
398
|
+
Context_step_into(int argc, VALUE *argv, VALUE self)
|
399
399
|
{
|
400
400
|
VALUE steps, v_frame;
|
401
401
|
int n_args, from_frame;
|
@@ -435,7 +435,7 @@ Context_step_into(int argc, VALUE * argv, VALUE self)
|
|
435
435
|
* event for that frame is triggered.
|
436
436
|
*/
|
437
437
|
static VALUE
|
438
|
-
Context_step_out(int argc, VALUE *
|
438
|
+
Context_step_out(int argc, VALUE *argv, VALUE self)
|
439
439
|
{
|
440
440
|
int n_args, n_frames;
|
441
441
|
VALUE v_frames, force;
|
@@ -468,7 +468,7 @@ Context_step_out(int argc, VALUE * argv, VALUE self)
|
|
468
468
|
* higher (if frame +frame+ finishes).
|
469
469
|
*/
|
470
470
|
static VALUE
|
471
|
-
Context_step_over(int argc, VALUE *
|
471
|
+
Context_step_over(int argc, VALUE *argv, VALUE self)
|
472
472
|
{
|
473
473
|
int n_args, frame;
|
474
474
|
VALUE lines, v_frame;
|
data/ext/byebug/extconf.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "mkmf"
|
2
4
|
|
3
5
|
makefile_config = RbConfig::MAKEFILE_CONFIG
|
4
6
|
|
5
|
-
makefile_config[
|
7
|
+
makefile_config["CC"] = ENV["CC"] if ENV["CC"]
|
6
8
|
|
7
|
-
makefile_config[
|
9
|
+
makefile_config["CFLAGS"] << " -gdwarf-2 -g3 -O0" if ENV["debug"]
|
8
10
|
|
9
|
-
dir_config(
|
10
|
-
with_cflags(makefile_config[
|
11
|
+
dir_config("ruby")
|
12
|
+
with_cflags(makefile_config["CFLAGS"]) { create_makefile("byebug/byebug") }
|
data/ext/byebug/threads.c
CHANGED
@@ -14,12 +14,12 @@ t_tbl_mark_keyvalue(st_data_t key, st_data_t value, st_data_t tbl)
|
|
14
14
|
{
|
15
15
|
UNUSED(tbl);
|
16
16
|
|
17
|
-
rb_gc_mark((VALUE)
|
17
|
+
rb_gc_mark((VALUE)key);
|
18
18
|
|
19
19
|
if (!value)
|
20
20
|
return ST_CONTINUE;
|
21
21
|
|
22
|
-
rb_gc_mark((VALUE)
|
22
|
+
rb_gc_mark((VALUE)value);
|
23
23
|
|
24
24
|
return ST_CONTINUE;
|
25
25
|
}
|
@@ -27,16 +27,16 @@ t_tbl_mark_keyvalue(st_data_t key, st_data_t value, st_data_t tbl)
|
|
27
27
|
static void
|
28
28
|
t_tbl_mark(void *data)
|
29
29
|
{
|
30
|
-
threads_table_t *t_tbl = (threads_table_t *)
|
30
|
+
threads_table_t *t_tbl = (threads_table_t *)data;
|
31
31
|
st_table *tbl = t_tbl->tbl;
|
32
32
|
|
33
|
-
st_foreach(tbl, t_tbl_mark_keyvalue, (st_data_t)
|
33
|
+
st_foreach(tbl, t_tbl_mark_keyvalue, (st_data_t)tbl);
|
34
34
|
}
|
35
35
|
|
36
36
|
static void
|
37
37
|
t_tbl_free(void *data)
|
38
38
|
{
|
39
|
-
threads_table_t *t_tbl = (threads_table_t *)
|
39
|
+
threads_table_t *t_tbl = (threads_table_t *)data;
|
40
40
|
|
41
41
|
st_free_table(t_tbl->tbl);
|
42
42
|
xfree(t_tbl);
|
@@ -70,7 +70,7 @@ check_thread_i(st_data_t key, st_data_t value, st_data_t data)
|
|
70
70
|
if (!value)
|
71
71
|
return ST_DELETE;
|
72
72
|
|
73
|
-
if (!is_living_thread((VALUE)
|
73
|
+
if (!is_living_thread((VALUE)key))
|
74
74
|
return ST_DELETE;
|
75
75
|
|
76
76
|
return ST_CONTINUE;
|
@@ -110,7 +110,7 @@ cleanup_dead_threads(void)
|
|
110
110
|
* Looks up a context in the threads table. If not present, it creates it.
|
111
111
|
*/
|
112
112
|
void
|
113
|
-
thread_context_lookup(VALUE thread, VALUE *
|
113
|
+
thread_context_lookup(VALUE thread, VALUE *context)
|
114
114
|
{
|
115
115
|
threads_table_t *t_tbl;
|
116
116
|
|
@@ -129,7 +129,7 @@ thread_context_lookup(VALUE thread, VALUE * context)
|
|
129
129
|
* Thanks to this, all threads are "frozen" while the user is typing commands.
|
130
130
|
*/
|
131
131
|
void
|
132
|
-
acquire_lock(debug_context_t *
|
132
|
+
acquire_lock(debug_context_t *dc)
|
133
133
|
{
|
134
134
|
while ((!NIL_P(locker) && locker != rb_thread_current())
|
135
135
|
|| CTX_FL_TEST(dc, CTX_FL_SUSPEND))
|