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.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -6
  3. data/.travis.yml +1 -0
  4. data/CHANGELOG.md +23 -0
  5. data/Gemfile +9 -0
  6. data/README.md +35 -32
  7. data/Rakefile +1 -3
  8. data/byebug.gemspec +0 -6
  9. data/ext/byebug/byebug.c +64 -51
  10. data/ext/byebug/byebug.h +12 -13
  11. data/ext/byebug/context.c +28 -43
  12. data/ext/byebug/extconf.rb +6 -6
  13. data/lib/byebug.rb +34 -38
  14. data/lib/byebug/command.rb +4 -2
  15. data/lib/byebug/commands/continue.rb +0 -1
  16. data/lib/byebug/commands/control.rb +0 -1
  17. data/lib/byebug/commands/edit.rb +1 -1
  18. data/lib/byebug/commands/finish.rb +10 -16
  19. data/lib/byebug/commands/help.rb +1 -1
  20. data/lib/byebug/commands/kill.rb +1 -1
  21. data/lib/byebug/commands/quit.rb +1 -1
  22. data/lib/byebug/commands/repl.rb +3 -3
  23. data/lib/byebug/commands/set.rb +24 -39
  24. data/lib/byebug/commands/show.rb +39 -112
  25. data/lib/byebug/commands/stepping.rb +0 -2
  26. data/lib/byebug/commands/threads.rb +0 -5
  27. data/lib/byebug/commands/trace.rb +1 -1
  28. data/lib/byebug/commands/variables.rb +1 -1
  29. data/lib/byebug/context.rb +8 -12
  30. data/lib/byebug/helper.rb +1 -1
  31. data/lib/byebug/history.rb +46 -0
  32. data/lib/byebug/interface.rb +5 -5
  33. data/lib/byebug/interfaces/local_interface.rb +11 -62
  34. data/lib/byebug/interfaces/remote_interface.rb +6 -22
  35. data/lib/byebug/interfaces/script_interface.rb +2 -17
  36. data/lib/byebug/processor.rb +4 -4
  37. data/lib/byebug/{command_processor.rb → processors/command_processor.rb} +7 -14
  38. data/lib/byebug/{control_command_processor.rb → processors/control_command_processor.rb} +3 -7
  39. data/lib/byebug/version.rb +1 -1
  40. data/test/edit_test.rb +6 -6
  41. data/test/examples/breakpoint_deep.rb +1 -1
  42. data/test/finish_test.rb +6 -6
  43. data/test/help_test.rb +1 -1
  44. data/test/info_test.rb +0 -1
  45. data/test/kill_test.rb +2 -2
  46. data/test/post_mortem_test.rb +35 -219
  47. data/test/quit_test.rb +2 -2
  48. data/test/restart_test.rb +12 -33
  49. data/test/set_test.rb +80 -107
  50. data/test/show_test.rb +42 -77
  51. data/test/stepping_test.rb +1 -1
  52. data/test/support/test_dsl.rb +4 -25
  53. data/test/support/test_interface.rb +40 -48
  54. data/test/test_helper.rb +1 -3
  55. data/test/timeout_test.rb +9 -0
  56. metadata +8 -75
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 818c1a2ce9a37a4dcbf84f6b3e4932335fe94e9d
4
- data.tar.gz: d90fd4507ad0a2cd3c8c1f250852ae24d158161a
3
+ metadata.gz: aefd49bb6a9a42bed03f3bfd3e5c05b260460e16
4
+ data.tar.gz: 2123202331fe1df741b263453e287273383aeb3f
5
5
  SHA512:
6
- metadata.gz: e6ee7f21fa7997aa8fa88aba5cfaf3135541013ca5e45411db5bacfdb7727c6c36492de7db70c811f036e85391c9692d03da98d24b33e607cded2d51da6ca4f0
7
- data.tar.gz: 1751d22e086c298da4dc76311328e66e57cf9d779d33c14116c542c951515127fadfac72b5808e64db808c7c4c5440c05c7acb110e0640dc5f6c8f8c639cdc7b
6
+ metadata.gz: 27cb2714d6b8d457aed200e9c5beabaad6d94912e4ecc78c2bbdd3e809d8dce76834d49fdb02fbd89814c3e9bdeb01df5c9346ec777f5a9f4ca3f1fbab94b908
7
+ data.tar.gz: 72a02e12800f4b7b39d8b6f6b54615046ca80b7a774109ef60c5f18cfc4a959785a804f5ab204e926d984d7421c2c7f430f56a6f273c45ed1643a76627ea9398
data/.gitignore CHANGED
@@ -2,15 +2,11 @@ tmp
2
2
  pkg
