@@ -391,15 +391,19 @@ def tp_allow_reentry
391
391
end
392
392
end
393
393
394
- def frame_eval_core src , b
394
+ def frame_eval_core src , b , binding_location : false
395
395
saved_target_frames = @target_frames
396
396
saved_current_frame_index = @current_frame_index
397
397
398
398
if b
399
- f , _l = b . source_location
399
+ file , lineno = b . source_location
400
400
401
401
tp_allow_reentry do
402
- b . eval ( src , "(rdbg)/#{ f } " )
402
+ if binding_location
403
+ b . eval ( src , file , lineno )
404
+ else
405
+ b . eval ( src , "(rdbg)/#{ file } " )
406
+ end
403
407
end
404
408
else
405
409
frame_self = current_frame . self
@@ -418,7 +422,7 @@ def frame_eval_core src, b
418
422
[ :return_value , "_return" ] ,
419
423
]
420
424
421
- def frame_eval src , re_raise : false
425
+ def frame_eval src , re_raise : false , binding_location : false
422
426
@success_last_eval = false
423
427
424
428
b = current_frame . eval_binding
@@ -427,7 +431,7 @@ def frame_eval src, re_raise: false
427
431
b . local_variable_set ( name , var ) if /\% / !~ name
428
432
end
429
433
430
- result = frame_eval_core ( src , b )
434
+ result = frame_eval_core ( src , b , binding_location : binding_location )
431
435
432
436
@success_last_eval = true
433
437
result
@@ -949,7 +953,7 @@ def wait_next_action_
949
953
result = frame_eval ( eval_src )
950
954
when :irb
951
955
begin
952
- result = frame_eval ( 'binding.irb' )
956
+ result = frame_eval ( 'binding.irb' , binding_location : true )
953
957
ensure
954
958
# workaround: https://github.com/ruby/debug/issues/308
955
959
Reline . prompt_proc = nil if defined? Reline
0 commit comments