Skip to content

Comments

Restore frames on nested break#575

Merged
ko1 merged 2 commits intomasterfrom
restore_frames_on_nested_break
Mar 20, 2022
Merged

Restore frames on nested break#575
ko1 merged 2 commits intomasterfrom
restore_frames_on_nested_break

Conversation

@ko1
Copy link
Collaborator

@ko1 ko1 commented Mar 20, 2022

fix #563

Instead of adding `#ruby` on the right of input Ruby expressions,
this patch changes the prompt to the `ruby`.

This patch can relax issue about #538
end

def frame_eval_core src, b
saved_target_frames = @target_frames
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this mean only 1 level of nesting is allowed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please report if you have an suspicious case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I can see it works even with 3 level of nesting

Stop by #2  BP - Method  Foo.baz at test.rb:11
(rdbg) bt    # backtrace command
=>#0    Foo.baz at test.rb:12
  #1    Foo.bar at (rdbg)/test.rb:1
  #2    [C] Binding#eval at ~/projects/debug/lib/debug/thread_client.rb:369
  #3    TracePoint.allow_reentry at <internal:trace_point>:151
  #4    Foo.bar at test.rb:8
  #5    Foo.foo at (rdbg)/test.rb:1
  #6    [C] Binding#eval at ~/projects/debug/lib/debug/thread_client.rb:369
  #7    TracePoint.allow_reentry at <internal:trace_point>:151
  #8    Foo.foo at test.rb:4
  #9    <main> at (rdbg)/test.rb:1
  #10   [C] Binding#eval at ~/projects/debug/lib/debug/thread_client.rb:369
  #11   TracePoint.allow_reentry at <internal:trace_point>:151
  #12   <main> at test.rb:17
(rdbg) c    # continue command
30
(rdbg) bt    # backtrace command
=>#0    Foo.bar at test.rb:8
  #1    Foo.foo at (rdbg)/test.rb:1
  #2    [C] Binding#eval at ~/projects/debug/lib/debug/thread_client.rb:369
  #3    TracePoint.allow_reentry at <internal:trace_point>:151
  #4    Foo.foo at test.rb:4
  #5    <main> at (rdbg)/test.rb:1
  #6    [C] Binding#eval at ~/projects/debug/lib/debug/thread_client.rb:369
  #7    TracePoint.allow_reentry at <internal:trace_point>:151
  #8    <main> at test.rb:17
(rdbg) c    # continue command
20
(rdbg) bt    # backtrace command
=>#0    Foo.foo at test.rb:4
  #1    <main> at (rdbg)/test.rb:1
  #2    [C] Binding#eval at ~/projects/debug/lib/debug/thread_client.rb:369
  #3    TracePoint.allow_reentry at <internal:trace_point>:151
  #4    <main> at test.rb:17
(rdbg) c    # continue command
10
(rdbg) bt    # backtrace command
=>#0    <main> at test.rb:17
(rdbg)

one question though: should these frames be displayed?

 #2    [C] Binding#eval at ~/projects/debug/lib/debug/thread_client.rb:369
 #3    TracePoint.allow_reentry at <internal:trace_point>:151

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, it's to store the information in the current frame with local variables. I get it now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one question though: should these frames be displayed?

I don't think so. But eliminating them are not easy task and it is trivial (maybe it is rare to use nested breaks) so I left it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think it's easy to trigger nested breakpoints, but perhaps not intentionally. For example, having a catch StandardError first and make a typo in the REPL. I can even imagine people complaining about that 😂

@ko1 ko1 force-pushed the restore_frames_on_nested_break branch from 15f918e to 9f8effa Compare March 20, 2022 20:43
@ko1 ko1 merged commit b7a2cf1 into master Mar 20, 2022
@ko1 ko1 deleted the restore_frames_on_nested_break branch March 20, 2022 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Existing from nested breakpoint doesn't resume to the correct frame

2 participants