Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add notes on how to exit the debugger [ci-skip] #45329

Merged
merged 1 commit into from Jun 14, 2022
Merged

Add notes on how to exit the debugger [ci-skip] #45329

merged 1 commit into from Jun 14, 2022

Conversation

siaw23
Copy link
Member

@siaw23 siaw23 commented Jun 11, 2022

Summary

A short note on how to quit the debugger. Fumbled a bit trying to leave the debugger.

Other Information

@rails-bot rails-bot bot added the docs label Jun 11, 2022
@siaw23 siaw23 changed the title Add notes on exit the debugger Add notes on how to exit the debugger Jun 11, 2022
Copy link
Member

@jonathanhefner jonathanhefner left a comment

Choose a reason for hiding this comment

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

I think mentioning these commands is a good addition! 👍

@@ -344,6 +344,8 @@ Processing by PostsController#index as HTML
(rdbg)
```

You can leave a debugging session with `quit` or `q` and confirm your action at the prompt or with `quit!` and its alias `q!` to bypass the prompt. In most cases though, you'd want to continue program execution with `continue` or `c`.
Copy link
Member

Choose a reason for hiding this comment

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

I agree that in most cases the user will want to continue, so let's mention that first:

Suggested change
You can leave a debugging session with `quit` or `q` and confirm your action at the prompt or with `quit!` and its alias `q!` to bypass the prompt. In most cases though, you'd want to continue program execution with `continue` or `c`.
You can exit the debugging session at any time and continue your application execution with the `continue` (or `c`) command. Or, to exit both the debugging session and your application, use the `quit` (or `q`) command.

I added "at any time" because we've just introduced the debugging session, and we don't want to exit it just yet, based on the next section of the guide. (I also left out the quit! / q! command for brevity.)

Copy link
Member Author

Choose a reason for hiding this comment

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

This definitely better. Thanks ;)

@jonathanhefner jonathanhefner changed the title Add notes on how to exit the debugger Add notes on how to exit the debugger [ci-skip] Jun 13, 2022
@simi
Copy link
Contributor

simi commented Jun 13, 2022

🤔 Wouldn't be better to just replace this complex debugging section with simple example of just using binding.irb? That way you get the same console you know from irb or bin/rails c and that one should be familiar. For more advanced debugging we can just link to https://github.com/ruby/debug (latest ruby debugger).

@siaw23
Copy link
Member Author

siaw23 commented Jun 13, 2022

🤔 Wouldn't be better to just replace this complex debugging section with simple example of just using binding.irb? That way you get the same console you know from irb or bin/rails c and that one should be familiar. For more advanced debugging we can just link to https://github.com/ruby/debug (latest ruby debugger).

There's a whole section on debugging with the debug gem in the docs. Personally I feel properly documenting its usage is necessary, Rails adds the debug gem by default to the Gemfile.

@jonathanhefner jonathanhefner merged commit 4a55631 into rails:main Jun 14, 2022
@jonathanhefner
Copy link
Member

jonathanhefner commented Jun 14, 2022

@simi This section of the guide was recently added in #43621, with popular support. Speaking personally, I like the idea of leaning more on external documentation (== less maintenance burden for us), but such a change would need to be a clear improvement over what we have now, particularly in the context of debugging a Rails application. If you have clear improvements in mind, please submit a PR! 🙏

In the mean time, I think this is a helpful addition. Thank you, @siaw23! 👋

(Backported to 7-0-stable.)

@simi
Copy link
Contributor

simi commented Jun 14, 2022

@jonathanhefner In the end this rails guide seems like a good candidate to be ported to debug gem docs actually. Maybe one small section how to use simple binding.irb could be handy in here as well. I'll open PR once I'll get it together.

jonathanhefner added a commit to jonathanhefner/rails that referenced this pull request Jun 25, 2022
Add notes on how to exit the debugger [ci-skip]

(cherry picked from commit 4a55631)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants