You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/source/debugging_rails_applications.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -333,7 +333,7 @@ Please check its [documentation](https://github.com/ruby/debug) for usage.
333
333
334
334
### Entering a Debugging Session
335
335
336
-
By default, a debugging session will start after the `debug` library is required, which happens when your app boots. But don't worry, the session won't interfere your program.
336
+
By default, a debugging session will start after the `debug` library is required, which happens when your app boots. But don't worry, the session won't interfere with your application.
337
337
338
338
To enter the debugging session, you can use `binding.break` and its aliases: `binding.b`and `debugger`. The following examples will use `debugger`:
339
339
@@ -371,11 +371,11 @@ Processing by PostsController#index as HTML
371
371
(rdbg)
372
372
```
373
373
374
-
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.
374
+
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.
375
375
376
376
### The Context
377
377
378
-
After entering the debugging session, you can type in Ruby code as you're in a Rails console or IRB.
378
+
After entering the debugging session, you can type in Ruby code as if you are in a Rails console or IRB.
379
379
380
380
```rb
381
381
(rdbg) @posts# ruby
@@ -385,7 +385,7 @@ After entering the debugging session, you can type in Ruby code as you're in a R
385
385
(rdbg)
386
386
```
387
387
388
-
You can also use `p` or `pp` command to evaluate Ruby expressions (e.g. when a variable name conflicts with a debugger command).
388
+
You can also use the `p` or `pp` command to evaluate Ruby expressions, which is useful when a variable name conflicts with a debugger command.
389
389
390
390
```rb
391
391
(rdbg) p headers # command
@@ -400,15 +400,15 @@ You can also use `p` or `pp` command to evaluate Ruby expressions (e.g. when a v
400
400
(rdbg)
401
401
```
402
402
403
-
Besides direct evaluation, debugger also helps you collect rich amount of information through different commands. Just to name a few here:
403
+
Besides direct evaluation, the debugger also helps you collect a rich amount of information through different commands, such as:
404
404
405
405
-`info` (or `i`) - Information about current frame.
@@ -689,7 +689,7 @@ Stop by #0 BP - Watch #<PostsController:0x00007fce69ca5320> @_response_body =
689
689
690
690
#### Breakpoint Options
691
691
692
-
In addition to different types of breakpoints, you can also specify options to achieve more advanced debugging workflow. Currently, the debugger supports 4 options:
692
+
In addition to different types of breakpoints, you can also specify options to achieve more advanced debugging workflows. Currently, the debugger supports 4 options:
693
693
694
694
-`do: <cmd or expr>` - when the breakpoint is triggered, execute the given command/expression and continue the program:
695
695
-`break Foo#bar do: bt` - when `Foo#bar` is called, print the stack frames
0 commit comments