byebug 1.2.0 → 1.3.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 +5 -0
- data/GUIDE.md +210 -4
- data/README.md +93 -64
- data/bin/byebug +10 -4
- data/byebug.gemspec +1 -1
- data/ext/byebug/breakpoint.c +22 -20
- data/lib/byebug/command.rb +5 -3
- data/lib/byebug/commands/frame.rb +2 -1
- data/lib/byebug/commands/kill.rb +0 -1
- data/lib/byebug/commands/set.rb +5 -6
- data/lib/byebug/commands/show.rb +11 -11
- data/lib/byebug/version.rb +1 -1
- data/logo.png +0 -0
- data/old_doc/byebug.texi +2 -2
- data/old_doc/{test-tri2.rb → test-triangle.rb} +4 -5
- data/old_doc/tri3.rb +3 -5
- data/old_doc/triangle.rb +4 -2
- data/test/breakpoints_test.rb +1 -2
- data/test/conditions_test.rb +3 -4
- data/test/continue_test.rb +6 -8
- data/test/display_test.rb +1 -2
- data/test/edit_test.rb +1 -2
- data/test/eval_test.rb +1 -2
- data/test/examples/stepping.rb +4 -0
- data/test/finish_test.rb +1 -2
- data/test/frame_test.rb +1 -2
- data/test/help_test.rb +1 -2
- data/test/info_test.rb +1 -2
- data/test/jump_test.rb +1 -2
- data/test/kill_test.rb +1 -2
- data/test/list_test.rb +1 -2
- data/test/method_test.rb +1 -2
- data/test/post_mortem_test.rb +1 -2
- data/test/quit_test.rb +1 -2
- data/test/reload_test.rb +1 -2
- data/test/repl_test.rb +1 -2
- data/test/restart_test.rb +1 -2
- data/test/save_test.rb +1 -2
- data/test/set_test.rb +6 -11
- data/test/show_test.rb +5 -4
- data/test/source_test.rb +1 -2
- data/test/stepping_test.rb +81 -55
- data/test/support/test_dsl.rb +54 -54
- data/test/test_helper.rb +0 -1
- data/test/trace_test.rb +75 -80
- data/test/variables_test.rb +1 -2
- metadata +6 -5
data/test/test_helper.rb
CHANGED
data/test/trace_test.rb
CHANGED
@@ -1,108 +1,103 @@
|
|
1
1
|
require_relative 'test_helper'
|
2
2
|
|
3
|
-
|
4
|
-
include TestDsl
|
3
|
+
class TestTrace < TestDsl::TestCase
|
5
4
|
|
6
|
-
|
5
|
+
before do
|
6
|
+
Byebug::Command.settings[:basename] = false
|
7
|
+
untrace_var(:$bla) if defined?($bla)
|
8
|
+
end
|
7
9
|
|
8
|
-
|
9
|
-
Byebug::Command.settings[:basename] = false
|
10
|
-
untrace_var(:$bla) if defined?($bla)
|
11
|
-
end
|
10
|
+
describe 'tracing' do
|
12
11
|
|
13
|
-
describe '
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
"Tracing: #{fullpath('trace')}:4 $bla = 4",
|
21
|
-
"Tracing: #{fullpath('trace')}:7 $bla = 7"
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'must be able to use a shortcut' do
|
25
|
-
enter 'tr on', 'cont 7', 'trace off'
|
26
|
-
debug_file 'trace'
|
27
|
-
check_output_includes 'line tracing is on.',
|
28
|
-
"Tracing: #{fullpath('trace')}:4 $bla = 4",
|
29
|
-
"Tracing: #{fullpath('trace')}:7 $bla = 7"
|
30
|
-
end
|
12
|
+
describe 'enabling' do
|
13
|
+
it 'must trace execution by setting trace to on' do
|
14
|
+
enter 'trace on', 'cont 7', 'trace off'
|
15
|
+
debug_file 'trace'
|
16
|
+
check_output_includes 'line tracing is on.',
|
17
|
+
"Tracing: #{fullpath('trace')}:4 $bla = 4",
|
18
|
+
"Tracing: #{fullpath('trace')}:7 $bla = 7"
|
31
19
|
end
|
32
20
|
|
33
|
-
it 'must
|
34
|
-
enter 'trace
|
21
|
+
it 'must be able to use a shortcut' do
|
22
|
+
enter 'tr on', 'cont 7', 'trace off'
|
35
23
|
debug_file 'trace'
|
36
|
-
check_output_includes
|
37
|
-
|
38
|
-
|
24
|
+
check_output_includes 'line tracing is on.',
|
25
|
+
"Tracing: #{fullpath('trace')}:4 $bla = 4",
|
26
|
+
"Tracing: #{fullpath('trace')}:7 $bla = 7"
|
39
27
|
end
|
28
|
+
end
|
40
29
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
end
|
48
|
-
|
49
|
-
it 'must show a message when turned off' do
|
50
|
-
enter 'trace off'
|
51
|
-
debug_file 'trace'
|
52
|
-
check_output_includes 'line tracing is off.'
|
53
|
-
end
|
54
|
-
end
|
30
|
+
it 'must show an error message if given subcommand is incorrect' do
|
31
|
+
enter 'trace bla'
|
32
|
+
debug_file 'trace'
|
33
|
+
check_output_includes \
|
34
|
+
'expecting "on", "off", "var" or "variable"; got: "bla"',
|
35
|
+
interface.error_queue
|
55
36
|
end
|
56
37
|
|
57
|
-
describe '
|
58
|
-
it 'must
|
59
|
-
enter 'trace
|
38
|
+
describe 'disabling' do
|
39
|
+
it 'must stop tracing by setting trace to off' do
|
40
|
+
enter 'trace on', 'next', 'trace off'
|
60
41
|
debug_file 'trace'
|
61
|
-
check_output_includes '
|
62
|
-
|
42
|
+
check_output_includes "Tracing: #{fullpath('trace')}:4 $bla = 4"
|
43
|
+
check_output_doesnt_include "Tracing: #{fullpath('trace')}:5 $bla = 5"
|
63
44
|
end
|
64
45
|
|
65
|
-
it 'must
|
66
|
-
enter 'trace
|
46
|
+
it 'must show a message when turned off' do
|
47
|
+
enter 'trace off'
|
67
48
|
debug_file 'trace'
|
68
|
-
check_output_includes '
|
49
|
+
check_output_includes 'line tracing is off.'
|
69
50
|
end
|
51
|
+
end
|
52
|
+
end
|
70
53
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
54
|
+
describe 'tracing global variables' do
|
55
|
+
it 'must track global variable' do
|
56
|
+
enter 'trace variable $bla'
|
57
|
+
debug_file 'trace'
|
58
|
+
check_output_includes 'traced variable $bla has value 3',
|
59
|
+
'traced variable $bla has value 7'
|
60
|
+
end
|
75
61
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
62
|
+
it 'must be able to use a shortcut' do
|
63
|
+
enter 'trace var $bla'
|
64
|
+
debug_file 'trace'
|
65
|
+
check_output_includes 'traced variable $bla has value 3'
|
66
|
+
end
|
80
67
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
it 'must show an error message if subcommand is invalid' do
|
90
|
-
enter 'trace variable $bla foo'
|
91
|
-
debug_file 'trace'
|
92
|
-
check_output_includes \
|
93
|
-
'expecting "stop" or "nostop"; got "foo"', interface.error_queue
|
94
|
-
end
|
95
|
-
end
|
68
|
+
it 'must track global variable with stop' do
|
69
|
+
enter 'trace variable $bla stop', 'break 7', 'cont'
|
70
|
+
debug_file('trace') { state.line.must_equal 4 }
|
71
|
+
end
|
72
|
+
|
73
|
+
it 'must track global variable with nostop' do
|
74
|
+
enter 'trace variable $bla nostop', 'break 7', 'cont'
|
75
|
+
debug_file('trace') { state.line.must_equal 7 }
|
96
76
|
end
|
97
77
|
|
98
|
-
describe '
|
99
|
-
it 'must
|
100
|
-
enter '
|
101
|
-
debug_file '
|
102
|
-
check_output_includes
|
78
|
+
describe 'errors' do
|
79
|
+
it 'must show an error message if there is no such global variable' do
|
80
|
+
enter 'trace variable $foo'
|
81
|
+
debug_file 'trace'
|
82
|
+
check_output_includes \
|
83
|
+
'$foo is not a global variable.', interface.error_queue
|
84
|
+
end
|
85
|
+
|
86
|
+
it 'must show an error message if subcommand is invalid' do
|
87
|
+
enter 'trace variable $bla foo'
|
88
|
+
debug_file 'trace'
|
89
|
+
check_output_includes \
|
90
|
+
'expecting "stop" or "nostop"; got "foo"', interface.error_queue
|
103
91
|
end
|
104
92
|
end
|
93
|
+
end
|
105
94
|
|
95
|
+
describe 'Post Mortem' do
|
96
|
+
it 'must work in post-mortem mode' do
|
97
|
+
enter 'cont', 'trace on'
|
98
|
+
debug_file 'post_mortem'
|
99
|
+
check_output_includes 'line tracing is on.'
|
100
|
+
end
|
106
101
|
end
|
107
102
|
|
108
103
|
end
|
data/test/variables_test.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: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Rodríguez
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-05-
|
13
|
+
date: 2013-05-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: columnize
|
@@ -88,14 +88,14 @@ dependencies:
|
|
88
88
|
requirements:
|
89
89
|
- - ~>
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version: 5.0.
|
91
|
+
version: 5.0.2
|
92
92
|
type: :development
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
96
|
- - ~>
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
version: 5.0.
|
98
|
+
version: 5.0.2
|
99
99
|
description: |-
|
100
100
|
Byebug is a Ruby 2.0 debugger. It's implemented using the
|
101
101
|
Ruby 2.0 TracePoint C API. The C extension was forked from debase whereas
|
@@ -161,11 +161,12 @@ files:
|
|
161
161
|
- lib/byebug/interface.rb
|
162
162
|
- lib/byebug/processor.rb
|
163
163
|
- lib/byebug/version.rb
|
164
|
+
- logo.png
|
164
165
|
- old_doc/byebug.1
|
165
166
|
- old_doc/byebug.texi
|
166
167
|
- old_doc/hanoi.rb
|
167
168
|
- old_doc/primes.rb
|
168
|
-
- old_doc/test-
|
169
|
+
- old_doc/test-triangle.rb
|
169
170
|
- old_doc/tri3.rb
|
170
171
|
- old_doc/triangle.rb
|
171
172
|
- test/breakpoints_test.rb
|