byebug 1.8.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -1
  3. data/GUIDE.md +14 -22
  4. data/README.md +69 -6
  5. data/bin/byebug +3 -20
  6. data/ext/byebug/breakpoint.c +185 -101
  7. data/ext/byebug/byebug.c +393 -214
  8. data/ext/byebug/byebug.h +34 -15
  9. data/ext/byebug/context.c +327 -102
  10. data/ext/byebug/extconf.rb +1 -1
  11. data/ext/byebug/locker.c +54 -0
  12. data/ext/byebug/threads.c +113 -0
  13. data/lib/byebug.rb +19 -58
  14. data/lib/byebug/command.rb +18 -19
  15. data/lib/byebug/commands/breakpoints.rb +1 -4
  16. data/lib/byebug/commands/catchpoint.rb +1 -1
  17. data/lib/byebug/commands/condition.rb +1 -1
  18. data/lib/byebug/commands/control.rb +2 -3
  19. data/lib/byebug/commands/display.rb +2 -7
  20. data/lib/byebug/commands/edit.rb +1 -1
  21. data/lib/byebug/commands/enable.rb +12 -12
  22. data/lib/byebug/commands/eval.rb +4 -4
  23. data/lib/byebug/commands/finish.rb +1 -1
  24. data/lib/byebug/commands/frame.rb +12 -8
  25. data/lib/byebug/commands/info.rb +20 -52
  26. data/lib/byebug/commands/kill.rb +1 -5
  27. data/lib/byebug/commands/list.rb +2 -1
  28. data/lib/byebug/commands/quit.rb +1 -1
  29. data/lib/byebug/commands/repl.rb +2 -2
  30. data/lib/byebug/commands/save.rb +1 -1
  31. data/lib/byebug/commands/set.rb +84 -90
  32. data/lib/byebug/commands/show.rb +44 -53
  33. data/lib/byebug/commands/skip.rb +1 -1
  34. data/lib/byebug/commands/stepping.rb +5 -4
  35. data/lib/byebug/commands/threads.rb +202 -0
  36. data/lib/byebug/commands/trace.rb +1 -1
  37. data/lib/byebug/helper.rb +3 -3
  38. data/lib/byebug/interface.rb +2 -20
  39. data/lib/byebug/processor.rb +21 -100
  40. data/lib/byebug/remote.rb +3 -3
  41. data/lib/byebug/version.rb +1 -1
  42. data/old_doc/byebug.1 +0 -6
  43. data/old_doc/byebug.texi +29 -46
  44. data/test/breakpoints_test.rb +44 -65
  45. data/test/conditions_test.rb +0 -9
  46. data/test/continue_test.rb +2 -2
  47. data/test/display_test.rb +4 -23
  48. data/test/edit_test.rb +2 -16
  49. data/test/eval_test.rb +4 -13
  50. data/test/examples/thread.rb +32 -0
  51. data/test/finish_test.rb +1 -13
  52. data/test/frame_test.rb +5 -12
  53. data/test/help_test.rb +2 -12
  54. data/test/info_test.rb +8 -18
  55. data/test/kill_test.rb +1 -10
  56. data/test/list_test.rb +5 -14
  57. data/test/method_test.rb +1 -10
  58. data/test/post_mortem_test.rb +247 -14
  59. data/test/quit_test.rb +0 -9
  60. data/test/reload_test.rb +1 -15
  61. data/test/repl_test.rb +1 -9
  62. data/test/restart_test.rb +3 -18
  63. data/test/save_test.rb +1 -13
  64. data/test/set_test.rb +35 -32
  65. data/test/show_test.rb +8 -27
  66. data/test/source_test.rb +1 -8
  67. data/test/stepping_test.rb +65 -96
  68. data/test/support/test_dsl.rb +12 -17
  69. data/test/test_helper.rb +1 -1
  70. data/test/thread_test.rb +106 -0
  71. data/test/trace_test.rb +5 -17
  72. data/test/variables_test.rb +1 -10
  73. metadata +9 -7
  74. data/lib/byebug/commands/jump.rb +0 -52
  75. data/test/jump_test.rb +0 -77
  76. data/test/support/context.rb +0 -15
