byebug 8.2.1 → 8.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +261 -94
- data/CONTRIBUTING.md +28 -39
- data/GUIDE.md +55 -65
- data/README.md +14 -24
- data/ext/byebug/context.c +1 -1
- data/ext/byebug/extconf.rb +1 -0
- data/lib/byebug/attacher.rb +1 -1
- data/lib/byebug/commands/catch.rb +1 -1
- data/lib/byebug/commands/display.rb +1 -1
- data/lib/byebug/commands/list.rb +2 -4
- data/lib/byebug/context.rb +2 -2
- data/lib/byebug/core.rb +9 -7
- data/lib/byebug/helpers/frame.rb +1 -1
- data/lib/byebug/interfaces/local_interface.rb +2 -1
- data/lib/byebug/interfaces/test_interface.rb +2 -3
- data/lib/byebug/printers/base.rb +4 -3
- data/lib/byebug/processors/command_processor.rb +1 -1
- data/lib/byebug/processors/script_processor.rb +1 -1
- data/lib/byebug/setting.rb +1 -1
- data/lib/byebug/settings/callstyle.rb +2 -1
- data/lib/byebug/version.rb +2 -1
- metadata +3 -3
data/CONTRIBUTING.md
CHANGED
@@ -1,66 +1,55 @@
|
|
1
1
|
## Contributing to Byebug
|
2
2
|
|
3
|
+
Please note that this project is released with a [Contributor Code of
|
4
|
+
Conduct](code_of_conduct.md). By participating in this project you agree to
|
5
|
+
abide by its terms.
|
6
|
+
|
3
7
|
### Bug Reports
|
4
8
|
|
5
9
|
* Try to reproduce the issue against the latest revision. There might be
|
6
|
-
unrealeased work that fixes your problem!
|
7
|
-
|
10
|
+
unrealeased work that fixes your problem!
|
8
11
|
* Ensure that your issue has not already been reported.
|
9
|
-
|
10
12
|
* Include the steps you carried out to produce the problem. If we can't
|
11
|
-
reproduce it, we can't fix it.
|
12
|
-
|
13
|
+
reproduce it, we can't fix it.
|
13
14
|
* Include the behavior you observed along with the behavior you expected,
|
14
|
-
and why you expected it.
|
15
|
-
|
15
|
+
and why you expected it.
|
16
16
|
|
17
17
|
### Development dependencies
|
18
18
|
|
19
19
|
* `Byebug` depends on Ruby's TracePoint API provided by `ruby-core`. This is a
|
20
|
-
young API and a lot of bugs have been recently corrected, so make sure you
|
21
|
-
always have the lastest patch level release installed.
|
22
|
-
|
20
|
+
young API and a lot of bugs have been recently corrected, so make sure you
|
21
|
+
always have the lastest patch level release installed.
|
23
22
|
* The recommended tool to manage development dependencies is `bundler`. Run
|
24
|
-
`gem install bundler` to install it.
|
25
|
-
|
23
|
+
`gem install bundler` to install it.
|
26
24
|
* Running `bundle install` inside a local clone of `byebug` will get development
|
27
|
-
dependencies installed.
|
28
|
-
|
25
|
+
dependencies installed.
|
29
26
|
|
30
27
|
### Running the test suite
|
31
28
|
|
32
29
|
* Make sure you compile the C-extension using `bundle exec rake compile`.
|
33
|
-
Otherwise you won't be able to use `byebug`.
|
34
|
-
|
30
|
+
Otherwise you won't be able to use `byebug`.
|
35
31
|
* Run the test suite using the default rake task (`bundle exec rake`). This
|
36
|
-
task is composed of 2 subtasks: `bundle exec rake compile` &&
|
37
|
-
test`.
|
38
|
-
|
32
|
+
task is composed of 2 subtasks: `bundle exec rake compile` &&
|
33
|
+
`bundle exec rake test`.
|
39
34
|
* If you want to run specific tests, use the provided test runner, like so:
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
`script/minitest_runner.rb
|
46
|
-
|
47
|
-
|
48
|
-
`
|
49
|
-
|
50
|
-
|
51
|
-
`
|
52
|
-
BreakAtLinesTest#test_setting_breakpoint_sets_correct_fields`
|
53
|
-
|
54
|
-
- You can combine any of them and you will get the union of all filters. For
|
55
|
-
example: `script/minitest_runner.rb Byebug::BreakAtLinesTestCase
|
56
|
-
test_catch_removes_specific_catchpoint`
|
57
|
-
|
35
|
+
* Specific test files. For example,
|
36
|
+
`script/minitest_runner.rb test/commands/break_test.rb`
|
37
|
+
* Specific test classes. For example,
|
38
|
+
`script/minitest_runner.rb Byebug::BreakAtLinesTestCase`
|
39
|
+
* Specific tests. For example,
|
40
|
+
`script/minitest_runner.rb test_catch_removes_specific_catchpoint`
|
41
|
+
* Specific fully qualified tests. For example,
|
42
|
+
`script/minitest_runner.rb
|
43
|
+
BreakAtLinesTest#test_setting_breakpoint_sets_correct_fields`
|
44
|
+
* You can combine any of them and you will get the union of all filters. For
|
45
|
+
example: `script/minitest_runner.rb Byebug::BreakAtLinesTestCase
|
46
|
+
test_catch_removes_specific_catchpoint`
|
58
47
|
|
59
48
|
### Code style
|
60
49
|
|
61
50
|
* Byebug uses [overcommit][] to enforce code style. Install the git hooks using
|
62
|
-
`bundle exec overcommit --install`. They will review your changes before they
|
63
|
-
are committed, checking they are consistent with the project's code style.
|
51
|
+
`bundle exec overcommit --install`. They will review your changes before they
|
52
|
+
are committed, checking they are consistent with the project's code style.
|
64
53
|
|
65
54
|
[overcommit]: https://github.com/brigade/overcommit/
|
66
55
|
|
data/GUIDE.md
CHANGED
@@ -161,7 +161,6 @@ So far, so good. As you can see from the above, to get out of `byebug`, one
|
|
161
161
|
can issue a `quit` command (or the abbreviation `q`). If you want to quit
|
162
162
|
without being prompted, suffix the command with an exclamation mark, e.g., `q!`.
|
163
163
|
|
164
|
-
|
165
164
|
### Second Sample Session: Delving Deeper
|
166
165
|
|
167
166
|
In this section we'll introduce breakpoints, the call stack and restarting.
|
@@ -186,10 +185,9 @@ n_args = $ARGV.length
|
|
186
185
|
fail('*** Need number of disks or no parameter') if n_args > 1
|
187
186
|
```
|
188
187
|
|
189
|
-
Recall in the first section it was stated that before the `def` is run, the
|
190
|
-
names is undefined. Let's check that out. First let's see what
|
191
|
-
we can call before running `def hanoi`.
|
192
|
-
|
188
|
+
Recall in the first section it was stated that before the `def` is run, the
|
189
|
+
method it names is undefined. Let's check that out. First let's see what
|
190
|
+
private methods we can call before running `def hanoi`.
|
193
191
|
|
194
192
|
```bash
|
195
193
|
$ byebug path/to/hanoi.rb
|
@@ -475,7 +473,6 @@ I can change to the top-most frame by using the `frame 2` command. Notice that
|
|
475
473
|
inside frame #2, the value of `n_args` can be shown. Also note that the value of
|
476
474
|
variable `n` is different.
|
477
475
|
|
478
|
-
|
479
476
|
### Attaching to a running program with `byebug`
|
480
477
|
|
481
478
|
In the previous sessions we've been calling byebug right at the outset, but
|
@@ -545,7 +542,6 @@ Run options: --seed 31679
|
|
545
542
|
|
546
543
|
# Running:
|
547
544
|
|
548
|
-
|
549
545
|
[2, 11] in test_triangle.rb
|
550
546
|
2: require_relative 'triangle.rb'
|
551
547
|
3:
|
@@ -596,7 +592,6 @@ Displaying frame's full file names is off.
|
|
596
592
|
|
597
593
|
We get the same result as if we had run byebug from the outset.
|
598
594
|
|
599
|
-
|
600
595
|
### Debugging Oddities: How debugging Ruby may be different from other languages
|
601
596
|
|
602
597
|
If you are used to debugging in other languages like C, C++, Perl, Java or even
|
@@ -709,7 +704,6 @@ Tracing: primes.rb:12 not_prime = false
|
|
709
704
|
The loop between lines 31-34 gets interleaved between those of
|
710
705
|
`SievePrime#next_prime`, lines 9-28 above.
|
711
706
|
|
712
|
-
|
713
707
|
#### No Parameter Values in a Call Stack
|
714
708
|
|
715
709
|
In traditional debuggers, in a call stack you can generally see the names of the
|
@@ -727,7 +721,6 @@ So at present, the name of the parameter is shown. The call-style setting
|
|
727
721
|
([callstyle]()) can be used to set whether the name is shown or the name and the
|
728
722
|
_current_ class of the object.
|
729
723
|
|
730
|
-
|
731
724
|
#### Lines You Can Stop At
|
732
725
|
|
733
726
|
Consider the following little Ruby program.
|
@@ -746,7 +739,6 @@ The stopping points that Ruby records are the last two lines, lines 5 and 6.
|
|
746
739
|
Inside `byebug` you can get a list of stoppable lines for a file using the `info
|
747
740
|
file` command.
|
748
741
|
|
749
|
-
|
750
742
|
### Threading support
|
751
743
|
|
752
744
|
Byebug supports debugging Ruby programs making use of multiple threads.
|
@@ -824,7 +816,7 @@ employee represented by 2 threads: they work concurrently to achieve the
|
|
824
816
|
company's targets.
|
825
817
|
|
826
818
|
* The employee looks for tasks to complete. If there are tasks, it works hard to
|
827
|
-
complete them. Otherwise he has a quick break.
|
819
|
+
complete them. Otherwise he has a quick break.
|
828
820
|
|
829
821
|
```ruby
|
830
822
|
#
|
@@ -842,7 +834,7 @@ end
|
|
842
834
|
```
|
843
835
|
|
844
836
|
* The manager, on the other hand, sits there all day and sporadically checks
|
845
|
-
whether there are any results to show off.
|
837
|
+
whether there are any results to show off.
|
846
838
|
|
847
839
|
```ruby
|
848
840
|
#
|
@@ -1153,11 +1145,11 @@ in the `employee_routine` method with the line
|
|
1153
1145
|
```
|
1154
1146
|
|
1155
1147
|
To be continued...
|
1148
|
+
|
1156
1149
|
* More complex examples with objects, pretty printing and irb.
|
1157
1150
|
* Line tracing and non-interactive tracing.
|
1158
1151
|
* Post-mortem debugging.
|
1159
1152
|
|
1160
|
-
|
1161
1153
|
## Getting in & out
|
1162
1154
|
|
1163
1155
|
### Starting byebug
|
@@ -1196,17 +1188,15 @@ letter option name, such as `-h`. The list of options is detailed below:
|
|
1196
1188
|
|
1197
1189
|
It causes `byebug` to print some basic help and exit.
|
1198
1190
|
|
1199
|
-
|
1200
1191
|
#### -v | --version
|
1201
1192
|
|
1202
1193
|
It causes `byebug` to print its version number and exit.
|
1203
1194
|
|
1204
|
-
|
1205
1195
|
#### -d | --debug
|
1206
1196
|
|
1207
1197
|
Sets `$DEBUG` to `true`. Compatible with Ruby's flag.
|
1208
1198
|
|
1209
|
-
#### -I | --include
|
1199
|
+
#### -I | --include path
|
1210
1200
|
|
1211
1201
|
Adds `path` to load path. `path` can be a single path or a colon separated path
|
1212
1202
|
list.
|
@@ -1227,7 +1217,7 @@ Normally `byebug` stops before executing the first statement. If instead you
|
|
1227
1217
|
want it to start running initially and perhaps break it later in the execution,
|
1228
1218
|
use this option.
|
1229
1219
|
|
1230
|
-
#### -r | --require
|
1220
|
+
#### -r | --require lib
|
1231
1221
|
|
1232
1222
|
Requires the library before executing the script. This option is compatible
|
1233
1223
|
with Ruby's.
|
@@ -1269,16 +1259,15 @@ When you start `byebug`, it automatically executes commands from its
|
|
1269
1259
|
_init file_, called `.byebugrc`. During startup, `byebug` does the following:
|
1270
1260
|
|
1271
1261
|
* __Processes command line options and operands.__ Reads the init file in your
|
1272
|
-
current directory, if any, and then checks your home directory. The home
|
1273
|
-
directory is the directory named in the `$HOME` or `$HOMEPATH` environment
|
1274
|
-
variable. Thus, you can have more than one init file, one generic in your home
|
1275
|
-
directory, and another, specific to the program you are debugging, in the
|
1276
|
-
directory where you invoke `byebug`.
|
1262
|
+
current directory, if any, and then checks your home directory. The home
|
1263
|
+
directory is the directory named in the `$HOME` or `$HOMEPATH` environment
|
1264
|
+
variable. Thus, you can have more than one init file, one generic in your home
|
1265
|
+
directory, and another, specific to the program you are debugging, in the
|
1266
|
+
directory where you invoke `byebug`.
|
1277
1267
|
|
1278
1268
|
You can also request the execution of a command file with the `source` command
|
1279
1269
|
(see [Source]()).
|
1280
1270
|
|
1281
|
-
|
1282
1271
|
### Quitting byebug
|
1283
1272
|
|
1284
1273
|
To exit `byebug`, use the `quit` command (abbreviated to `q`). Normally, if you
|
@@ -1290,7 +1279,6 @@ Another way to terminate byebug is to use the `kill` command. This does the
|
|
1290
1279
|
more forceful `kill -9`. It can be used in cases where `quit` doesn't work (I
|
1291
1280
|
haven't seen those yet).
|
1292
1281
|
|
1293
|
-
|
1294
1282
|
### Calling byebug from inside your program
|
1295
1283
|
|
1296
1284
|
Running a program from byebug adds a bit of overhead and slows it down a little.
|
@@ -1342,7 +1330,6 @@ inside your program or invoked as a result of post-mortem handling.
|
|
1342
1330
|
Also, since this relies on the OS `exec` call, this command is available only if
|
1343
1331
|
your OS supports `exec`.
|
1344
1332
|
|
1345
|
-
|
1346
1333
|
## Debugging remote programs
|
1347
1334
|
|
1348
1335
|
It is possible to set up debugging so that you can issue byebug commands from
|
@@ -1354,7 +1341,7 @@ program that you want to debug (In Rails, the
|
|
1354
1341
|
`config/environments/development.rb` could be a good candidate).
|
1355
1342
|
|
1356
1343
|
```ruby
|
1357
|
-
require 'byebug'
|
1344
|
+
require 'byebug/core'
|
1358
1345
|
Byebug.wait_connection = true
|
1359
1346
|
Byebug.start_server('localhost', <port>)
|
1360
1347
|
```
|
@@ -1371,10 +1358,10 @@ want to debug, add a call to `byebug` as was done without remote execution:
|
|
1371
1358
|
some ruby code # byebug will stop before this line is run
|
1372
1359
|
```
|
1373
1360
|
|
1374
|
-
|
1375
1361
|
## Byebug Command Reference
|
1376
1362
|
|
1377
1363
|
### Command Syntax
|
1364
|
+
|
1378
1365
|
Usually a command is put on a single line. There is no limit on how long it can
|
1379
1366
|
be. It starts with a command name, which is followed by arguments whose meaning
|
1380
1367
|
depends on the command name. For example, the command `step` accepts an
|
@@ -1415,27 +1402,28 @@ won't have to escape semicolons.
|
|
1415
1402
|
A blank line as input (typing just `<RET>`) means to repeat the previous
|
1416
1403
|
command.
|
1417
1404
|
|
1418
|
-
Byebug uses readline, which handles line editing and retrieval of previous
|
1419
|
-
Up arrow, for example, moves to the previous byebug command; down
|
1420
|
-
next more recent command (provided you are not already at
|
1421
|
-
history is saved in file `.byebug_history`. A limit
|
1422
|
-
can see this with the `show history size`
|
1423
|
-
parameters.
|
1405
|
+
Byebug uses readline, which handles line editing and retrieval of previous
|
1406
|
+
commands. Up arrow, for example, moves to the previous byebug command; down
|
1407
|
+
arrow moves to the next more recent command (provided you are not already at
|
1408
|
+
the last command). Command history is saved in file `.byebug_history`. A limit
|
1409
|
+
is put on the history size. You can see this with the `show history size`
|
1410
|
+
command. See [history]() for history parameters.
|
1424
1411
|
|
1425
1412
|
### Command Output
|
1413
|
+
|
1426
1414
|
In the command-line interface, when `byebug` is waiting for input it presents a
|
1427
|
-
prompt of the form `(byebug)`. If the program has terminated normally the prompt
|
1428
|
-
be `(byebug:ctrl)` and in post-mortem debugging it will be
|
1415
|
+
prompt of the form `(byebug)`. If the program has terminated normally the prompt
|
1416
|
+
will be `(byebug:ctrl)` and in post-mortem debugging it will be
|
1429
1417
|
`(byebug:post-mortem)`.
|
1430
1418
|
|
1431
|
-
Whenever `byebug` gives an error message such as for an invalid command or an
|
1432
|
-
location position, it will generally preface the message with `***`.
|
1419
|
+
Whenever `byebug` gives an error message such as for an invalid command or an
|
1420
|
+
invalid location position, it will generally preface the message with `***`.
|
1433
1421
|
|
1434
1422
|
### Command Help
|
1435
1423
|
|
1436
|
-
Once inside `byebug` you can always ask it for information on its commands using
|
1437
|
-
`help` command. You can use `help` (abbreviated `h`) with no arguments to
|
1438
|
-
short list of named classes of commands
|
1424
|
+
Once inside `byebug` you can always ask it for information on its commands using
|
1425
|
+
the `help` command. You can use `help` (abbreviated `h`) with no arguments to
|
1426
|
+
display a short list of named classes of commands
|
1439
1427
|
|
1440
1428
|
```bash
|
1441
1429
|
(byebug) help
|
@@ -1496,15 +1484,16 @@ With a command name, `help` displays information on how to use the command.
|
|
1496
1484
|
(byebug)
|
1497
1485
|
```
|
1498
1486
|
|
1499
|
-
A number of commands, namely `info`, `set`, `show`, `enable` and `disable`, have
|
1500
|
-
sub-parameters or _subcommands_. When you ask for help for one of these
|
1501
|
-
will get help for all of the subcommands that command offers.
|
1502
|
-
help only on a subcommand and to do this just follow the
|
1503
|
-
name. For example, `help info breakpoints`will just
|
1504
|
-
breakpoints` command. Furthermore it will give longer
|
1505
|
-
information that appears when you ask for help. You don't
|
1506
|
-
subcommand name, just enough of the letters to make that
|
1507
|
-
others will do. For example, `help info b` is the same
|
1487
|
+
A number of commands, namely `info`, `set`, `show`, `enable` and `disable`, have
|
1488
|
+
many sub-parameters or _subcommands_. When you ask for help for one of these
|
1489
|
+
commands, you will get help for all of the subcommands that command offers.
|
1490
|
+
Sometimes you may want help only on a subcommand and to do this just follow the
|
1491
|
+
command with its subcommand name. For example, `help info breakpoints`will just
|
1492
|
+
give help about the `info breakpoints` command. Furthermore it will give longer
|
1493
|
+
help than the summary information that appears when you ask for help. You don't
|
1494
|
+
need to list the full subcommand name, just enough of the letters to make that
|
1495
|
+
subcommand distinct from others will do. For example, `help info b` is the same
|
1496
|
+
as `help info breakpoints`.
|
1508
1497
|
|
1509
1498
|
Some examples follow.
|
1510
1499
|
|
@@ -1568,7 +1557,6 @@ they are executed. If there is an error, execution proceeds to the next command
|
|
1568
1557
|
in the file. For information about command files that get run automatically on
|
1569
1558
|
startup see [Command Files]().
|
1570
1559
|
|
1571
|
-
|
1572
1560
|
### Display Commands: display, undisplay
|
1573
1561
|
|
1574
1562
|
#### Display
|
@@ -1612,14 +1600,13 @@ not be printed but they won't be forgotten either, so you can toggle them again
|
|
1612
1600
|
later. To do that, use `disable display` or `enable display` followed by the
|
1613
1601
|
expression number.
|
1614
1602
|
|
1615
|
-
|
1616
1603
|
### Evaluation of expressions: display
|
1617
1604
|
|
1618
1605
|
To examine and change data in your script you can just evaluate any Ruby code
|
1619
1606
|
from `byebug`'s prompt. Any input that is not recognized as a command will be
|
1620
1607
|
evaluated, so `byebug` essentially works as a REPL. If you want to evaluate
|
1621
1608
|
something that conflicts with a `byebug` command, just use Ruby's `eval`. For
|
1622
|
-
example, if you want to print a variable called `n
|
1609
|
+
example, if you want to print a variable called `n`, type `eval n` because
|
1623
1610
|
typing just `n` will execute `byebug`'s command `next`.
|
1624
1611
|
|
1625
1612
|
Finally, if you need more advanced functionality from REPL's, you can enter
|
@@ -1667,19 +1654,20 @@ def triangle(n)
|
|
1667
1654
|
### Printing variables: var
|
1668
1655
|
|
1669
1656
|
Byebug can print many different information about variables. Such as
|
1657
|
+
|
1670
1658
|
* `var const <object>`. Show the constants of `<object>`. This is basically
|
1671
|
-
listing variables and their values in `<object>.constant`.
|
1659
|
+
listing variables and their values in `<object>.constant`.
|
1672
1660
|
* `var instance <object>`. Show the instance variables of `<object>`. This is
|
1673
|
-
basically listing `<object>.instance_variables`.
|
1661
|
+
basically listing `<object>.instance_variables`.
|
1674
1662
|
* `var instance`. Show instance_variables of `self`.
|
1675
1663
|
* `var local`. Show local variables.
|
1676
1664
|
* `var global`. Show global variables.
|
1677
1665
|
* `var all`. Show local, global and instance and class variables of `self`.
|
1678
1666
|
* `method instance <object>`. Show methods of `<object>`. Basically this is the
|
1679
|
-
same as running `<object>.instance_methods(false)`.
|
1667
|
+
same as running `<object>.instance_methods(false)`.
|
1680
1668
|
* `method <class-or-module>`. Show methods of the class or module
|
1681
|
-
`<class-or-module>`. Basically this is the same as running
|
1682
|
-
`<class-or-module>.methods`.
|
1669
|
+
`<class-or-module>`. Basically this is the same as running
|
1670
|
+
`<class-or-module>.methods`.
|
1683
1671
|
|
1684
1672
|
### Examining Program Source Files: list
|
1685
1673
|
|
@@ -1723,6 +1711,7 @@ give a line specification to specify what part of the file you want to edit.
|
|
1723
1711
|
You can customize `byebug` to use any editor you want by using the `EDITOR`
|
1724
1712
|
environment variable. The only restriction is that your editor (say `ex`) recognizes
|
1725
1713
|
the following command-line syntax:
|
1714
|
+
|
1726
1715
|
```
|
1727
1716
|
ex +nnn file
|
1728
1717
|
```
|
@@ -1738,6 +1727,7 @@ byebug ...
|
|
1738
1727
|
```
|
1739
1728
|
|
1740
1729
|
or in the `csh` shell,
|
1730
|
+
|
1741
1731
|
```bash
|
1742
1732
|
setenv EDITOR /usr/bin/vi
|
1743
1733
|
byebug ...
|
@@ -1803,14 +1793,14 @@ source code in Ruby, so we can not debug them using Byebug.
|
|
1803
1793
|
### Selecting a frame: `up`, `down` and `frame` commands
|
1804
1794
|
|
1805
1795
|
* `up <n>`: Move `n` frames up the stack, towards the outermost frame (higher
|
1806
|
-
frame numbers, frames that have existed longer). `n` defaults to one.
|
1796
|
+
frame numbers, frames that have existed longer). `n` defaults to one.
|
1807
1797
|
|
1808
1798
|
* `down <n>`: Move `n` frames down the stack, towards the _innermost frame_
|
1809
|
-
(lower frame numbers, frames that were created more recently). `n` defaults to
|
1810
|
-
one.
|
1799
|
+
(lower frame numbers, frames that were created more recently). `n` defaults to
|
1800
|
+
one.
|
1811
1801
|
|
1812
1802
|
* `frame <n>`: Allows you to move to an arbitrary frame. `n` is the stack frame
|
1813
|
-
number or 0 if no frame number is given. `frame 0` will show the current and
|
1814
|
-
most recent stack frame. If a negative number is given, counting is from the
|
1815
|
-
other end of the stack frame, so `frame -1` shows the least-recent, outermost
|
1816
|
-
stack frame. Without an argument, `frame` prints the current stack frame.
|
1803
|
+
number or 0 if no frame number is given. `frame 0` will show the current and
|
1804
|
+
most recent stack frame. If a negative number is given, counting is from the
|
1805
|
+
other end of the stack frame, so `frame -1` shows the least-recent, outermost
|
1806
|
+
stack frame. Without an argument, `frame` prints the current stack frame.
|
data/README.md
CHANGED
@@ -15,11 +15,9 @@
|
|
15
15
|
[gem_url]: https://rubygems.org/gems/byebug
|
16
16
|
[gpa_url]: https://codeclimate.com/github/deivid-rodriguez/byebug
|
17
17
|
[cov_url]: https://codeclimate.com/github/deivid-rodriguez/byebug
|
18
|
-
[tip_url]: https://
|
18
|
+
[tip_url]: https://gratipay.com/~deivid-rodriguez
|
19
19
|
[irc_url]: https://gitter.im/deivid-rodriguez/byebug
|
20
20
|
|
21
|
-
_Debugging in Ruby 2_
|
22
|
-
|
23
21
|
Byebug is a simple to use, feature rich debugger for Ruby 2. It uses the new
|
24
22
|
TracePoint API for execution control and the new Debug Inspector API for call
|
25
23
|
stack navigation, so it doesn't depend on internal core sources. It's developed
|
@@ -30,16 +28,15 @@ and offers many of the traditional debugging features such as:
|
|
30
28
|
|
31
29
|
* Stepping: Running your program one line at a time.
|
32
30
|
* Breaking: Pausing the program at some event or specified instruction, to
|
33
|
-
examine the current state.
|
31
|
+
examine the current state.
|
34
32
|
* Evaluating: Basic REPL functionality, although [pry] does a better job at
|
35
|
-
that.
|
33
|
+
that.
|
36
34
|
* Tracking: Keeping track of the different values of your variables or the
|
37
|
-
different lines executed by your program.
|
38
|
-
|
35
|
+
different lines executed by your program.
|
39
36
|
|
40
37
|
## Build Status
|
41
38
|
|
42
|
-
Linux
|
39
|
+
Linux [![Tra][tra]][tra_url]
|
43
40
|
|
44
41
|
Windows [![Vey][vey]][vey_url]
|
45
42
|
|
@@ -49,21 +46,20 @@ Windows [![Vey][vey]][vey_url]
|
|
49
46
|
[tra_url]: https://travis-ci.org/deivid-rodriguez/byebug
|
50
47
|
[vey_url]: https://ci.appveyor.com/project/deivid-rodriguez/byebug
|
51
48
|
|
52
|
-
|
53
49
|
## Requirements
|
54
50
|
|
55
51
|
* Required: MRI 2.0.0 or higher. For debugging ruby 1.9.3 or older, use
|
56
|
-
[debugger].
|
57
|
-
|
52
|
+
[debugger].
|
58
53
|
* Recommended:
|
59
|
-
|
60
|
-
|
61
|
-
|
54
|
+
* MRI 2.1.8 or higher.
|
55
|
+
* MRI 2.2.4 or higher.
|
56
|
+
* MRI 2.3.0 or higher.
|
62
57
|
|
63
58
|
## Install
|
64
59
|
|
65
|
-
|
66
|
-
|
60
|
+
```shell
|
61
|
+
gem install byebug
|
62
|
+
```
|
67
63
|
|
68
64
|
## Usage
|
69
65
|
|
@@ -75,7 +71,6 @@ wherever you want to start debugging and the execution will stop there. If you
|
|
75
71
|
are debugging rails, start the server and once the execution gets to your
|
76
72
|
`byebug` command you will get a debugging prompt.
|
77
73
|
|
78
|
-
|
79
74
|
## Byebug's commands
|
80
75
|
|
81
76
|
Command | Aliases | Subcommands
|
@@ -116,7 +111,6 @@ are debugging rails, start the server and once the execution gets to your
|
|
116
111
|
`up` | |
|
117
112
|
`var` | | `all` `constant` `global` `instance` `local`
|
118
113
|
|
119
|
-
|
120
114
|
## Semantic Versioning
|
121
115
|
|
122
116
|
Byebug tries to follow [semantic versioning](http://semver.org) and tries to
|
@@ -124,29 +118,25 @@ bump major version only when backwards incompatible changes are released.
|
|
124
118
|
Backwards compatibility is targeted to [pry-byebug] and any other plugins
|
125
119
|
relying on `byebug`.
|
126
120
|
|
127
|
-
|
128
121
|
## Getting Started
|
129
122
|
|
130
123
|
Read [byebug's markdown
|
131
124
|
guide](https://github.com/deivid-rodriguez/byebug/blob/master/GUIDE.md) to get
|
132
125
|
started. Proper documentation will be eventually written.
|
133
126
|
|
134
|
-
|
135
127
|
## Related projects
|
136
128
|
|
137
129
|
* [pry-byebug] adds `next`, `step`, `finish`, `continue` and `break` commands
|
138
|
-
to `pry` using `byebug`.
|
130
|
+
to `pry` using `byebug`.
|
139
131
|
* [ruby-debug-passenger] adds a rake task that restarts Passenger with Byebug
|
140
|
-
connected.
|
132
|
+
connected.
|
141
133
|
* [minitest-byebug] starts a byebug session on minitest failures.
|
142
134
|
* [sublime_debugger] provides a plugin for ruby debugging on Sublime Text.
|
143
135
|
|
144
|
-
|
145
136
|
## Contribute
|
146
137
|
|
147
138
|
See [Getting Started with Development](CONTRIBUTING.md).
|
148
139
|
|
149
|
-
|
150
140
|
## Credits
|
151
141
|
|
152
142
|
Everybody who has ever contributed to this forked and reforked piece of
|