ext/byebug/byebug.c in byebug-11.0.1 vs ext/byebug/byebug.c in byebug-11.1.0
- old
+ new
@@ -303,18 +303,11 @@
if (dc->calced_stack_size <= dc->dest_frame)
CTX_FL_UNSET(dc, CTX_FL_IGNORE_STEPS);
CALL_EVENT_SETUP;
- /* nil method_id means we are at top level so there can't be a method
- * breakpoint here. Just leave then. */
msym = rb_tracearg_method_id(trace_arg);
- if (NIL_P(msym))
- {
- EVENT_TEARDOWN;
- return;
- }
mid = SYM2ID(msym);
klass = rb_tracearg_defined_class(trace_arg);
binding = rb_tracearg_binding(trace_arg);
self = rb_tracearg_self(trace_arg);
@@ -365,11 +358,13 @@
* [#7] c_call@.../core_ext/numeric/conversions.rb:131 Fixnum#to_default_s
* [#7] c_return@.../core_ext/numeric/conversions.rb:131 Fixnum#to_default_s
* [#7] b_return@/hort/core_ext/numeric/conversions.rb:133 BigDecimal#to_s
* [#7] return@:0 Fixnum#to_s # => This guy...
*/
- if (!NIL_P(file))
+ if (NIL_P(file))
+ rb_warn("The TracePoint API emitted a return event without file information. It might be a bug, please report this.");
+ else
{
line = rb_tracearg_lineno(trace_arg);
binding = rb_tracearg_binding(trace_arg);
brkpnt = find_breakpoint_by_pos(breakpoints, file, line, binding);
@@ -434,10 +429,10 @@
EVENT_SETUP;
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);
Data_Get_Struct(pm_context, debug_context_t, new_dc);