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: activesupport/lib/active_support/core_ext/kernel/debugger.rb
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
moduleKernel
2
2
unlessrespond_to?(:debugger)
3
-
# Starts a debugging session if +debugger+ gem has been loaded (call rails server --debugger to do load it).
3
+
# Starts a debugging session if a debugger has been loaded (call rails server --debugger to do load it).
4
4
defdebugger
5
5
message="\n***** Debugger requested, but was not available (ensure debugger is listed in Gemfile/installed as gem): Start server with --debugger to enable *****\n"
Copy file name to clipboardExpand all lines: guides/source/debugging_rails_applications.textile
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -191,7 +191,7 @@ Completed in 0.01224 (81 reqs/sec) | DB: 0.00044 (3%) | 302 Found [http://localh
191
191
192
192
Adding extra logging like this makes it easy to search for unexpected or unusual behavior in your logs. If you add extra logging, be sure to make sensible use of log levels, to avoid filling your production logs with useless trivia.
193
193
194
-
h3. Debugging with +debugger+
194
+
h3. Debugging with +debugger+ gem
195
195
196
196
When your code is behaving in unexpected ways, you can try printing to logs or the console to diagnose the problem. Unfortunately, there are times when this sort of error tracking is not effective in finding the root cause of a problem. When you actually need to journey into your running source code, the debugger is your best companion.
197
197
@@ -244,7 +244,7 @@ TIP: In development mode, you can dynamically +require \'debugger\'+ instead of
244
244
245
245
h4. The Shell
246
246
247
-
As soon as your application calls the +debugger+ method, the debugger will be started in a debugger shell inside the terminal window where you launched your application server, and you will be placed at debugger's prompt +(rdb:n)+. The _n_ is the thread number. The prompt will also show you the next line of code that is waiting to run.
247
+
As soon as your application calls the +debugger+ method, the debugger will be started in a debugger shell inside the terminal window where you launched your application server, and you will be placed at the debugger's prompt +(rdb:n)+. The _n_ is the thread number. The prompt will also show you the next line of code that is waiting to run.
248
248
249
249
If you got there by a browser request, the browser tab containing the request will be hung until the debugger has finished and the trace has finished processing the entire request.
250
250
@@ -272,7 +272,7 @@ continue edit frame method putl set tmate where
272
272
273
273
TIP: To view the help menu for any command use +help <command-name>+ in active debug mode. For example: _+help var+_
274
274
275
-
The next command to learn is one of the most useful: +list+. You can also abbreviate debugger commands by supplying just enough letters to distinguish them from other commands, so you can also use +l+ for the +list+ command.
275
+
The next command to learn is one of the most useful: +list+. You can also abbreviate the debugging commands by supplying just enough letters to distinguish them from other commands, so you can also use +l+ for the +list+ command.
276
276
277
277
This command shows you where you are in the code by printing 10 lines centered around the current line; the current line in this particular case is line 6 and is marked by +=>+.
278
278
@@ -349,7 +349,7 @@ h4. The Context
349
349
350
350
When you start debugging your application, you will be placed in different contexts as you go through the different parts of the stack.
351
351
352
-
debugger creates a context when a stopping point or an event is reached. The context has information about the suspended program which enables a debugger to inspect the frame stack, evaluate variables from the perspective of the debugged program, and contains information about the place where the debugged program is stopped.
352
+
The debugger creates a context when a stopping point or an event is reached. The context has information about the suspended program which enables a debugger to inspect the frame stack, evaluate variables from the perspective of the debugged program, and contains information about the place where the debugged program is stopped.
353
353
354
354
At any time you can call the +backtrace+ command (or its alias +where+) to print the backtrace of the application. This can be very helpful to know how you got where you are. If you ever wondered about how you got somewhere in your code, then +backtrace+ will supply the answer.
355
355
@@ -465,7 +465,7 @@ h4. Step by Step
465
465
466
466
Now you should know where you are in the running trace and be able to print the available variables. But lets continue and move on with the application execution.
467
467
468
-
Use +step+ (abbreviated +s+) to continue running your program until the next logical stopping point and return control to debugger.
468
+
Use +step+ (abbreviated +s+) to continue running your program until the next logical stopping point and return control to the debugger.
469
469
470
470
TIP: You can also use <tt>step<plus> n</tt> and <tt>step- n</tt> to move forward or backward +n+ steps respectively.
471
471
@@ -487,7 +487,7 @@ class Author < ActiveRecord::Base
487
487
end
488
488
</ruby>
489
489
490
-
TIP: You can use debugger while using +rails console+. Just remember to +require "debugger"+ before calling the +debugger+ method.
490
+
TIP: You can use a debugger while using +rails console+. Just remember to +require "debugger"+ before calling the +debugger+ method.
491
491
492
492
<shell>
493
493
$ rails console
@@ -605,7 +605,7 @@ A simple quit tries to terminate all threads in effect. Therefore your server wi
605
605
606
606
h4. Settings
607
607
608
-
There are some settings that can be configured in debugger to make it easier to debug your code. Here are a few of the available options:
608
+
There are some settings that can be configured in the +debugger+ gem to make it easier to debug your code. Here are a few of the available options:
609
609
610
610
* +set reload+: Reload source code when changed.
611
611
* +set autolist+: Execute +list+ command on every breakpoint.
@@ -614,7 +614,7 @@ There are some settings that can be configured in debugger to make it easier to
614
614
615
615
You can see the full list by using +help set+. Use +help set _subcommand_+ to learn about a particular +set+ command.
616
616
617
-
TIP: You can include any number of these configuration lines inside a +.rdebugrc+ file in your HOME directory. debugger will read this file every time it is loaded and configure itself accordingly.
617
+
TIP: You can include any number of these configuration lines inside a +.rdebugrc+ file in your HOME directory. +debugger+ gem will read this file every time it is loaded and configure itself accordingly.
0 commit comments