byebug 2.7.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -6
- data/.travis.yml +1 -0
- data/CHANGELOG.md +23 -0
- data/Gemfile +9 -0
- data/README.md +35 -32
- data/Rakefile +1 -3
- data/byebug.gemspec +0 -6
- data/ext/byebug/byebug.c +64 -51
- data/ext/byebug/byebug.h +12 -13
- data/ext/byebug/context.c +28 -43
- data/ext/byebug/extconf.rb +6 -6
- data/lib/byebug.rb +34 -38
- data/lib/byebug/command.rb +4 -2
- data/lib/byebug/commands/continue.rb +0 -1
- data/lib/byebug/commands/control.rb +0 -1
- data/lib/byebug/commands/edit.rb +1 -1
- data/lib/byebug/commands/finish.rb +10 -16
- data/lib/byebug/commands/help.rb +1 -1
- data/lib/byebug/commands/kill.rb +1 -1
- data/lib/byebug/commands/quit.rb +1 -1
- data/lib/byebug/commands/repl.rb +3 -3
- data/lib/byebug/commands/set.rb +24 -39
- data/lib/byebug/commands/show.rb +39 -112
- data/lib/byebug/commands/stepping.rb +0 -2
- data/lib/byebug/commands/threads.rb +0 -5
- data/lib/byebug/commands/trace.rb +1 -1
- data/lib/byebug/commands/variables.rb +1 -1
- data/lib/byebug/context.rb +8 -12
- data/lib/byebug/helper.rb +1 -1
- data/lib/byebug/history.rb +46 -0
- data/lib/byebug/interface.rb +5 -5
- data/lib/byebug/interfaces/local_interface.rb +11 -62
- data/lib/byebug/interfaces/remote_interface.rb +6 -22
- data/lib/byebug/interfaces/script_interface.rb +2 -17
- data/lib/byebug/processor.rb +4 -4
- data/lib/byebug/{command_processor.rb → processors/command_processor.rb} +7 -14
- data/lib/byebug/{control_command_processor.rb → processors/control_command_processor.rb} +3 -7
- data/lib/byebug/version.rb +1 -1
- data/test/edit_test.rb +6 -6
- data/test/examples/breakpoint_deep.rb +1 -1
- data/test/finish_test.rb +6 -6
- data/test/help_test.rb +1 -1
- data/test/info_test.rb +0 -1
- data/test/kill_test.rb +2 -2
- data/test/post_mortem_test.rb +35 -219
- data/test/quit_test.rb +2 -2
- data/test/restart_test.rb +12 -33
- data/test/set_test.rb +80 -107
- data/test/show_test.rb +42 -77
- data/test/stepping_test.rb +1 -1
- data/test/support/test_dsl.rb +4 -25
- data/test/support/test_interface.rb +40 -48
- data/test/test_helper.rb +1 -3
- data/test/timeout_test.rb +9 -0
- metadata +8 -75
data/test/stepping_test.rb
CHANGED
data/test/support/test_dsl.rb
CHANGED
@@ -4,7 +4,7 @@ module TestDsl
|
|
4
4
|
include TestDsl
|
5
5
|
|
6
6
|
def setup
|
7
|
-
Byebug.handler = Byebug::CommandProcessor.new(TestInterface.new)
|
7
|
+
Byebug.handler = Byebug::CommandProcessor.new(Byebug::TestInterface.new)
|
8
8
|
Byebug.tracing = false
|
9
9
|
Byebug.breakpoints.clear if Byebug.breakpoints
|
10
10
|
end
|
@@ -92,34 +92,13 @@ module TestDsl
|
|
92
92
|
# debug_file('/path/to/ex2.rb') { state.line.must_equal 4 }
|
93
93
|
#
|
94
94
|
def debug_file(filename, options = {}, &block)
|
95
|
-
is_test_block_called = false
|
96
|
-
exception = nil
|
97
95
|
Byebug.stubs(:run_init_script)
|
98
|
-
|
99
|
-
interface.test_block = lambda do
|
100
|
-
is_test_block_called = true
|
101
|
-
# We need to store exception and reraise it after completing debugging,
|
102
|
-
# because Byebug will swallow any exceptions, so e.g. our failed
|
103
|
-
# assertions will be ignored
|
104
|
-
begin
|
105
|
-
block.call
|
106
|
-
rescue Exception => e
|
107
|
-
exception = e
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
96
|
+
interface.test_block = block
|
111
97
|
begin
|
112
98
|
load fullpath(filename)
|
113
|
-
|
114
|
-
if
|
115
|
-
interface.test_block.call if interface.test_block
|
116
|
-
else
|
117
|
-
raise e
|
118
|
-
end
|
99
|
+
ensure
|
100
|
+
interface.test_block.call if interface.test_block
|
119
101
|
end
|
120
|
-
|
121
|
-
flunk "Test block was provided, but not called" if block && !is_test_block_called
|
122
|
-
raise exception if exception
|
123
102
|
end
|
124
103
|
|
125
104
|
#
|
@@ -1,59 +1,51 @@
|
|
1
|
-
|
2
|
-
attr_reader :input_queue, :output_queue, :error_queue, :confirm_queue
|
3
|
-
|
4
|
-
attr_accessor :command_queue, :histfile, :history_length, :history_save
|
5
|
-
attr_accessor :readline_support, :restart_file, :test_block
|
6
|
-
|
7
|
-
def initialize
|
8
|
-
@input_queue = []
|
9
|
-
@output_queue = []
|
10
|
-
@error_queue = []
|
11
|
-
@confirm_queue = []
|
12
|
-
@command_queue = []
|
13
|
-
@readline_support = false
|
14
|
-
end
|
1
|
+
require 'byebug/history'
|
15
2
|
|
16
|
-
|
17
|
-
|
18
|
-
|
3
|
+
module Byebug
|
4
|
+
class TestInterface < Interface
|
5
|
+
attr_reader :input_queue, :output_queue, :error_queue, :confirm_queue, :history
|
19
6
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
26
|
-
else
|
27
|
-
result = @input_queue.shift
|
28
|
-
result.is_a?(Proc) ? result.call : result
|
7
|
+
attr_accessor :test_block
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@input_queue, @output_queue, @error_queue = [], [], []
|
11
|
+
@confirm_queue, @command_queue, @history = [], [], Byebug::History.new
|
29
12
|
end
|
30
|
-
end
|
31
13
|
|
32
|
-
|
33
|
-
|
34
|
-
|
14
|
+
def errmsg(*args)
|
15
|
+
@error_queue << format(*args)
|
16
|
+
end
|
35
17
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
18
|
+
def read_command(*args)
|
19
|
+
if @input_queue.empty?
|
20
|
+
if test_block
|
21
|
+
test_block.call
|
22
|
+
self.test_block = nil
|
23
|
+
end
|
24
|
+
else
|
25
|
+
result = @input_queue.shift
|
26
|
+
result.is_a?(Proc) ? result.call : result
|
27
|
+
end
|
28
|
+
end
|
40
29
|
|
41
|
-
|
42
|
-
|
43
|
-
|
30
|
+
def print(*args)
|
31
|
+
@output_queue << format(*args)
|
32
|
+
end
|
44
33
|
|
45
|
-
|
46
|
-
|
34
|
+
def confirm(message)
|
35
|
+
@confirm_queue << message
|
36
|
+
read_command message
|
37
|
+
end
|
47
38
|
|
48
|
-
|
49
|
-
|
39
|
+
def close
|
40
|
+
end
|
50
41
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
42
|
+
def inspect
|
43
|
+
[
|
44
|
+
"input_queue: #{input_queue.inspect}",
|
45
|
+
"output_queue: #{output_queue.inspect}",
|
46
|
+
"error_queue: #{error_queue.inspect}",
|
47
|
+
"confirm_queue: #{confirm_queue.inspect}"
|
48
|
+
].join("\n")
|
49
|
+
end
|
58
50
|
end
|
59
51
|
end
|
data/test/test_helper.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: 3.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: 2014-
|
13
|
+
date: 2014-04-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: columnize
|
@@ -40,76 +40,6 @@ dependencies:
|
|
40
40
|
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '1.2'
|
43
|
-
- !ruby/object:Gem::Dependency
|
44
|
-
name: rake
|
45
|
-
requirement: !ruby/object:Gem::Requirement
|
46
|
-
requirements:
|
47
|
-
- - "~>"
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: '10.1'
|
50
|
-
type: :development
|
51
|
-
prerelease: false
|
52
|
-
version_requirements: !ruby/object:Gem::Requirement
|
53
|
-
requirements:
|
54
|
-
- - "~>"
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: '10.1'
|
57
|
-
- !ruby/object:Gem::Dependency
|
58
|
-
name: rake-compiler
|
59
|
-
requirement: !ruby/object:Gem::Requirement
|
60
|
-
requirements:
|
61
|
-
- - "~>"
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
version: '0.9'
|
64
|
-
type: :development
|
65
|
-
prerelease: false
|
66
|
-
version_requirements: !ruby/object:Gem::Requirement
|
67
|
-
requirements:
|
68
|
-
- - "~>"
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
version: '0.9'
|
71
|
-
- !ruby/object:Gem::Dependency
|
72
|
-
name: mocha
|
73
|
-
requirement: !ruby/object:Gem::Requirement
|
74
|
-
requirements:
|
75
|
-
- - "~>"
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: '1.0'
|
78
|
-
type: :development
|
79
|
-
prerelease: false
|
80
|
-
version_requirements: !ruby/object:Gem::Requirement
|
81
|
-
requirements:
|
82
|
-
- - "~>"
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
version: '1.0'
|
85
|
-
- !ruby/object:Gem::Dependency
|
86
|
-
name: minitest
|
87
|
-
requirement: !ruby/object:Gem::Requirement
|
88
|
-
requirements:
|
89
|
-
- - "~>"
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
version: '5.2'
|
92
|
-
type: :development
|
93
|
-
prerelease: false
|
94
|
-
version_requirements: !ruby/object:Gem::Requirement
|
95
|
-
requirements:
|
96
|
-
- - "~>"
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
version: '5.2'
|
99
|
-
- !ruby/object:Gem::Dependency
|
100
|
-
name: coveralls
|
101
|
-
requirement: !ruby/object:Gem::Requirement
|
102
|
-
requirements:
|
103
|
-
- - "~>"
|
104
|
-
- !ruby/object:Gem::Version
|
105
|
-
version: '0.7'
|
106
|
-
type: :development
|
107
|
-
prerelease: false
|
108
|
-
version_requirements: !ruby/object:Gem::Requirement
|
109
|
-
requirements:
|
110
|
-
- - "~>"
|
111
|
-
- !ruby/object:Gem::Version
|
112
|
-
version: '0.7'
|
113
43
|
description: |-
|
114
44
|
Byebug is a Ruby 2 debugger. It's implemented using the
|
115
45
|
Ruby 2 TracePoint C API for execution control and the Debug Inspector C API
|
@@ -145,7 +75,6 @@ files:
|
|
145
75
|
- ext/byebug/threads.c
|
146
76
|
- lib/byebug.rb
|
147
77
|
- lib/byebug/command.rb
|
148
|
-
- lib/byebug/command_processor.rb
|
149
78
|
- lib/byebug/commands/breakpoints.rb
|
150
79
|
- lib/byebug/commands/catchpoint.rb
|
151
80
|
- lib/byebug/commands/condition.rb
|
@@ -175,13 +104,15 @@ files:
|
|
175
104
|
- lib/byebug/commands/trace.rb
|
176
105
|
- lib/byebug/commands/variables.rb
|
177
106
|
- lib/byebug/context.rb
|
178
|
-
- lib/byebug/control_command_processor.rb
|
179
107
|
- lib/byebug/helper.rb
|
108
|
+
- lib/byebug/history.rb
|
180
109
|
- lib/byebug/interface.rb
|
181
110
|
- lib/byebug/interfaces/local_interface.rb
|
182
111
|
- lib/byebug/interfaces/remote_interface.rb
|
183
112
|
- lib/byebug/interfaces/script_interface.rb
|
184
113
|
- lib/byebug/processor.rb
|
114
|
+
- lib/byebug/processors/command_processor.rb
|
115
|
+
- lib/byebug/processors/control_command_processor.rb
|
185
116
|
- lib/byebug/remote.rb
|
186
117
|
- lib/byebug/version.rb
|
187
118
|
- test/breakpoints_test.rb
|
@@ -255,6 +186,7 @@ files:
|
|
255
186
|
- test/support/test_interface.rb
|
256
187
|
- test/test_helper.rb
|
257
188
|
- test/thread_test.rb
|
189
|
+
- test/timeout_test.rb
|
258
190
|
- test/trace_test.rb
|
259
191
|
- test/variables_test.rb
|
260
192
|
homepage: http://github.com/deivid-rodriguez/byebug
|
@@ -277,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
277
209
|
version: '0'
|
278
210
|
requirements: []
|
279
211
|
rubyforge_project:
|
280
|
-
rubygems_version: 2.2.
|
212
|
+
rubygems_version: 2.2.2
|
281
213
|
signing_key:
|
282
214
|
specification_version: 4
|
283
215
|
summary: Ruby 2.0 fast debugger - base + cli
|
@@ -353,5 +285,6 @@ test_files:
|
|
353
285
|
- test/support/test_interface.rb
|
354
286
|
- test/test_helper.rb
|
355
287
|
- test/thread_test.rb
|
288
|
+
- test/timeout_test.rb
|
356
289
|
- test/trace_test.rb
|
357
290
|
- test/variables_test.rb
|