byebug 1.8.2 → 2.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/CHANGELOG.md +8 -1
- data/GUIDE.md +14 -22
- data/README.md +69 -6
- data/bin/byebug +3 -20
- data/ext/byebug/breakpoint.c +185 -101
- data/ext/byebug/byebug.c +393 -214
- data/ext/byebug/byebug.h +34 -15
- data/ext/byebug/context.c +327 -102
- data/ext/byebug/extconf.rb +1 -1
- data/ext/byebug/locker.c +54 -0
- data/ext/byebug/threads.c +113 -0
- data/lib/byebug.rb +19 -58
- data/lib/byebug/command.rb +18 -19
- data/lib/byebug/commands/breakpoints.rb +1 -4
- data/lib/byebug/commands/catchpoint.rb +1 -1
- data/lib/byebug/commands/condition.rb +1 -1
- data/lib/byebug/commands/control.rb +2 -3
- data/lib/byebug/commands/display.rb +2 -7
- data/lib/byebug/commands/edit.rb +1 -1
- data/lib/byebug/commands/enable.rb +12 -12
- data/lib/byebug/commands/eval.rb +4 -4
- data/lib/byebug/commands/finish.rb +1 -1
- data/lib/byebug/commands/frame.rb +12 -8
- data/lib/byebug/commands/info.rb +20 -52
- data/lib/byebug/commands/kill.rb +1 -5
- data/lib/byebug/commands/list.rb +2 -1
- data/lib/byebug/commands/quit.rb +1 -1
- data/lib/byebug/commands/repl.rb +2 -2
- data/lib/byebug/commands/save.rb +1 -1
- data/lib/byebug/commands/set.rb +84 -90
- data/lib/byebug/commands/show.rb +44 -53
- data/lib/byebug/commands/skip.rb +1 -1
- data/lib/byebug/commands/stepping.rb +5 -4
- data/lib/byebug/commands/threads.rb +202 -0
- data/lib/byebug/commands/trace.rb +1 -1
- data/lib/byebug/helper.rb +3 -3
- data/lib/byebug/interface.rb +2 -20
- data/lib/byebug/processor.rb +21 -100
- data/lib/byebug/remote.rb +3 -3
- data/lib/byebug/version.rb +1 -1
- data/old_doc/byebug.1 +0 -6
- data/old_doc/byebug.texi +29 -46
- data/test/breakpoints_test.rb +44 -65
- data/test/conditions_test.rb +0 -9
- data/test/continue_test.rb +2 -2
- data/test/display_test.rb +4 -23
- data/test/edit_test.rb +2 -16
- data/test/eval_test.rb +4 -13
- data/test/examples/thread.rb +32 -0
- data/test/finish_test.rb +1 -13
- data/test/frame_test.rb +5 -12
- data/test/help_test.rb +2 -12
- data/test/info_test.rb +8 -18
- data/test/kill_test.rb +1 -10
- data/test/list_test.rb +5 -14
- data/test/method_test.rb +1 -10
- data/test/post_mortem_test.rb +247 -14
- data/test/quit_test.rb +0 -9
- data/test/reload_test.rb +1 -15
- data/test/repl_test.rb +1 -9
- data/test/restart_test.rb +3 -18
- data/test/save_test.rb +1 -13
- data/test/set_test.rb +35 -32
- data/test/show_test.rb +8 -27
- data/test/source_test.rb +1 -8
- data/test/stepping_test.rb +65 -96
- data/test/support/test_dsl.rb +12 -17
- data/test/test_helper.rb +1 -1
- data/test/thread_test.rb +106 -0
- data/test/trace_test.rb +5 -17
- data/test/variables_test.rb +1 -10
- metadata +9 -7
- data/lib/byebug/commands/jump.rb +0 -52
- data/test/jump_test.rb +0 -77
- data/test/support/context.rb +0 -15
data/lib/byebug/remote.rb
CHANGED
@@ -34,7 +34,7 @@ module Byebug
|
|
34
34
|
|
35
35
|
server = TCPServer.new(host, cmd_port)
|
36
36
|
@cmd_port = cmd_port = server.addr[1]
|
37
|
-
@thread =
|
37
|
+
@thread = DebugThread.new do
|
38
38
|
while (session = server.accept)
|
39
39
|
self.interface = RemoteInterface.new(session)
|
40
40
|
if wait_connection
|
@@ -52,13 +52,13 @@ module Byebug
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def start_control(host = nil, ctrl_port = PORT + 1)
|
55
|
-
return @ctrl_port if
|
55
|
+
return @ctrl_port if @control_thread
|
56
56
|
server = TCPServer.new(host, ctrl_port)
|
57
57
|
@ctrl_port = server.addr[1]
|
58
58
|
@control_thread = Thread.new do
|
59
59
|
while (session = server.accept)
|
60
60
|
interface = RemoteInterface.new(session)
|
61
|
-
|
61
|
+
ControlCommandProcessor.new(interface).process_commands
|
62
62
|
processor.process_commands
|
63
63
|
end
|
64
64
|
end
|
data/lib/byebug/version.rb
CHANGED
data/old_doc/byebug.1
CHANGED
@@ -147,12 +147,6 @@ https://github.com/cldwalker/byebug
|
|
147
147
|
.PP
|
148
148
|
.TP 10
|
149
149
|
.TP
|
150
|
-
.B \-A | \-\-annotate LEVEL
|
151
|
-
Set gdb-style annotation to LEVEL, a number. Additional information is output
|
152
|
-
automatically when program state is changed. This can be used by
|
153
|
-
front-ends such as GNU Emacs to post this updated information without
|
154
|
-
having to poll for it.
|
155
|
-
.TP
|
156
150
|
.B \-d | \-\-debug
|
157
151
|
Set $DEBUG true.
|
158
152
|
.TP
|
data/old_doc/byebug.texi
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
\input texinfo
|
2
2
|
@setfilename byebug.info
|
3
3
|
|
4
|
-
@set BYEBUG_VERSION 1.
|
5
|
-
@set UPDATED
|
4
|
+
@set BYEBUG_VERSION 1.8.2
|
5
|
+
@set UPDATED Aug-2013
|
6
6
|
|
7
7
|
@macro Example {}
|
8
8
|
@iftex
|
@@ -917,7 +917,6 @@ byebug @value{BYEBUG_VERSION}
|
|
917
917
|
Usage: byebug [options] <script.rb> -- <script.rb parameters>
|
918
918
|
|
919
919
|
Options:
|
920
|
-
-A, --annotate LEVEL Set annotation level
|
921
920
|
-d, --debug Set $DEBUG=true
|
922
921
|
-I, --include PATH Add PATH to $LOAD_PATH
|
923
922
|
--keep-frame-binding Keep frame bindings
|
@@ -968,13 +967,6 @@ This option causes @code{byebug} to print some basic help and exit.
|
|
968
967
|
@cindex @option{-v}
|
969
968
|
This option causes @code{byebug} to print its version number and exit.
|
970
969
|
|
971
|
-
@item -A | --annotate @var{level}
|
972
|
-
@cindex @option{-A}
|
973
|
-
@cindex @option{--annotation} @var{level}
|
974
|
-
Set gdb-style annotation @var{level}, a number. Additional information is output
|
975
|
-
automatically when program state is changed. This can be used by front-ends such
|
976
|
-
as GNU Emacs to post this updated information without having to poll for it.
|
977
|
-
|
978
970
|
@item --debug
|
979
971
|
@cindex @option{--debug}
|
980
972
|
Set @code{$DEBUG} to @code{true}. This option is compatible with Ruby's.
|
@@ -1092,8 +1084,8 @@ Here are the default values in @code{options}
|
|
1092
1084
|
@smallexample
|
1093
1085
|
#<OpenStruct server=false, client=false, frame_bind=false, cport=8990,
|
1094
1086
|
tracing=false, nx=false, post_mortem=false, port=8989,
|
1095
|
-
verbose_long=false,
|
1096
|
-
|
1087
|
+
verbose_long=false, control=true, restart_script=nil, quit=true,
|
1088
|
+
stop=true, script=nil, host=nil, wait=false>
|
1097
1089
|
@end smallexample
|
1098
1090
|
|
1099
1091
|
@node Command Files
|
@@ -1298,8 +1290,7 @@ will be @code{(byebug:post-mortem)}.
|
|
1298
1290
|
|
1299
1291
|
In the local interface, whenever @code{byebug} gives an error message such as
|
1300
1292
|
for an invalid command, or an invalid location position, it will generally
|
1301
|
-
preface the message with @code{***}.
|
1302
|
-
message is put in a @code{begin-error} annotation and no @code{***} appears.
|
1293
|
+
preface the message with @code{***}.
|
1303
1294
|
|
1304
1295
|
@node Help
|
1305
1296
|
@section Getting help (@samp{help})
|
@@ -1326,11 +1317,11 @@ byebug help v@value{BYEBUG_VERSION}
|
|
1326
1317
|
Type 'help <command-name>' for help on a specific command
|
1327
1318
|
|
1328
1319
|
Available commands:
|
1329
|
-
backtrace delete enable help
|
1330
|
-
break disable eval info
|
1331
|
-
catch display exit irb
|
1332
|
-
condition down finish
|
1333
|
-
continue edit frame
|
1320
|
+
backtrace delete enable help method ps save step where
|
1321
|
+
break disable eval info next putl set trace
|
1322
|
+
catch display exit irb p quit show undisplay
|
1323
|
+
condition down finish kill pp reload skip up
|
1324
|
+
continue edit frame list pry restart source var
|
1334
1325
|
@end smallexample
|
1335
1326
|
@end flushleft
|
1336
1327
|
@c the above line break eliminates huge line overfull...
|
@@ -1362,11 +1353,12 @@ include @code{info}, @code{set}, @code{show}, @code{enable} and @code{disable}.
|
|
1362
1353
|
When you ask for help for one of these commands, you will get help for all of
|
1363
1354
|
the subcommands that that command offers. Sometimes you may want help that
|
1364
1355
|
subcommand and to do this just follow the command with its subcommand name. For
|
1365
|
-
example @code{help
|
1366
|
-
Furthermore it will give longer help than the
|
1367
|
-
when you ask for help. You don't need to list
|
1368
|
-
enough of the letters to make that subcommand
|
1369
|
-
example, @code{help
|
1356
|
+
example @code{help info breakpoints} will just give help about the
|
1357
|
+
@code{info breakpoints} command. Furthermore it will give longer help than the
|
1358
|
+
summary information that appears when you ask for help. You don't need to list
|
1359
|
+
the full subcommand name, but just enough of the letters to make that subcommand
|
1360
|
+
distinct from others will do. For example, @code{help info b} is the same as
|
1361
|
+
@code{help info breakpoints}.
|
1370
1362
|
|
1371
1363
|
Some examples follow.
|
1372
1364
|
@example
|
@@ -2252,7 +2244,7 @@ condition 1 # Change that! Unconditionally stop on breakpoint 1.
|
|
2252
2244
|
@end example
|
2253
2245
|
|
2254
2246
|
@node Resuming Execution
|
2255
|
-
@subsection Resuming Execution (@samp{step}, @samp{next}, @samp{finish}, @samp{continue}
|
2247
|
+
@subsection Resuming Execution (@samp{step}, @samp{next}, @samp{finish}, @samp{continue})
|
2256
2248
|
|
2257
2249
|
A typical technique for using stepping is to set a breakpoint
|
2258
2250
|
(@pxref{Breakpoints}) at the beginning of the function or the section of your
|
@@ -2274,7 +2266,6 @@ breakpoint or a signal.
|
|
2274
2266
|
* Next:: running the next statement skipping over functions (next)
|
2275
2267
|
* Finish:: running until the return of a function or ``source'' (finish)
|
2276
2268
|
* Continue:: continuing execution (continue)
|
2277
|
-
* Jump:: jumping to a new line (jump)
|
2278
2269
|
@end menu
|
2279
2270
|
|
2280
2271
|
@node Step
|
@@ -2367,14 +2358,6 @@ a listing of the breakpoints you won't see this entry in the list of
|
|
2367
2358
|
breakpoints.
|
2368
2359
|
@end table
|
2369
2360
|
|
2370
|
-
@node Jump
|
2371
|
-
@subsubsection Jump (@samp{jump})
|
2372
|
-
@table @code
|
2373
|
-
@kindex jump @r{[}+-@r{]} @ovar{line}
|
2374
|
-
@item jump @r{[}+-@r{]} @ovar{line}
|
2375
|
-
Change the next line to execute to the given line number.
|
2376
|
-
@end table
|
2377
|
-
|
2378
2361
|
@node byebug settings
|
2379
2362
|
@section byebug settings (@samp{set args}, @samp{set autoeval}..)
|
2380
2363
|
|
@@ -2613,17 +2596,17 @@ Shows whether line tracing is in effect or not.
|
|
2613
2596
|
@subsection Set/Show Line tracing style
|
2614
2597
|
|
2615
2598
|
@table @code
|
2616
|
-
@kindex set
|
2617
|
-
@item set
|
2599
|
+
@kindex set linetrace_plus @r{[} on | 1 | off | 0 @r{]}
|
2600
|
+
@item set linetrace_plus @r{[} on | 1 | off | 0 @r{]}
|
2618
2601
|
|
2619
|
-
Setting
|
2620
|
-
duplicate of the preceding
|
2621
|
-
|
2602
|
+
Setting linetrace_plus on will cause every trace line to be printed, even if
|
2603
|
+
it's a duplicate of the preceding trace line. Note however that this setting
|
2604
|
+
doesn't by itself turn on or off line tracing.
|
2622
2605
|
|
2623
|
-
@kindex show
|
2624
|
-
@item show
|
2625
|
-
Shows whether the line tracing style is to show all lines or remove
|
2626
|
-
|
2606
|
+
@kindex show linetrace_plus
|
2607
|
+
@item show linetrace_plus
|
2608
|
+
Shows whether the line tracing style is to show all lines or remove duplicates
|
2609
|
+
linetrace lines when it is a repeat of the previous line.
|
2627
2610
|
@end table
|
2628
2611
|
|
2629
2612
|
@node Listsize
|
@@ -2963,17 +2946,17 @@ Boolean. True if basename on. @xref{Basename}.
|
|
2963
2946
|
Symbol: @code{:short} or @code{:long}. @xref{Callstyle}.
|
2964
2947
|
@item :testing
|
2965
2948
|
Boolean. True if currently testing byebug.
|
2966
|
-
@item :
|
2949
|
+
@item :forcestep
|
2967
2950
|
Boolean. True if stepping should go to a line different from the last
|
2968
2951
|
step. @xref{Forcestep}.
|
2969
|
-
@item :
|
2952
|
+
@item :fullpath
|
2970
2953
|
Boolean. @xref{Fullpath}.
|
2971
2954
|
@item :listsize
|
2972
2955
|
Fixnum. Number of lines to show in a @code{list} command. @xref{Listsize}.
|
2973
2956
|
@item :autoreload
|
2974
2957
|
Boolean. True if we should reread the source every time it changes. @xref{Autoreload}.
|
2975
2958
|
@item :stack_trace_on_error
|
2976
|
-
Boolean. True if we should produce a stack trace on
|
2959
|
+
Boolean. True if we should produce a stack trace on eval errors. @xref{Trace}.
|
2977
2960
|
@item :width
|
2978
2961
|
Fixnum. Number of characters byebug thinks are in a line. @xref{Width}.
|
2979
2962
|
@end table
|
data/test/breakpoints_test.rb
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
require_relative 'test_helper'
|
2
2
|
|
3
3
|
class TestBreakpoints < TestDsl::TestCase
|
4
|
+
before do
|
5
|
+
@tst_file = fullpath('breakpoint')
|
6
|
+
@tst_file_2 = fullpath('breakpoint2')
|
7
|
+
end
|
4
8
|
|
5
9
|
describe 'setting breakpoint in the current file' do
|
6
10
|
before { enter 'break 10' }
|
11
|
+
|
7
12
|
subject { Byebug.breakpoints.first }
|
8
13
|
|
9
14
|
def check_subject(field, value)
|
@@ -11,8 +16,7 @@ class TestBreakpoints < TestDsl::TestCase
|
|
11
16
|
end
|
12
17
|
|
13
18
|
it('must have correct pos') { check_subject(:pos, 10) }
|
14
|
-
it('must have correct source') {
|
15
|
-
check_subject(:source, fullpath('breakpoint')) }
|
19
|
+
it('must have correct source') { check_subject(:source, @tst_file) }
|
16
20
|
it('must have correct expression') { check_subject(:expr, nil) }
|
17
21
|
it('must have correct hit count') { check_subject(:hit_count, 0) }
|
18
22
|
it('must have correct hit value') { check_subject(:hit_value, 0) }
|
@@ -20,8 +24,7 @@ class TestBreakpoints < TestDsl::TestCase
|
|
20
24
|
it('must return right response') do
|
21
25
|
id = nil
|
22
26
|
debug_file('breakpoint') { id = subject.id }
|
23
|
-
check_output_includes
|
24
|
-
"Created breakpoint #{id} at #{fullpath('breakpoint')}:10"
|
27
|
+
check_output_includes "Created breakpoint #{id} at #{@tst_file}:10"
|
25
28
|
end
|
26
29
|
end
|
27
30
|
|
@@ -41,9 +44,8 @@ class TestBreakpoints < TestDsl::TestCase
|
|
41
44
|
|
42
45
|
it 'must show an error' do
|
43
46
|
debug_file('breakpoint')
|
44
|
-
|
45
|
-
"There are only #{LineCache.size(
|
46
|
-
" file #{fullpath('breakpoint')}", interface.error_queue
|
47
|
+
check_error_includes \
|
48
|
+
"There are only #{LineCache.size(@tst_file)} lines in file #{@tst_file}"
|
47
49
|
end
|
48
50
|
end
|
49
51
|
|
@@ -57,9 +59,8 @@ class TestBreakpoints < TestDsl::TestCase
|
|
57
59
|
|
58
60
|
it 'must show an error' do
|
59
61
|
debug_file('breakpoint')
|
60
|
-
|
61
|
-
"Line 11 is not a stopping point in file #{
|
62
|
-
interface.error_queue
|
62
|
+
check_error_includes \
|
63
|
+
"Line 11 is not a stopping point in file #{@tst_file}"
|
63
64
|
end
|
64
65
|
end
|
65
66
|
|
@@ -71,7 +72,7 @@ class TestBreakpoints < TestDsl::TestCase
|
|
71
72
|
|
72
73
|
it 'must stop at the correct file' do
|
73
74
|
enter 'break 14', 'cont'
|
74
|
-
debug_file('breakpoint') { $state.file.must_equal
|
75
|
+
debug_file('breakpoint') { $state.file.must_equal @tst_file }
|
75
76
|
end
|
76
77
|
|
77
78
|
describe 'show a message' do
|
@@ -80,13 +81,12 @@ class TestBreakpoints < TestDsl::TestCase
|
|
80
81
|
it 'must show a message with full filename' do
|
81
82
|
enter 'break 14', 'cont'
|
82
83
|
debug_file('breakpoint') { @id = Byebug.breakpoints.first.id }
|
83
|
-
check_output_includes
|
84
|
-
"Created breakpoint #{@id} at #{fullpath('breakpoint')}:14"
|
84
|
+
check_output_includes "Created breakpoint #{@id} at #{@tst_file}:14"
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
88
|
describe 'with basename' do
|
89
|
-
temporary_change_hash Byebug
|
89
|
+
temporary_change_hash Byebug.settings, :basename, true
|
90
90
|
|
91
91
|
it 'must show a message with basename' do
|
92
92
|
enter 'break 14', 'cont'
|
@@ -99,46 +99,43 @@ class TestBreakpoints < TestDsl::TestCase
|
|
99
99
|
|
100
100
|
describe 'reloading source on change' do
|
101
101
|
describe 'autoreload not set' do
|
102
|
-
temporary_change_hash Byebug
|
102
|
+
temporary_change_hash Byebug.settings, :autoreload, false
|
103
103
|
|
104
104
|
it 'must not reload source' do
|
105
105
|
id = nil
|
106
106
|
enter \
|
107
|
-
->{change_line_in_file(
|
108
|
-
->{change_line_in_file(
|
107
|
+
->{change_line_in_file(@tst_file, 14, ''); 'break 14'},
|
108
|
+
->{change_line_in_file(@tst_file, 14, 'c = a + b');
|
109
109
|
'cont'}
|
110
110
|
debug_file('breakpoint') { id = Byebug.breakpoints.first.id }
|
111
|
-
check_output_includes
|
112
|
-
"Created breakpoint #{id} at #{fullpath('breakpoint')}:14"
|
111
|
+
check_output_includes "Created breakpoint #{id} at #{@tst_file}:14"
|
113
112
|
end
|
114
113
|
end
|
115
114
|
|
116
115
|
describe 'autoreload set' do
|
117
116
|
it 'must reload source' do
|
118
117
|
enter \
|
119
|
-
->{change_line_in_file(
|
118
|
+
->{change_line_in_file(@tst_file, 14, ''); 'break 14'},
|
120
119
|
# 2nd breakpoint just to reload source code after rolling changes back
|
121
|
-
->{change_line_in_file(
|
120
|
+
->{change_line_in_file(@tst_file, 14, 'c = a + b');
|
122
121
|
'break 15'}, 'cont'
|
123
122
|
debug_file 'breakpoint'
|
124
|
-
|
125
|
-
"Line 14 is not a stopping point in file #{
|
126
|
-
interface.error_queue
|
123
|
+
check_error_includes \
|
124
|
+
"Line 14 is not a stopping point in file #{@tst_file}"
|
127
125
|
end
|
128
126
|
end
|
129
127
|
end
|
130
128
|
|
131
129
|
describe 'set breakpoint in a file' do
|
132
130
|
describe 'successfully' do
|
133
|
-
before { enter "break #{
|
131
|
+
before { enter "break #{@tst_file_2}:3", 'cont' }
|
134
132
|
|
135
133
|
it 'must stop at the correct line' do
|
136
134
|
debug_file('breakpoint') { $state.line.must_equal 3 }
|
137
135
|
end
|
138
136
|
|
139
137
|
it 'must stop at the correct file' do
|
140
|
-
debug_file('breakpoint') {
|
141
|
-
$state.file.must_equal fullpath('breakpoint2') }
|
138
|
+
debug_file('breakpoint') { $state.file.must_equal @tst_file_2 }
|
142
139
|
end
|
143
140
|
end
|
144
141
|
|
@@ -147,8 +144,9 @@ class TestBreakpoints < TestDsl::TestCase
|
|
147
144
|
enter 'break asf:324'
|
148
145
|
debug_file('breakpoint')
|
149
146
|
end
|
147
|
+
|
150
148
|
it 'must show an error' do
|
151
|
-
|
149
|
+
check_error_includes 'No source file named asf'
|
152
150
|
end
|
153
151
|
|
154
152
|
it 'must ask about setting breakpoint anyway' do
|
@@ -167,8 +165,7 @@ class TestBreakpoints < TestDsl::TestCase
|
|
167
165
|
end
|
168
166
|
|
169
167
|
it 'must stop at the correct file' do
|
170
|
-
debug_file('breakpoint') {
|
171
|
-
$state.file.must_equal fullpath('breakpoint') }
|
168
|
+
debug_file('breakpoint') { $state.file.must_equal @tst_file }
|
172
169
|
end
|
173
170
|
end
|
174
171
|
|
@@ -180,8 +177,7 @@ class TestBreakpoints < TestDsl::TestCase
|
|
180
177
|
end
|
181
178
|
|
182
179
|
it 'must stop at the correct file' do
|
183
|
-
debug_file('breakpoint') {
|
184
|
-
$state.file.must_equal fullpath('breakpoint') }
|
180
|
+
debug_file('breakpoint') { $state.file.must_equal @tst_file }
|
185
181
|
end
|
186
182
|
end
|
187
183
|
|
@@ -189,7 +185,7 @@ class TestBreakpoints < TestDsl::TestCase
|
|
189
185
|
it 'must show an error' do
|
190
186
|
enter 'break B.a'
|
191
187
|
debug_file('breakpoint')
|
192
|
-
|
188
|
+
check_error_includes 'Unknown class B.'
|
193
189
|
end
|
194
190
|
end
|
195
191
|
end
|
@@ -203,8 +199,7 @@ class TestBreakpoints < TestDsl::TestCase
|
|
203
199
|
|
204
200
|
it 'must show an error' do
|
205
201
|
debug_file('breakpoint')
|
206
|
-
|
207
|
-
'Invalid breakpoint location: foo.', interface.error_queue
|
202
|
+
check_error_includes 'Invalid breakpoint location: foo.'
|
208
203
|
end
|
209
204
|
end
|
210
205
|
|
@@ -242,24 +237,21 @@ class TestBreakpoints < TestDsl::TestCase
|
|
242
237
|
it 'must show an error if syntax is incorrect' do
|
243
238
|
enter 'disable'
|
244
239
|
debug_file('breakpoint')
|
245
|
-
|
246
|
-
|
247
|
-
'breakpoint numbers.', interface.error_queue
|
240
|
+
check_error_includes '"disable" must be followed by "display", ' \
|
241
|
+
'"breakpoints" or breakpoint numbers.'
|
248
242
|
end
|
249
243
|
|
250
244
|
it 'must show an error if no breakpoints is set' do
|
251
245
|
enter 'disable 1'
|
252
246
|
debug_file('breakpoint')
|
253
|
-
|
254
|
-
'No breakpoints have been set.', interface.error_queue
|
247
|
+
check_error_includes 'No breakpoints have been set.'
|
255
248
|
end
|
256
249
|
|
257
|
-
it 'must show an error if
|
258
|
-
' "disable" command' do
|
250
|
+
it 'must show an error if a number is not provided as an argument' do
|
259
251
|
enter 'break 14', 'disable foo'
|
260
252
|
debug_file('breakpoint')
|
261
253
|
check_output_includes \
|
262
|
-
'
|
254
|
+
'"disable breakpoints" argument "foo" needs to be a number.'
|
263
255
|
end
|
264
256
|
end
|
265
257
|
end
|
@@ -298,9 +290,8 @@ class TestBreakpoints < TestDsl::TestCase
|
|
298
290
|
it 'must show an error if syntax is incorrect' do
|
299
291
|
enter 'enable'
|
300
292
|
debug_file('breakpoint')
|
301
|
-
|
302
|
-
|
303
|
-
'breakpoint numbers.', interface.error_queue
|
293
|
+
check_error_includes '"enable" must be followed by "display", ' \
|
294
|
+
'"breakpoints" or breakpoint numbers.'
|
304
295
|
end
|
305
296
|
end
|
306
297
|
end
|
@@ -333,9 +324,8 @@ class TestBreakpoints < TestDsl::TestCase
|
|
333
324
|
it 'must show an error when conditional syntax is wrong' do
|
334
325
|
enter 'break 14 ifa b == 3', 'break 15', 'cont'
|
335
326
|
debug_file('breakpoint') { $state.line.must_equal 15 }
|
336
|
-
|
337
|
-
'Expecting "if" in breakpoint condition; got: ifa b == 3.'
|
338
|
-
interface.error_queue
|
327
|
+
check_error_includes \
|
328
|
+
'Expecting "if" in breakpoint condition; got: ifa b == 3.'
|
339
329
|
end
|
340
330
|
|
341
331
|
describe 'enabling with wrong conditional syntax' do
|
@@ -351,25 +341,22 @@ class TestBreakpoints < TestDsl::TestCase
|
|
351
341
|
|
352
342
|
it 'must show an error' do
|
353
343
|
debug_file('breakpoint')
|
354
|
-
|
355
|
-
|
356
|
-
'disabled.', interface.error_queue
|
344
|
+
check_error_includes 'Expression "b -=( 3" syntactically incorrect; ' \
|
345
|
+
'breakpoint remains disabled.'
|
357
346
|
end
|
358
347
|
end
|
359
348
|
|
360
349
|
it 'must show an error if no file or line is specified' do
|
361
350
|
enter 'break ifa b == 3', 'break 15', 'cont'
|
362
351
|
debug_file('breakpoint') { $state.line.must_equal 15 }
|
363
|
-
|
364
|
-
'Invalid breakpoint location: ifa b == 3.', interface.error_queue
|
352
|
+
check_error_includes 'Invalid breakpoint location: ifa b == 3.'
|
365
353
|
end
|
366
354
|
|
367
355
|
it 'must show an error if expression syntax is invalid' do
|
368
356
|
enter 'break if b -=) 3', 'break 15', 'cont'
|
369
357
|
debug_file('breakpoint') { $state.line.must_equal 15 }
|
370
|
-
|
371
|
-
'Expression "b -=) 3" syntactically incorrect; breakpoint disabled.'
|
372
|
-
interface.error_queue
|
358
|
+
check_error_includes \
|
359
|
+
'Expression "b -=) 3" syntactically incorrect; breakpoint disabled.'
|
373
360
|
end
|
374
361
|
end
|
375
362
|
|
@@ -394,12 +381,4 @@ class TestBreakpoints < TestDsl::TestCase
|
|
394
381
|
check_output_includes /b\[reak\] file:line \[if expr\]/
|
395
382
|
end
|
396
383
|
end
|
397
|
-
|
398
|
-
describe 'Post Mortem' do
|
399
|
-
it 'must be able to set breakpoints in post-mortem mode' do
|
400
|
-
enter 'cont', 'break 12', 'cont'
|
401
|
-
debug_file('post_mortem') { $state.line.must_equal 12 }
|
402
|
-
end
|
403
|
-
end
|
404
|
-
|
405
384
|
end
|