byebug 7.0.0 → 8.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/ext/byebug/byebug.c +31 -9
- data/lib/byebug/context.rb +54 -23
- data/lib/byebug/processors/command_processor.rb +16 -15
- data/lib/byebug/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5f07ccaa5a4aa1349f40bc2cf000ba1b38923c8
|
4
|
+
data.tar.gz: a751bfe958abd5e9067ee0af534d021bfd2db7b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a14bb16fc28b18e031e94a4ec9e2e9615d2e9fd4543afee5dd39c11f4b8339d9d3d3098e7906c192289d659e4f10e8b13aba0d4d7d7c3e0aba4b1730d671e493
|
7
|
+
data.tar.gz: 785e5764ddad295fdf8559e63d470c111869a56c3bae74895b5f9a6da0d4f08485d0e12799268938ab8f0ce7e48e54267bb7c23b20b0de3860d5af19a0ca06fe
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
## 8.0.0 - 2015-11-05
|
2
|
+
### Fixed
|
3
|
+
* [#183]((https://github.com/deivid-rodriguez/byebug/issues/183). Compilation
|
4
|
+
in Ruby 2.0. Regression introduced in 7.0.0
|
5
|
+
* "Return value is: nil" would be displayed when stopping right before the end
|
6
|
+
of a class definition. We want to avoid showing anything instead.
|
7
|
+
|
8
|
+
## Changed
|
9
|
+
* Plugins now need to implement an `at_end` method (separate from `at_return`)
|
10
|
+
in their custom processors.
|
11
|
+
|
1
12
|
## 7.0.0 - 2015-11-04
|
2
13
|
### Fixed
|
3
14
|
* [#177](https://github.com/deivid-rodriguez/byebug/issues/177). Some issues
|
data/ext/byebug/byebug.c
CHANGED
@@ -228,6 +228,14 @@ call_at_return(VALUE ctx, debug_context_t * dc, VALUE return_value)
|
|
228
228
|
return call_at(ctx, dc, rb_intern("at_return"), 1, return_value);
|
229
229
|
}
|
230
230
|
|
231
|
+
static VALUE
|
232
|
+
call_at_end(VALUE ctx, debug_context_t * dc)
|
233
|
+
{
|
234
|
+
dc->stop_reason = CTX_STOP_BREAKPOINT;
|
235
|
+
|
236
|
+
return call_at(ctx, dc, rb_intern("at_end"), 0, Qnil);
|
237
|
+
}
|
238
|
+
|
231
239
|
static void
|
232
240
|
call_at_line_check(VALUE ctx, debug_context_t * dc, VALUE breakpoint)
|
233
241
|
{
|
@@ -326,8 +334,6 @@ call_event(VALUE trace_point, void *data)
|
|
326
334
|
static void
|
327
335
|
return_event(VALUE trace_point, void *data)
|
328
336
|
{
|
329
|
-
VALUE return_value;
|
330
|
-
|
331
337
|
EVENT_SETUP;
|
332
338
|
|
333
339
|
RETURN_EVENT_SETUP;
|
@@ -336,13 +342,26 @@ return_event(VALUE trace_point, void *data)
|
|
336
342
|
{
|
337
343
|
reset_stepping_stop_points(dc);
|
338
344
|
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
345
|
+
call_at_return(context, dc, rb_tracearg_return_value(trace_arg));
|
346
|
+
}
|
347
|
+
|
348
|
+
RETURN_EVENT_TEARDOWN;
|
349
|
+
|
350
|
+
EVENT_TEARDOWN;
|
351
|
+
}
|
352
|
+
|
353
|
+
static void
|
354
|
+
end_event(VALUE trace_point, void *data)
|
355
|
+
{
|
356
|
+
EVENT_SETUP;
|
357
|
+
|
358
|
+
RETURN_EVENT_SETUP;
|
359
|
+
|
360
|
+
if ((dc->steps_out == 0) && (CTX_FL_TEST(dc, CTX_FL_STOP_ON_RET)))
|
361
|
+
{
|
362
|
+
reset_stepping_stop_points(dc);
|
344
363
|
|
345
|
-
|
364
|
+
call_at_end(context, dc);
|
346
365
|
}
|
347
366
|
|
348
367
|
RETURN_EVENT_TEARDOWN;
|
@@ -439,7 +458,8 @@ register_tracepoints(VALUE self)
|
|
439
458
|
{
|
440
459
|
int line_msk = RUBY_EVENT_LINE;
|
441
460
|
int call_msk = RUBY_EVENT_CALL;
|
442
|
-
int ret_msk = RUBY_EVENT_RETURN | RUBY_EVENT_B_RETURN
|
461
|
+
int ret_msk = RUBY_EVENT_RETURN | RUBY_EVENT_B_RETURN;
|
462
|
+
int end_msk = RUBY_EVENT_END;
|
443
463
|
int raw_call_msk = RUBY_EVENT_C_CALL | RUBY_EVENT_B_CALL | RUBY_EVENT_CLASS;
|
444
464
|
int raw_ret_msk = RUBY_EVENT_C_RETURN;
|
445
465
|
int raise_msk = RUBY_EVENT_RAISE;
|
@@ -447,6 +467,7 @@ register_tracepoints(VALUE self)
|
|
447
467
|
VALUE tpLine = rb_tracepoint_new(Qnil, line_msk, line_event, 0);
|
448
468
|
VALUE tpCall = rb_tracepoint_new(Qnil, call_msk, call_event, 0);
|
449
469
|
VALUE tpReturn = rb_tracepoint_new(Qnil, ret_msk, return_event, 0);
|
470
|
+
VALUE tpEnd = rb_tracepoint_new(Qnil, end_msk, end_event, 0);
|
450
471
|
VALUE tpCCall = rb_tracepoint_new(Qnil, raw_call_msk, raw_call_event, 0);
|
451
472
|
VALUE tpCReturn = rb_tracepoint_new(Qnil, raw_ret_msk, raw_return_event, 0);
|
452
473
|
VALUE tpRaise = rb_tracepoint_new(Qnil, raise_msk, raise_event, 0);
|
@@ -455,6 +476,7 @@ register_tracepoints(VALUE self)
|
|
455
476
|
rb_ary_push(traces, tpLine);
|
456
477
|
rb_ary_push(traces, tpCall);
|
457
478
|
rb_ary_push(traces, tpReturn);
|
479
|
+
rb_ary_push(traces, tpEnd);
|
458
480
|
rb_ary_push(traces, tpCCall);
|
459
481
|
rb_ary_push(traces, tpCReturn);
|
460
482
|
rb_ary_push(traces, tpRaise);
|
data/lib/byebug/context.rb
CHANGED
@@ -39,34 +39,32 @@ module Byebug
|
|
39
39
|
end
|
40
40
|
|
41
41
|
#
|
42
|
-
#
|
43
|
-
#
|
44
|
-
# @param path [String] filename to be checked.
|
42
|
+
# Reader for the current frame
|
45
43
|
#
|
46
|
-
def ignored_file?(path)
|
47
|
-
self.class.ignored_files.include?(path)
|
48
|
-
end
|
49
|
-
|
50
44
|
def frame
|
51
45
|
@frame ||= Frame.new(self, 0)
|
52
46
|
end
|
53
47
|
|
48
|
+
#
|
49
|
+
# Writer for the current frame
|
50
|
+
#
|
54
51
|
def frame=(pos)
|
55
52
|
@frame = Frame.new(self, pos)
|
56
53
|
end
|
57
54
|
|
58
|
-
|
59
|
-
|
60
|
-
end
|
61
|
-
|
62
|
-
def line
|
63
|
-
frame.line
|
64
|
-
end
|
55
|
+
extend Forwardable
|
56
|
+
def_delegators :frame, :file, :line
|
65
57
|
|
58
|
+
#
|
59
|
+
# Current file & line information
|
60
|
+
#
|
66
61
|
def location
|
67
62
|
"#{normalize(file)}:#{line}"
|
68
63
|
end
|
69
64
|
|
65
|
+
#
|
66
|
+
# Current file, line and source code information
|
67
|
+
#
|
70
68
|
def full_location
|
71
69
|
return location if virtual_file?(file)
|
72
70
|
|
@@ -88,37 +86,70 @@ module Byebug
|
|
88
86
|
step_into 1
|
89
87
|
end
|
90
88
|
|
91
|
-
|
92
|
-
|
93
|
-
|
89
|
+
#
|
90
|
+
# Line handler
|
91
|
+
#
|
92
|
+
def at_line
|
93
|
+
self.frame = 0
|
94
|
+
return if ignored_file?(file)
|
94
95
|
|
95
|
-
|
96
|
-
processor.at_catchpoint(exception)
|
96
|
+
processor.at_line
|
97
97
|
end
|
98
98
|
|
99
|
+
#
|
100
|
+
# Tracing handler
|
101
|
+
#
|
99
102
|
def at_tracing
|
100
103
|
return if ignored_file?(file)
|
101
104
|
|
102
105
|
processor.at_tracing
|
103
106
|
end
|
104
107
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
+
#
|
109
|
+
# Breakpoint handler
|
110
|
+
#
|
111
|
+
def at_breakpoint(breakpoint)
|
112
|
+
processor.at_breakpoint(breakpoint)
|
113
|
+
end
|
108
114
|
|
109
|
-
|
115
|
+
#
|
116
|
+
# Catchpoint handler
|
117
|
+
#
|
118
|
+
def at_catchpoint(exception)
|
119
|
+
processor.at_catchpoint(exception)
|
110
120
|
end
|
111
121
|
|
122
|
+
#
|
123
|
+
# Return handler
|
124
|
+
#
|
112
125
|
def at_return(return_value)
|
113
126
|
return if ignored_file?(file)
|
114
127
|
|
115
128
|
processor.at_return(return_value)
|
116
129
|
end
|
117
130
|
|
131
|
+
#
|
132
|
+
# End of class definition handler
|
133
|
+
#
|
134
|
+
def at_end
|
135
|
+
return if ignored_file?(file)
|
136
|
+
|
137
|
+
processor.at_end
|
138
|
+
end
|
139
|
+
|
118
140
|
private
|
119
141
|
|
120
142
|
def processor
|
121
143
|
@processor ||= self.class.processor.new(self)
|
122
144
|
end
|
145
|
+
|
146
|
+
#
|
147
|
+
# Tells whether a file is ignored by the debugger.
|
148
|
+
#
|
149
|
+
# @param path [String] filename to be checked.
|
150
|
+
#
|
151
|
+
def ignored_file?(path)
|
152
|
+
self.class.ignored_files.include?(path)
|
153
|
+
end
|
123
154
|
end
|
124
155
|
end
|
@@ -33,17 +33,18 @@ module Byebug
|
|
33
33
|
@printer ||= Printers::Plain.new
|
34
34
|
end
|
35
35
|
|
36
|
-
def frame
|
37
|
-
@context.frame
|
38
|
-
end
|
39
|
-
|
40
36
|
extend Forwardable
|
37
|
+
|
38
|
+
def_delegators :@context, :frame
|
39
|
+
|
41
40
|
def_delegator :printer, :print, :pr
|
42
41
|
def_delegator :printer, :print_collection, :prc
|
43
42
|
def_delegator :printer, :print_variables, :prv
|
44
43
|
|
45
44
|
def_delegators :interface, :errmsg, :puts, :confirm
|
46
45
|
|
46
|
+
def_delegators Byebug, :commands
|
47
|
+
|
47
48
|
#
|
48
49
|
# Available commands
|
49
50
|
#
|
@@ -51,8 +52,14 @@ module Byebug
|
|
51
52
|
@command_list ||= CommandList.new(commands)
|
52
53
|
end
|
53
54
|
|
54
|
-
def
|
55
|
-
|
55
|
+
def at_line
|
56
|
+
process_commands
|
57
|
+
end
|
58
|
+
|
59
|
+
def at_tracing
|
60
|
+
puts "Tracing: #{context.full_location}"
|
61
|
+
|
62
|
+
run_auto_cmds(2)
|
56
63
|
end
|
57
64
|
|
58
65
|
def at_breakpoint(brkpt)
|
@@ -65,19 +72,13 @@ module Byebug
|
|
65
72
|
puts "Catchpoint at #{context.location}: `#{exception}'"
|
66
73
|
end
|
67
74
|
|
68
|
-
def
|
69
|
-
puts "
|
70
|
-
|
71
|
-
run_auto_cmds(2)
|
72
|
-
end
|
75
|
+
def at_return(return_value)
|
76
|
+
puts "Return value is: #{safe_inspect(return_value)}"
|
73
77
|
|
74
|
-
def at_line
|
75
78
|
process_commands
|
76
79
|
end
|
77
80
|
|
78
|
-
def
|
79
|
-
puts "Return value is: #{safe_inspect(return_value)}"
|
80
|
-
|
81
|
+
def at_end
|
81
82
|
process_commands
|
82
83
|
end
|
83
84
|
|
data/lib/byebug/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: byebug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 8.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Rodriguez
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-11-
|
13
|
+
date: 2015-11-05 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|