@@ -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 = Thread.new do
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 defined?(@control_thread) && @control_thread
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
- processor = ControlCommandProcessor.new(interface)
61
+ ControlCommandProcessor.new(interface).process_commands
62
62
  processor.process_commands
63
63
  end
64
64
  end
@@ -1,3 +1,3 @@
1
1
  module Byebug
2
- VERSION = '1.8.2'
2
+ VERSION = '2.0.0'
3
3
  end
@@ -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
@@ -1,8 +1,8 @@
1
1
  \input texinfo
2
2
  @setfilename byebug.info
3
3
 
4
- @set BYEBUG_VERSION 1.1.1
5
- @set UPDATED May-2013
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, annotate=nil, control=true, restart_script=nil,
1096
- quit=true, stop=true, script=nil, host=nil, wait=false>
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{***}. However if annotation mode is on then the
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 list ps save where
1330
- break disable eval info method putl set trace
1331
- catch display exit irb next quit show undisplay
1332
- condition down finish jump p reload source up
1333
- continue edit frame kill pp restart step var
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 set annotate} will just give help about the annotate command.
1366
- Furthermore it will give longer help than the summary information that appears
1367
- when you ask for help. You don't need to list the full subcommand name, but just
1368
- enough of the letters to make that subcommand distinct from others will do. For
1369
- example, @code{help set an} is the same as @code{help set annotate}.
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}, @samp{jump})
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 linetrace+ @r{[} on | 1 | off | 0 @r{]}
2617
- @item set linetrace+ @r{[} on | 1 | off | 0 @r{]}
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 linetrace+ on will cause consecutive trace lines not to be a
2620
- duplicate of the preceding line-trace line. Note however that this
2621
- setting doesn't by itself turn on or off line tracing.
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 linetrace+
2624
- @item show linetrace
2625
- Shows whether the line tracing style is to show all lines or remove
2626
- duplicates linetrace lines when it is a repeat of the previous line.
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 :force_stepping
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 :frame_fullpath
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 error. @xref{Trace}.
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
@@ -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
- check_output_includes \
45
- "There are only #{LineCache.size(fullpath('breakpoint'))} lines in" \
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
- check_output_includes \
61
- "Line 11 is not a stopping point in file #{fullpath('breakpoint')}",
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 fullpath('breakpoint') }
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::Command.settings, :basename, true
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::Command.settings, :autoreload, false
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(fullpath('breakpoint'), 14, ''); 'break 14'},
108
- ->{change_line_in_file(fullpath('breakpoint'), 14, 'c = a + b');
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(fullpath('breakpoint'), 14, ''); 'break 14'},
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(fullpath('breakpoint'), 14, 'c = a + b');
120
+ ->{change_line_in_file(@tst_file, 14, 'c = a + b');
122
121
  'break 15'}, 'cont'
123
122
  debug_file 'breakpoint'
124
- check_output_includes \
125
- "Line 14 is not a stopping point in file #{fullpath('breakpoint')}",
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 #{fullpath('breakpoint2')}:3", 'cont' }
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
- check_output_includes 'No source file named asf', interface.error_queue
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
- check_output_includes 'Unknown class B.', interface.error_queue
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
- check_output_includes \
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
- check_output_includes \
246
- '"disable" must be followed by "display", "breakpoints" or ' \
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
- check_output_includes \
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 not a number is provided as an argument to ' \
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
- 'Disable breakpoints argument "foo" needs to be a number.'
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
- check_output_includes \
302
- '"enable" must be followed by "display", "breakpoints" or ' \
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
- check_output_includes \
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
- check_output_includes \
355
- 'Expression "b -=( 3" syntactically incorrect; breakpoint remains ' \
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
- check_output_includes \
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
- check_output_includes \
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