3
3
  doc
4
4
 
5
- .rvmrc
6
- .ruby-version
7
- .ruby-gemset
8
- .gdbinit
9
5
  .gdb_history
10
6
  .bundle
11
7
  .tags
12
- .ackrc
13
- .jrubyrc
8
+ .byebugrc
9
+ .byebug_hist
14
10
 
15
11
  Gemfile.lock
16
12
 
@@ -2,6 +2,7 @@ before_script: bundle exec rake compile
2
2
  rvm:
3
3
  - 2.0.0
4
4
  - 2.1.0
5
+ - 2.1.1
5
6
  - ruby-head
6
7
  matrix:
7
8
  allow_failures:
@@ -1,3 +1,26 @@
1
+ # 3.0.0
2
+
3
+ - Bugfixes
4
+ * Fix post_mortem mode
5
+ * Command history is also saved after regular program termination, not only
6
+ after quitting with the `q` command.
7
+ * Fix failure when calling Byebug.start with Timeout::timeout (see #54), thanks
8
+ @zmoazeni!
9
+
10
+ - Changes
11
+ * `show commands` command for listing history of previous byebug commands now
12
+ behaves like shell's `history` command.
13
+ * Changes in `history` commands: see
14
+ [50e6ad8](https://github.com/deivid-rodriguez/byebug/commit/50e6ad8)
15
+ * Changes in `finish` semantics and in the C extension API: see
16
+ [61f9b4d](https://github.com/deivid-rodriguez/byebug/commit/61f9b4d)
17
+ * The `init` option for Byebug.start has been removed. Information to make the
18
+ `restart` command work is always saved now.
19
+
20
+ - Features
21
+ * Allow disabling post_mortem mode
22
+
23
+
1
24
  # 2.7.0
2
25
  * Bugfix release (#52, #53 and #54)
3
26
 
data/Gemfile CHANGED
@@ -1,3 +1,12 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
+
5
+ gem 'rake', '~> 10.2'
6
+
7
+ group :development, :test do
8
+ gem 'rake-compiler', '~> 0.9'
9
+ gem 'mocha', '~> 1.0'
10
+ gem 'minitest', '~> 5.3'
11
+ gem 'coveralls', '~> 0.7'
12
+ end
data/README.md CHANGED
@@ -51,25 +51,20 @@ doesn't need them anymore so my recommendation is not to use them.
51
51
 
52
52
  ## What's different from debugger
53
53
 
54
- * Works on Ruby 2.x and it doesn't on 1.9.x.
55
- * Has no MRI internal source code dependencies, just a clean API.
56
- * Fixes all of debugger's open bugs in its issue tracker and provides some
57
- enhancements, such as a markdown guide or the fact that `byebug` can now be
58
- placed at the end of a block or method call.
54
+ * Works on Ruby 2.x but it doesn't on 1.9.x (you should probably upgrade
55
+ anyways).
56
+ * Has no MRI internal source code dependencies, just a clean API (no more `bump
57
+ ruby_core_source dependency` entries in CHANGELOG, no more broken debugger's on
58
+ ruby's releases).
59
+ * Fixes a lot of debugger's issues, such as ruby 2.x support or post_mortem
60
+ debugging. It also provides several enhancements, such as the fact the `byebug`
61
+ can now be placed at the end of a block or method call.
59
62
  * Actively mantained.
60
63
  * Editor agnostic: no external editor built-in support.
61
64
  * Pry command is built-in. No need of external gem like debugger-pry.
62
65
 
63
66
 
64
- ## Semantic Versioning
65
-
66
- Byebug tries to follow [semantic versioning](http://semver.org). Backwards
67
- compatibility doesn't seem like a critic issue for a debugger because it's not
68
- supposed to be used permanently by any program, let alone in production
69
- environments. However, I still like the idea of giving some meaning to version
70
- changes.
71
-
72
- Byebug's public API is determined by its set of commands
67
+ ## Byebug's commands
73
68
 
74
69
  Command | Aliases | Subcommands
75
70
  ----------- |:------------ |:-----------
@@ -102,8 +97,8 @@ Byebug's public API is determined by its set of commands
102
97
  `reload` | |
103
98
  `restart` | |
104
99
  `save` | |
105
- `set` | | `args` `autoeval` `autoirb` `autolist` `autoreload` `basename` `callstyle` `callstyle` `forcestep` `fullpath` `history` `linetrace` `linetrace_plus` `listsize` `post_mortem` `stack_on_error` `testing` `verbose` `width`
106
- `show` | | `args` `autoeval` `autoirb` `autolist` `autoreload` `basename` `callstyle` `callstyle` `commands` `forcestep` `fullpath` `history` `linetrace` `linetrace_plus` `listsize` `post_mortem` `stack_on_error` `verbose` `width`
100
+ `set` | | `args` `autoeval` `autoirb` `autolist` `autoreload` `autosave` `basename` `callstyle` `callstyle` `forcestep` `fullpath` `histfile` `histsize` `linetrace` `linetrace_plus` `listsize` `post_mortem` `stack_on_error` `testing` `verbose` `width`
101
+ `show` | | `args` `autoeval` `autoirb` `autolist` `autoreload` `autosave` `basename` `callstyle` `callstyle` `commands` `forcestep` `fullpath` `histfile` `histsize` `linetrace` `linetrace_plus` `listsize` `post_mortem` `stack_on_error` `verbose` `width`
107
102
  `skip` | |
108
103
  `source` | |
109
104
  `step` | |
@@ -114,6 +109,15 @@ Byebug's public API is determined by its set of commands
114
109
  `var` | | `class` `constant` `global` `instance` `local` `ct`
115
110
 
116
111
 
112
+ ## Semantic Versioning
113
+
114
+ Byebug tries to follow [semantic versioning](http://semver.org) and tries to
115
+ bump major version only when backwards incompatible changes are released.
116
+ Backwards compatibility is targeted to
117
+ [pry-byebug](https://github.com/deivid-rodriguez/pry-byebug) and any other
118
+ plugins relying on `byebug`.
119
+
120
+
117
121
  ## Getting Started
118
122
 
119
123
  Read [byebug's markdown
@@ -124,7 +128,7 @@ started. Proper documentation will be eventually written.
124
128
  ## Related projects
125
129
 
126
130
  * [pry-byebug](https://github.com/deivid-rodriguez/pry-byebug) adds `next`,
127
- `step`, `finish`, `continue` and `break` commands to pry using byebug.
131
+ `step`, `finish`, `continue` and `break` commands to pry using byebug.
128
132
  * [ruby-debug-passenger](https://github.com/davejamesmiller/ruby-debug-passenger)
129
133
  adds a rake task that restarts Passenger with byebug connected.
130
134
  * [minitest-byebug](https://github.com/kaspth/minitest-byebug) starts a byebug
@@ -133,35 +137,34 @@ session on minitest failures.
133
137
  for ruby debugging on Sublime Text.
134
138
 
135
139
 
136
- ## Future (possible) directions
140
+ ## TODO List (by priority)
137
141
 
138
- * JRuby support.
139
- * Libify and test byebug's executable.
142
+ * Write tests for remote debugging support.
140
143
  * Add printers support.
141
-
144
+ * Libify and test byebug's executable.
145
+ * Support rubies other than MRI.
142
146
 
143
147
  ## Credits
144
148
 
145
149
  Everybody who has ever contributed to this forked and reforked piece of
146
150
  software, specially:
147
151
 
148
- * Kent Sibilev and Mark Moseley, original authors of
149
- [ruby-debug](https://github.com/mark-moseley/ruby-debug).
150
- * Gabriel Horner, [debugger](https://github.com/cldwalker/debugger)'s mantainer.
151
- * Koichi Sasada, author of the new C debugging API for Ruby.
152
- * Dennis Ushakov, author of [debase](https://github.com/denofevil/debase), the
152
+ * @ko1, author of the awesome TracePoint API for Ruby.
153
+ * @cldwalker, [debugger](https://github.com/cldwalker/debugger)'s mantainer.
154
+ * @denofevil, author of [debase](https://github.com/denofevil/debase), the
153
155
  starting point of this.
154
156
  * @kevjames3 for testing, bug reports and the interest in the project.
157
+ * @FooBarWidget for working and helping with remote debugging.
155
158
 
156
- [VersionBadge]: https://badge.fury.io/rb/byebug.png
159
+ [VersionBadge]: https://badge.fury.io/rb/byebug.svg
157
160
  [VersionURL]: http://badge.fury.io/rb/byebug
158
- [TravisBadge]: https://travis-ci.org/deivid-rodriguez/byebug.png
161
+ [TravisBadge]: https://travis-ci.org/deivid-rodriguez/byebug.svg
159
162
  [TravisURL]: http://travis-ci.org/deivid-rodriguez/byebug
160
- [CodeClimateBadge]: https://codeclimate.com/github/deivid-rodriguez/byebug.png
163
+ [CodeClimateBadge]: https://img.shields.io/codeclimate/github/deivid-rodriguez/byebug.svg
161
164
  [CodeClimateURL]: https://codeclimate.com/github/deivid-rodriguez/byebug
162
- [GemnasiumBadge]: https://gemnasium.com/deivid-rodriguez/byebug.png
165
+ [GemnasiumBadge]: https://gemnasium.com/deivid-rodriguez/byebug.svg
163
166
  [GemnasiumURL]: https://gemnasium.com/deivid-rodriguez/byebug
164
- [CoverallsBadge]: https://coveralls.io/repos/deivid-rodriguez/byebug/badge.png
167
+ [CoverallsBadge]: http://img.shields.io/coveralls/deivid-rodriguez/byebug.svg
165
168
  [CoverallsURL]: https://coveralls.io/r/deivid-rodriguez/byebug
166
- [GittipBadge]: http://img.shields.io/gittip/deivid-rodriguez.png
169
+ [GittipBadge]: http://img.shields.io/gittip/deivid-rodriguez.svg
167
170
  [GittipURL]: https://www.gittip.com/deivid-rodriguez
data/Rakefile CHANGED
@@ -22,9 +22,7 @@ task :test do
22
22
  end
23
23
  end
24
24
 
25
- base_spec = eval(File.read('byebug.gemspec'), binding, 'byebug.gemspec')
26
-
27
- task :default => :test
25
+ task default: :test
28
26
 
29
27
  desc 'Run a test in looped mode so that you can look for memory leaks'
30
28
  task 'test_loop' do
@@ -25,10 +25,4 @@ Gem::Specification.new do |s|
25
25
 
26
26
  s.add_dependency 'columnize', '~> 0.3'
27
27
  s.add_dependency 'debugger-linecache', '~> 1.2'
28
-
29
- s.add_development_dependency 'rake', '~> 10.1'
30
- s.add_development_dependency 'rake-compiler', '~> 0.9'
31
- s.add_development_dependency 'mocha', '~> 1.0'
32
- s.add_development_dependency 'minitest', '~> 5.2'
33
- s.add_development_dependency 'coveralls', '~> 0.7'
34
28
  end
@@ -10,6 +10,8 @@ static VALUE catchpoints = Qnil;
10
10
  static VALUE breakpoints = Qnil;
11
11
  static VALUE tracepoints = Qnil;
12
12
 
13
+ static VALUE raised_exception = Qnil;
14
+
13
15
  /* Implements thread syncronization, we must stop threads when debugging */
14
16
  VALUE locker = Qnil;
15
17
 
@@ -158,9 +160,8 @@ call_at_catchpoint(VALUE context_obj, debug_context_t *dc, VALUE exp)
158
160
  static VALUE
159
161
  call_at_return(VALUE context_obj, debug_context_t *dc, VALUE file, VALUE line)
160
162
  {
161
- dc->stop_reason = CTX_STOP_BREAKPOINT;
163
+ CTX_FL_UNSET(dc, CTX_FL_STOP_ON_RET);
162
164
  return call_at(context_obj, dc, rb_intern("at_return"), 2, file, line);
163
-
164
165
  }
165
166
 
166
167
  static void
@@ -240,6 +241,9 @@ call_event(VALUE trace_point, void *data)
240
241
 
241
242
  dc->calced_stack_size++;
242
243
 
244
+ if (CTX_FL_TEST(dc, CTX_FL_STOP_ON_RET))
245
+ dc->steps_out = dc->steps_out <= 0 ? -1 : dc->steps_out + 1;
246
+
243
247
  EVENT_COMMON
244
248
 
245
249
  breakpoint = Qnil;
@@ -269,7 +273,11 @@ return_event(VALUE trace_point, void *data)
269
273
 
270
274
  EVENT_COMMON
271
275
 
272
- if (dc->calced_stack_size + 1 == dc->before_frame)
276
+ if (dc->steps_out == 1)
277
+ {
278
+ dc->steps = 1;
279
+ }
280
+ else if ((dc->steps_out == 0) && (CTX_FL_TEST(dc, CTX_FL_STOP_ON_RET)))
273
281
  {
274
282
  VALUE file, line;
275
283
 
@@ -279,11 +287,7 @@ return_event(VALUE trace_point, void *data)
279
287
  call_at_return(context, dc, file, line);
280
288
  }
281
289
 
282
- if (dc->calced_stack_size + 1 == dc->after_frame)
283
- {
284
- reset_stepping_stop_points(dc);
285
- dc->steps = 1;
286
- }
290
+ dc->steps_out = dc->steps_out <= 0 ? -1 : dc->steps_out - 1;
287
291
 
288
292
  cleanup(dc);
289
293
  }
@@ -315,60 +319,55 @@ c_return_event(VALUE trace_point, void *data)
315
319
  static void
316
320
  raise_event(VALUE trace_point, void *data)
317
321
  {
318
- VALUE expn_class, aclass;
319
- VALUE err;
320
- VALUE ancestors;
322
+ VALUE expn_class, ancestors;
323
+ VALUE path, lineno, binding, post_mortem_context;
321
324
  int i;
322
325
  debug_context_t *new_dc;
323
- VALUE binding, path, lineno;
324
326
 
325
327
  EVENT_SETUP
326
328
 
327
- err = rb_errinfo();
328
-
329
329
  EVENT_COMMON
330
330
 
331
- binding = rb_tracearg_binding(trace_arg);
332
- path = rb_tracearg_path(trace_arg);
333
- lineno = rb_tracearg_lineno(trace_arg);
331
+ path = rb_tracearg_path(trace_arg);
332
+ lineno = rb_tracearg_lineno(trace_arg);
333
+ binding = rb_tracearg_binding(trace_arg);
334
+ raised_exception = rb_tracearg_raised_exception(trace_arg);
334
335
 
335
336
  if (post_mortem == Qtrue)
336
337
  {
337
- context = context_dup(dc);
338
- rb_ivar_set(err, rb_intern("@__bb_file") , path);
339
- rb_ivar_set(err, rb_intern("@__bb_line") , lineno);
340
- rb_ivar_set(err, rb_intern("@__bb_binding"), binding);
341
- rb_ivar_set(err, rb_intern("@__bb_context"), context);
338
+ post_mortem_context = context_dup(dc);
339
+ rb_ivar_set(raised_exception, rb_intern("@__bb_file") , path);
340
+ rb_ivar_set(raised_exception, rb_intern("@__bb_line") , lineno);
341
+ rb_ivar_set(raised_exception, rb_intern("@__bb_binding"), binding);
342
+ rb_ivar_set(raised_exception, rb_intern("@__bb_context"), post_mortem_context);
342
343
 
343
- Data_Get_Struct(context, debug_context_t, new_dc);
344
+ Data_Get_Struct(post_mortem_context, debug_context_t, new_dc);
344
345
  rb_debug_inspector_open(context_backtrace_set, (void *)new_dc);
345
346
  }
346
347
 
347
- expn_class = rb_obj_class(err);
348
-
349
- if (catchpoints == Qnil || dc->calced_stack_size == 0 ||
350
- CTX_FL_TEST(dc, CTX_FL_CATCHING) ||
348
+ if (catchpoints == Qnil ||
349
+ dc->calced_stack_size == 0 ||
351
350
  RHASH_TBL(catchpoints)->num_entries == 0)
352
351
  {
353
352
  cleanup(dc);
354
353
  return;
355
354
  }
356
355
 
356
+ expn_class = rb_obj_class(raised_exception);
357
357
  ancestors = rb_mod_ancestors(expn_class);
358
358
  for (i = 0; i < RARRAY_LENINT(ancestors); i++)
359
359
  {
360
- VALUE mod_name;
361
- VALUE hit_count;
360
+ VALUE ancestor_class, module_name, hit_count;
362
361
 
363
- aclass = rb_ary_entry(ancestors, i);
364
- mod_name = rb_mod_name(aclass);
365
- hit_count = rb_hash_aref(catchpoints, mod_name);
362
+ ancestor_class = rb_ary_entry(ancestors, i);
363
+ module_name = rb_mod_name(ancestor_class);
364
+ hit_count = rb_hash_aref(catchpoints, module_name);
366
365
 
367
366
  /* increment exception */
368
367
  if (hit_count != Qnil)
369
368
  {
370
- rb_hash_aset(catchpoints, mod_name, INT2FIX(FIX2INT(hit_count) + 1));
371
- call_at_catchpoint(context, dc, err);
369
+ rb_hash_aset(catchpoints, module_name, INT2FIX(FIX2INT(hit_count) + 1));
370
+ call_at_catchpoint(context, dc, raised_exception);
372
371
  call_at_line(context, dc, path, lineno);
373
372
  break;
374
373
  }
@@ -678,7 +677,7 @@ bb_set_tracing(VALUE self, VALUE value)
678
677
  * call-seq:
679
678
  * Byebug.post_mortem? -> bool
680
679
  *
681
- * Returns +true+ if post-moterm debugging is enabled.
680
+ * Returns +true+ if post-mortem debugging is enabled.
682
681
  */
683
682
  static VALUE
684
683
  bb_post_mortem(VALUE self)
@@ -739,6 +738,18 @@ bb_add_catchpoint(VALUE self, VALUE value)
739
738
  return value;
740
739
  }
741
740
 
741
+ /*
742
+ * call-seq:
743
+ * Byebug.raised_exception -> exception
744
+ *
745
+ * Returns raised exception when in post_mortem mode.
746
+ */
747
+ static VALUE
748
+ bb_raised_exception(VALUE self)
749
+ {
750
+ return raised_exception;
751
+ }
752
+
742
753
  /*
743
754
  * Document-class: Byebug
744
755
  *
@@ -752,22 +763,23 @@ Init_byebug()
752
763
  {
753
764
  mByebug = rb_define_module("Byebug");
754
765
 
755
- rb_define_module_function(mByebug, "add_catchpoint" , bb_add_catchpoint , 1);
756
- rb_define_module_function(mByebug, "breakpoints" , bb_breakpoints , 0);
757
- rb_define_module_function(mByebug, "catchpoints" , bb_catchpoints , 0);
758
- rb_define_module_function(mByebug, "contexts" , bb_contexts , 0);
759
- rb_define_module_function(mByebug, "current_context", bb_current_context, 0);
760
- rb_define_module_function(mByebug, "debug_load" , bb_load , -1);
761
- rb_define_module_function(mByebug, "post_mortem?" , bb_post_mortem , 0);
762
- rb_define_module_function(mByebug, "post_mortem=" , bb_set_post_mortem, 1);
763
- rb_define_module_function(mByebug, "_start" , bb_start , 0);
764
- rb_define_module_function(mByebug, "started?" , bb_started , 0);
765
- rb_define_module_function(mByebug, "stop" , bb_stop , 0);
766
- rb_define_module_function(mByebug, "thread_context" , bb_thread_context , 1);
767
- rb_define_module_function(mByebug, "tracing?" , bb_tracing , 0);
768
- rb_define_module_function(mByebug, "tracing=" , bb_set_tracing , 1);
769
- rb_define_module_function(mByebug, "verbose" , bb_verbose , 0);
770
- rb_define_module_function(mByebug, "verbose=" , bb_set_verbose , 1);
766
+ rb_define_module_function(mByebug, "add_catchpoint" , bb_add_catchpoint , 1);
767
+ rb_define_module_function(mByebug, "breakpoints" , bb_breakpoints , 0);
768
+ rb_define_module_function(mByebug, "catchpoints" , bb_catchpoints , 0);
769
+ rb_define_module_function(mByebug, "contexts" , bb_contexts , 0);
770
+ rb_define_module_function(mByebug, "current_context" , bb_current_context , 0);
771
+ rb_define_module_function(mByebug, "debug_load" , bb_load , -1);
772
+ rb_define_module_function(mByebug, "post_mortem?" , bb_post_mortem , 0);
773
+ rb_define_module_function(mByebug, "post_mortem=" , bb_set_post_mortem , 1);
774
+ rb_define_module_function(mByebug, "raised_exception" , bb_raised_exception, 0);
775
+ rb_define_module_function(mByebug, "_start" , bb_start , 0);
776
+ rb_define_module_function(mByebug, "started?" , bb_started , 0);
777
+ rb_define_module_function(mByebug, "stop" , bb_stop , 0);
778
+ rb_define_module_function(mByebug, "thread_context" , bb_thread_context , 1);
779
+ rb_define_module_function(mByebug, "tracing?" , bb_tracing , 0);
780
+ rb_define_module_function(mByebug, "tracing=" , bb_set_tracing , 1);
781
+ rb_define_module_function(mByebug, "verbose" , bb_verbose , 0);
782
+ rb_define_module_function(mByebug, "verbose=" , bb_set_verbose , 1);
771
783
 
772
784
  cThreadsTable = rb_define_class_under(mByebug, "ThreadsTable", rb_cObject);
773
785
 
@@ -777,5 +789,6 @@ Init_byebug()
777
789
  rb_global_variable(&breakpoints);
778
790
  rb_global_variable(&catchpoints);
779
791
  rb_global_variable(&tracepoints);
792
+ rb_global_variable(&raised_exception);
780
793
  rb_global_variable(&threads);
781
794
  }
@@ -5,14 +5,14 @@
5
5
  #include <ruby/debug.h>
6
6
 
7
7
  /* flags */
8
- #define CTX_FL_CATCHING (1<<1) /* catching of exceptions enabled */
9
- #define CTX_FL_DEAD (1<<2) /* this context belonged to a dead thread */
10
- #define CTX_FL_ENABLE_BKPT (1<<3) /* cab check for breakpoints */
11
- #define CTX_FL_FORCE_MOVE (1<<4) /* don't stop unless we've changed line */
12
- #define CTX_FL_IGNORE (1<<5) /* this context belongs to ignored thread */
13
- #define CTX_FL_SUSPEND (1<<6) /* thread currently suspended */
14
- #define CTX_FL_TRACING (1<<7) /* call at_tracing method */
15
- #define CTX_FL_WAS_RUNNING (1<<8) /* thread was previously running */
8
+ #define CTX_FL_DEAD (1<<1) /* this context belonged to a dead thread */
9
+ #define CTX_FL_ENABLE_BKPT (1<<2) /* can check for breakpoints */
10
+ #define CTX_FL_FORCE_MOVE (1<<3) /* don't stop unless we've changed line */
11
+ #define CTX_FL_IGNORE (1<<4) /* this context belongs to ignored thread */
12
+ #define CTX_FL_SUSPEND (1<<5) /* thread currently suspended */
13
+ #define CTX_FL_TRACING (1<<6) /* call at_tracing method */
14
+ #define CTX_FL_WAS_RUNNING (1<<7) /* thread was previously running */
15
+ #define CTX_FL_STOP_ON_RET (1<<8) /* can stop on method 'end' */
16
16
 
17
17
  /* macro functions */
18
18
  #define CTX_FL_TEST(c,f) ((c)->flags & (f))
@@ -35,11 +35,10 @@ typedef struct {
35
35
  VALUE thread;
36
36
  int thnum;
37
37
 
38
- int dest_frame;
39
- int lines; /* # of lines in dest_frame before stopping */
40
- int steps; /* # of steps before stopping */
41
- int after_frame; /* stop right after returning from this frame */
42
- int before_frame; /* stop right before returning from this frame */
38
+ int dest_frame; /* next stop's frame if stopped by next */
39
+ int lines; /* # of lines in dest_frame before stopping */
40
+ int steps; /* # of steps before stopping */
41
+ int steps_out; /* # of returns before stopping */
43
42
 
44
43
  VALUE last_file;
45
44
  VALUE last_line;