Skip to content

Commit

Permalink
Fix post mortem location after exception inside load (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez authored May 30, 2019
1 parent c54c665 commit 4a29481
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

### Fixed

* [#562](https://github.com/deivid-rodriguez/byebug/pull/562): post mortem mode landing in the wrong line when coming from an exception inside a `Kernel.load` call.

### Removed

* Support for MRI 2.3. Byebug no longer installs on this platform.
Expand Down
2 changes: 1 addition & 1 deletion ext/byebug/byebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ raise_event(VALUE trace_point, void *data)

raised_exception = rb_tracearg_raised_exception(trace_arg);

if (post_mortem == Qtrue)
if (post_mortem == Qtrue && !rb_ivar_defined(raised_exception, rb_intern("@__bb_context")))
{
pm_context = context_dup(dc);
rb_ivar_set(raised_exception, rb_intern("@__bb_context"), pm_context);
Expand Down
1 change: 0 additions & 1 deletion test/post_mortem_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def test_post_mortem_mode_sets_post_mortem_flag_to_true
end

def test_execution_is_stopped_at_the_correct_line_after_exception
skip("See issue #165")
with_setting :post_mortem, true do
enter "cont"

Expand Down

0 comments on commit 4a29481

Please sign in to comment.