byebug 10.0.2 → 11.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +365 -287
  3. data/CONTRIBUTING.md +6 -34
  4. data/GUIDE.md +9 -8
  5. data/LICENSE +18 -18
  6. data/README.md +83 -79
  7. data/ext/byebug/byebug.c +4 -9
  8. data/ext/byebug/byebug.h +4 -2
  9. data/ext/byebug/context.c +15 -2
  10. data/lib/byebug.rb +1 -1
  11. data/lib/byebug/attacher.rb +4 -4
  12. data/lib/byebug/command.rb +2 -2
  13. data/lib/byebug/command_list.rb +1 -1
  14. data/lib/byebug/commands.rb +38 -37
  15. data/lib/byebug/commands/break.rb +10 -14
  16. data/lib/byebug/commands/catch.rb +4 -8
  17. data/lib/byebug/commands/condition.rb +3 -5
  18. data/lib/byebug/commands/continue.rb +27 -9
  19. data/lib/byebug/commands/debug.rb +2 -2
  20. data/lib/byebug/commands/delete.rb +3 -5
  21. data/lib/byebug/commands/disable.rb +4 -4
  22. data/lib/byebug/commands/disable/breakpoints.rb +1 -1
  23. data/lib/byebug/commands/disable/display.rb +1 -1
  24. data/lib/byebug/commands/display.rb +2 -2
  25. data/lib/byebug/commands/down.rb +3 -3
  26. data/lib/byebug/commands/edit.rb +2 -1
  27. data/lib/byebug/commands/enable.rb +3 -3
  28. data/lib/byebug/commands/enable/breakpoints.rb +1 -1
  29. data/lib/byebug/commands/enable/display.rb +1 -1
  30. data/lib/byebug/commands/finish.rb +2 -2
  31. data/lib/byebug/commands/frame.rb +3 -3
  32. data/lib/byebug/commands/help.rb +2 -2
  33. data/lib/byebug/commands/history.rb +2 -2
  34. data/lib/byebug/commands/info.rb +6 -6
  35. data/lib/byebug/commands/info/breakpoints.rb +2 -4
  36. data/lib/byebug/commands/info/display.rb +1 -3
  37. data/lib/byebug/commands/info/file.rb +2 -4
  38. data/lib/byebug/commands/interrupt.rb +1 -1
  39. data/lib/byebug/commands/irb.rb +2 -4
  40. data/lib/byebug/commands/kill.rb +3 -5
  41. data/lib/byebug/commands/list.rb +4 -4
  42. data/lib/byebug/commands/method.rb +2 -2
  43. data/lib/byebug/commands/next.rb +2 -2
  44. data/lib/byebug/commands/pry.rb +3 -5
  45. data/lib/byebug/commands/quit.rb +4 -4
  46. data/lib/byebug/commands/restart.rb +3 -3
  47. data/lib/byebug/commands/save.rb +1 -1
  48. data/lib/byebug/commands/set.rb +3 -3
  49. data/lib/byebug/commands/show.rb +1 -1
  50. data/lib/byebug/commands/skip.rb +85 -0
  51. data/lib/byebug/commands/source.rb +2 -4
  52. data/lib/byebug/commands/step.rb +2 -2
  53. data/lib/byebug/commands/thread.rb +6 -6
  54. data/lib/byebug/commands/thread/current.rb +1 -1
  55. data/lib/byebug/commands/thread/list.rb +1 -1
  56. data/lib/byebug/commands/thread/resume.rb +2 -4
  57. data/lib/byebug/commands/thread/stop.rb +1 -1
  58. data/lib/byebug/commands/thread/switch.rb +1 -1
  59. data/lib/byebug/commands/tracevar.rb +2 -5
  60. data/lib/byebug/commands/undisplay.rb +5 -6
  61. data/lib/byebug/commands/untracevar.rb +1 -1
  62. data/lib/byebug/commands/up.rb +3 -3
  63. data/lib/byebug/commands/var.rb +8 -8
  64. data/lib/byebug/commands/var/all.rb +1 -1
  65. data/lib/byebug/commands/var/args.rb +1 -1
  66. data/lib/byebug/commands/var/const.rb +2 -4
  67. data/lib/byebug/commands/var/instance.rb +1 -1
  68. data/lib/byebug/commands/var/local.rb +1 -1
  69. data/lib/byebug/commands/where.rb +2 -2
  70. data/lib/byebug/context.rb +4 -4
  71. data/lib/byebug/core.rb +10 -9
  72. data/lib/byebug/frame.rb +2 -2
  73. data/lib/byebug/helpers/frame.rb +1 -1
  74. data/lib/byebug/helpers/parse.rb +1 -3
  75. data/lib/byebug/helpers/string.rb +0 -3
  76. data/lib/byebug/helpers/toggle.rb +2 -4
  77. data/lib/byebug/helpers/var.rb +1 -1
  78. data/lib/byebug/history.rb +1 -1
  79. data/lib/byebug/interface.rb +6 -6
  80. data/lib/byebug/interfaces/local_interface.rb +21 -2
  81. data/lib/byebug/interfaces/remote_interface.rb +1 -1
  82. data/lib/byebug/interfaces/script_interface.rb +2 -1
  83. data/lib/byebug/printers/base.rb +4 -5
  84. data/lib/byebug/printers/plain.rb +1 -1
  85. data/lib/byebug/processors/command_processor.rb +2 -2
  86. data/lib/byebug/processors/control_processor.rb +1 -1
  87. data/lib/byebug/processors/post_mortem_processor.rb +1 -1
  88. data/lib/byebug/processors/script_processor.rb +1 -1
  89. data/lib/byebug/remote.rb +3 -3
  90. data/lib/byebug/remote/client.rb +2 -0
  91. data/lib/byebug/runner.rb +7 -7
  92. data/lib/byebug/setting.rb +2 -2
  93. data/lib/byebug/settings/autoirb.rb +2 -2
  94. data/lib/byebug/settings/autolist.rb +2 -2
  95. data/lib/byebug/settings/autopry.rb +2 -2
  96. data/lib/byebug/settings/autosave.rb +1 -1
  97. data/lib/byebug/settings/basename.rb +1 -1
  98. data/lib/byebug/settings/callstyle.rb +2 -2
  99. data/lib/byebug/settings/fullpath.rb +1 -1
  100. data/lib/byebug/settings/histfile.rb +1 -1
  101. data/lib/byebug/settings/histsize.rb +1 -1
  102. data/lib/byebug/settings/linetrace.rb +1 -1
  103. data/lib/byebug/settings/listsize.rb +1 -1
  104. data/lib/byebug/settings/post_mortem.rb +1 -1
  105. data/lib/byebug/settings/savefile.rb +1 -1
  106. data/lib/byebug/settings/stack_on_error.rb +1 -1
  107. data/lib/byebug/settings/width.rb +1 -1
  108. data/lib/byebug/source_file_formatter.rb +2 -2
  109. data/lib/byebug/subcommands.rb +2 -2
  110. data/lib/byebug/version.rb +1 -1
  111. metadata +9 -9
data/CONTRIBUTING.md CHANGED
@@ -21,8 +21,8 @@ abide by its terms.
21
21
  always have the lastest patch level release installed.
22
22
  * The recommended tool to manage development dependencies is `bundler`. Run
23
23
  `gem install bundler` to install it.
24
- * Running `bin/bundle install` inside a local clone of `byebug` will get
25
- development dependencies installed.
24
+ * Running `bundle install` inside a local clone of `byebug` will get development
25
+ dependencies installed.
26
26
 
27
27
  ## Running the test suite
28
28
 
@@ -43,36 +43,8 @@ abide by its terms.
43
43
 
44
44
  ## Code style
45
45
 
46
- * Byebug uses [codeclimate][] to enforce code style. You can run codeclimate
47
- checks locally using the [codeclimate CLI][] with `codeclimate analyze`.
48
-
49
- * It also uses some extra style checks that are not available in codeclimate.
50
- You can run those using `bin/rake lint`. These tasks are:
51
-
52
- * Linting of c-files using `clang-format`. Configuration is specific to
53
- clang-format 3.8, you may need some extra work to get that installed on macOS,
54
- see below.
55
-
56
- * Checking correct executable bit on repository files.
57
-
58
- [codeclimate]: https://codeclimate.com/github/deivid-rodriguez/byebug
59
- [codeclimate CLI]: https://github.com/codeclimate/codeclimate
60
-
61
- ### Runnning `clang-format` on macOS
62
-
63
- At the moment byebug uses older `clang-format` version to enforce C codestyle than
64
- can be found in Homebrew. If you are planning to change some C source here it is
65
- recommended to use [direnv][] to hook that older version into your shell:
66
-
67
- * Install [direnv][] as described in their README
68
- * Install `clang-format@3.8` with `brew install clang-format@3.8`
69
- * In byebug source code directory do `echo 'export PATH="/usr/local/opt/clang-format@3.8/bin:$PATH"' > .envrc`
70
- * Allow direnv to use that `.envrc` file with `direnv allow`
71
-
72
- With that your `$PATH` will be updated to use older `clang-format` every time you `cd`
73
- into byebug source code folder. It will reverted back when you `cd` out of it as well.
74
-
75
- [direnv]: https://github.com/direnv/direnv/
46
+ * Byebug uses several style checks to check code style consistent. You can run
47
+ those using `bin/rake lint`.
76
48
 
77
49
  ## Byebug as a C-extension
78
50
 
@@ -81,6 +53,6 @@ functionality is implemented in C (the interaction with the TracePoint API).
81
53
  The rest of the gem is implemented in Ruby. Normally you won't need to touch
82
54
  the C-extension, but it will obviously depended on the bug you're trying to fix
83
55
  or the feature you are willing to add. You can learn more about C-extensions
84
- [here](http://tenderlovemaking.com/2009/12/18/writing-ruby-c-extensions-part-1.html)
56
+ [here](https://tenderlovemaking.com/2009/12/18/writing-ruby-c-extensions-part-1.html)
85
57
  or
86
- [here](http://tenderlovemaking.com/2010/12/11/writing-ruby-c-extensions-part-2.html).
58
+ [here](https://tenderlovemaking.com/2010/12/11/writing-ruby-c-extensions-part-2.html).
data/GUIDE.md CHANGED
@@ -69,12 +69,12 @@ Now let us step through the program.
69
69
  5: tri = 0
70
70
  6:
71
71
  7: 0.upto(n) { |i| tri += i }
72
- 9: end
73
- 10:
74
- 11: tri
75
- 12: end
76
- 13:
77
- => 14: triangle(3)
72
+ 8:
73
+ 9: tri
74
+ 10: end
75
+ 11:
76
+ => 12: t = triangle(3)
77
+ 13: puts t
78
78
  (byebug) <RET> # hit enter
79
79
 
80
80
  [1, 10] in /path/to/triangle.rb
@@ -613,7 +613,7 @@ We get the same result as if we had run byebug from the outset.
613
613
  ### Debugging Oddities: How debugging Ruby may be different from other languages
614
614
 
615
615
  If you are used to debugging in other languages like C, C++, Perl, Java or even
616
- Bash (see [bashdb](http://bashdb.sf.net)), there may be a number of things that
616
+ Bash (see [bashdb](http://bashdb.sourceforge.net)), there may be a number of things that
617
617
  seem or feel a little bit different and may confuse you. A number of these
618
618
  things aren't oddities of the debugger per se but differences in how Ruby works
619
619
  compared to those other languages. Because Ruby works a little differently from
@@ -1298,7 +1298,7 @@ Running a program from byebug adds a bit of overhead and slows it down a little.
1298
1298
  Furthermore, by necessity, debuggers change the operation of the program they
1299
1299
  are debugging. And this can lead to unexpected and unwanted differences. It has
1300
1300
  happened so often that the term
1301
- [Heisenbugs](http://en.wikipedia.org/wiki/Heisenbug) was coined to describe the
1301
+ [Heisenbugs](https://en.wikipedia.org/wiki/Heisenbug) was coined to describe the
1302
1302
  situation where using a debugger (among other possibilities) changes the
1303
1303
  behavior of the program so that the bug doesn't manifest itself anymore.
1304
1304
 
@@ -1468,6 +1468,7 @@ display a short list of named classes of commands
1468
1468
  save -- Saves current byebug session to a file
1469
1469
  set -- Modifies byebug settings
1470
1470
  show -- Shows byebug settings
1471
+ skip -- Runs until the next breakpoint as long as it is different from the current one
1471
1472
  source -- Restores a previously saved byebug session
1472
1473
  step -- Steps into blocks or methods one or more times
1473
1474
  thread -- Commands to manipulate threads
data/LICENSE CHANGED
@@ -1,23 +1,23 @@
1
- Copyright (c) David Rodríguez <deivid.rodriguez@gmail.com>
1
+ Copyright (c) 2018 David Rodríguez <deivid.rodriguez@riseup.net>
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
5
- modification, are permitted provided that the following conditions
6
- are met:
7
- 1. Redistributions of source code must retain the above copyright
8
- notice, this list of conditions and the following disclaimer.
9
- 2. Redistributions in binary form must reproduce the above copyright
10
- notice, this list of conditions and the following disclaimer in the
11
- documentation and/or other materials provided with the distribution.
5
+ modification, are permitted provided that the following conditions are met:
12
6
 
13
- THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
14
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16
- ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
7
+ * Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
9
+
10
+ * Redistributions in binary form must reproduce the above copyright notice,
11
+ this list of conditions and the following disclaimer in the documentation
12
+ and/or other materials provided with the distribution.
13
+
14
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
17
18
  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23
- SUCH DAMAGE.
19
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md CHANGED
@@ -1,27 +1,25 @@
1
1
  # Byebug
2
2
 
3
3
  [![Version][gem]][gem_url]
4
- [![Maintainability][mai]][mai_url]
5
- [![Coverage][cov]][cov_url]
4
+ [![Tidelift][tid]][tid_url]
6
5
  [![Gitter][irc]][irc_url]
7
6
 
8
7
  [gem]: https://img.shields.io/gem/v/byebug.svg
9
- [mai]: https://api.codeclimate.com/v1/badges/f1a1bec582752c22da80/maintainability
10
- [cov]: https://api.codeclimate.com/v1/badges/f1a1bec582752c22da80/test_coverage
8
+ [tid]: https://tidelift.com/badges/package/rubygems/byebug
11
9
  [irc]: https://img.shields.io/badge/IRC%20(gitter)-devs%20%26%20users-brightgreen.svg
12
10
 
13
11
  [gem_url]: https://rubygems.org/gems/byebug
14
- [mai_url]: https://codeclimate.com/github/deivid-rodriguez/byebug/maintainability
15
- [cov_url]: https://codeclimate.com/github/deivid-rodriguez/byebug/test_coverage
12
+ [tid_url]: https://tidelift.com/subscription/pkg/rubygems-byebug?utm_source=rubygems-byebug&utm_medium=readme_badge
16
13
  [irc_url]: https://gitter.im/deivid-rodriguez/byebug
17
14
 
18
- Byebug is a simple to use, feature rich debugger for Ruby. It uses the
15
+ Byebug is a simple to use and feature rich debugger for Ruby. It uses the
19
16
  TracePoint API for execution control and the Debug Inspector API for call stack
20
- navigation, so it doesn't depend on internal core sources. It's developed as a C
21
- extension, so it's fast. And it has a full test suite so it's reliable.
17
+ navigation. Therefore, Byebug doesn't depend on internal core sources. Byebug is also
18
+ fast because it is developed as a C extension and reliable because it is supported
19
+ by a full test suite.
22
20
 
23
- It allows you to see what is going on _inside_ a Ruby program while it executes
24
- and offers many of the traditional debugging features such as:
21
+ The debugger permits the ability to understand what is going on _inside_ a Ruby program
22
+ while it executes and offers many of the traditional debugging features such as:
25
23
 
26
24
  * Stepping: Running your program one line at a time.
27
25
  * Breaking: Pausing the program at some event or specified instruction, to
@@ -31,25 +29,21 @@ and offers many of the traditional debugging features such as:
31
29
  * Tracking: Keeping track of the different values of your variables or the
32
30
  different lines executed by your program.
33
31
 
34
- ## Build Status
32
+ ## For enterprise
35
33
 
36
- Linux [![Cir][cir]][cir_url]
37
- macOS [![Tra][tra]][tra_url]
38
- Windows [![Vey][vey]][vey_url]
34
+ Byebug for enterprise is available via the Tidelift Subscription. [Learn
35
+ more][Tidelift for enterprise].
39
36
 
40
- [cir]: https://circleci.com/gh/deivid-rodriguez/byebug/tree/master.svg?style=svg
41
- [tra]: https://api.travis-ci.org/deivid-rodriguez/byebug.svg?branch=master
42
- [vey]: https://ci.appveyor.com/api/projects/status/github/deivid-rodriguez/byebug?svg=true
37
+ ## Build Status
43
38
 
44
- [cir_url]: https://circleci.com/gh/deivid-rodriguez/byebug/tree/master
45
- [tra_url]: https://travis-ci.org/deivid-rodriguez/byebug
46
- [vey_url]: https://ci.appveyor.com/project/deivid-rodriguez/byebug
39
+ ![ubuntu](https://github.com/deivid-rodriguez/byebug/workflows/ubuntu/badge.svg)
40
+ ![windows](https://github.com/deivid-rodriguez/byebug/workflows/windows/badge.svg)
47
41
 
48
42
  ## Requirements
49
43
 
50
- * Required: MRI 2.2.0 or higher.
51
-
52
- * Recommended: MRI 2.3.0 or higher.
44
+ * _Required_: MRI 2.4.0 or higher.
45
+ * _Recommended_: MRI 2.6.4 or higher (MRI 2.6.0 to 2.6.3 contain a regression
46
+ causing unbalanced call/return events in some cases, breaking the `next` command).
53
47
 
54
48
  ## Install
55
49
 
@@ -57,7 +51,7 @@ Windows [![Vey][vey]][vey_url]
57
51
  gem install byebug
58
52
  ```
59
53
 
60
- Or if you use `bundler`,
54
+ Alternatively, if you use `bundler`:
61
55
 
62
56
  ```shell
63
57
  bundle add byebug --group "development, test"
@@ -67,12 +61,9 @@ bundle add byebug --group "development, test"
67
61
 
68
62
  ### From within the Ruby code
69
63
 
70
- Simply drop
71
-
72
- byebug
73
-
74
- wherever you want to start debugging and the execution will stop there.
75
- If you were debugging Rails, for example, you would add `byebug` to your code.
64
+ Simply include `byebug` wherever you want to start debugging and the execution will
65
+ stop there. For example, if you were debugging Rails, you would add `byebug` to
66
+ your code:
76
67
 
77
68
  ```ruby
78
69
  def index
@@ -81,13 +72,13 @@ def index
81
72
  end
82
73
  ```
83
74
 
84
- And then start a Rails server.
75
+ And then start a Rails server:
85
76
 
86
77
  ```shell
87
78
  bin/rails s
88
79
  ```
89
80
 
90
- Once the execution gets to your `byebug` command you will get a debugging prompt.
81
+ Once the execution gets to your `byebug` command, you will receive a debugging prompt.
91
82
 
92
83
  ### From the command line
93
84
 
@@ -99,49 +90,52 @@ byebug myscript.rb
99
90
 
100
91
  ## Byebug's commands
101
92
 
102
- Command | Aliases | Subcommands
103
- ------- | ------- | -----------
104
- `backtrace` | `bt` `where` |
105
- `break` | |
106
- `catch` | |
107
- `condition` | |
108
- `continue` | |
109
- `debug` | |
110
- `delete` | |
111
- `disable` | | `breakpoints` `display`
112
- `display` | |
113
- `down` | |
114
- `edit` | |
115
- `enable` | | `breakpoints` `display`
116
- `finish` | |
117
- `frame` | |
118
- `help` | |
119
- `history` | |
120
- `info` | | `args` `breakpoints` `catch` `display` `file` `line` `program`
121
- `interrupt` | |
122
- `irb` | |
123
- `kill` | |
124
- `list` | |
125
- `method` | | `instance`
126
- `next` | |
127
- `pry` | |
128
- `quit` | |
129
- `restart` | |
130
- `save` | |
131
- `set` | | `autoirb` `autolist` `autopry` `autosave` `basename` `callstyle` `fullpath` `histfile` `histsize` `linetrace` `listsize` `post_mortem` `savefile` `stack_on_error` `width`
132
- `show` | | `autoirb` `autolist` `autopry` `autosave` `basename` `callstyle` `fullpath` `histfile` `histsize` `linetrace` `listsize` `post_mortem` `savefile` `stack_on_error` `width`
133
- `source` | |
134
- `step` | |
135
- `thread` | | `current` `list` `resume` `stop` `switch`
136
- `tracevar` | |
137
- `undisplay` | |
138
- `untracevar`| |
139
- `up` | |
140
- `var` | | `all` `constant` `global` `instance` `local`
93
+ Command | Aliases | Subcommands
94
+ ------- | ------- | -----------
95
+ `backtrace` | `bt` `w` `where`|
96
+ `break` | `b` |
97
+ `catch` | `cat` |
98
+ `condition` | `cond` |
99
+ `continue` | `c` `cont` |
100
+ `continue!` | `c!` `cont!` |
101
+ `debug` | |
102
+ `delete` | `del` |
103
+ `disable` | `dis` | `breakpoints` `display`
104
+ `display` | `disp` |
105
+ `down` | |
106
+ `edit` | `ed` |
107
+ `enable` | `en` | `breakpoints` `display`
108
+ `finish` | `fin` |
109
+ `frame` | `f` |
110
+ `help` | `h` |
111
+ `history` | `hist` |
112
+ `info` | `i` | `args` `breakpoints` `catch` `display` `file` `line` `program`
113
+ `interrupt` | `int` |
114
+ `irb` | |
115
+ `kill` | |
116
+ `list` | `l` |
117
+ `method` | `m` | `instance`
118
+ `next` | `n` |
119
+ `pry` | |
120
+ `quit` | `q` |
121
+ `quit!` | `q!` |
122
+ `restart` | |
123
+ `save` | `sa` |
124
+ `set` | | `autoirb` `autolist` `autopry` `autosave` `basename` `callstyle` `fullpath` `histfile` `histsize` `linetrace` `listsize` `post_mortem` `savefile` `stack_on_error` `width`
125
+ `show` | | `autoirb` `autolist` `autopry` `autosave` `basename` `callstyle` `fullpath` `histfile` `histsize` `linetrace` `listsize` `post_mortem` `savefile` `stack_on_error` `width`
126
+ `skip` | `sk` |
127
+ `source` | `so` |
128
+ `step` | `s` |
129
+ `thread` | `th` | `current` `list` `resume` `stop` `switch`
130
+ `tracevar` | `tr` |
131
+ `undisplay` | `undisp` |
132
+ `untracevar`| `untr` |
133
+ `up` | |
134
+ `var` | `v` | `all` `constant` `global` `instance` `local`
141
135
 
142
136
  ## Semantic Versioning
143
137
 
144
- Byebug tries to follow [semantic versioning](http://semver.org) and tries to
138
+ Byebug attempts to follow [semantic versioning](https://semver.org) and
145
139
  bump major version only when backwards incompatible changes are released.
146
140
  Backwards compatibility is targeted to [pry-byebug] and any other plugins
147
141
  relying on `byebug`.
@@ -166,10 +160,18 @@ started. Proper documentation will be eventually written.
166
160
 
167
161
  See [Getting Started with Development](CONTRIBUTING.md).
168
162
 
169
- You can also help `byebug` by leaving a small (or big) tip through
170
- [Liberapay][liberapay.com].
163
+ ## Funding
164
+
165
+ Subscribe to [Tidelift][Tidelift support] to ensure byebug stays actively
166
+ maintained, and at the same time get licensing assurances and timely security
167
+ notifications for your open source dependencies.
168
+
169
+ You can also help `byebug` by leaving a small (or big) tip through [Liberapay].
170
+
171
+ ## Security contact information
171
172
 
172
- [![Support via Liberapay][liberapay-button]][liberapay-donate]
173
+ Please use the Tidelift security contact to [report a security vulnerability].
174
+ Tidelift will coordinate the fix and disclosure.
173
175
 
174
176
  ## Credits
175
177
 
@@ -190,6 +192,8 @@ software, especially:
190
192
  [minitest-byebug]: https://github.com/kaspth/minitest-byebug
191
193
  [sublime_debugger]: https://github.com/shuky19/sublime_debugger
192
194
  [atom-byebug]: https://github.com/izaera/atom-byebug
193
- [liberapay.com]: https://liberapay.com
194
- [liberapay-button]: https://liberapay.com/assets/widgets/donate.svg
195
- [liberapay-donate]: https://liberapay.com/byebug/donate
195
+ [Liberapay]: https://liberapay.com/byebug/donate
196
+ [Tidelift]: https://tidelift.com/subscription/pkg/rubygems-byebug?utm_source=rubygems-byebug&utm_medium=readme_text
197
+ [Tidelift for enterprise]: https://tidelift.com/subscription/pkg/rubygems-byebug?utm_source=rubygems-byebug&utm_medium=referral&utm_campaign=github&utm_content=enterprise
198
+ [Tidelift support]: https://tidelift.com/subscription/pkg/rubygems-byebug?utm_source=rubygems-byebug&utm_medium=referral&utm_campaign=github&utm_content=support
199
+ [report a security vulnerability]: https://tidelift.com/security
data/ext/byebug/byebug.c CHANGED
@@ -305,14 +305,7 @@ call_event(VALUE trace_point, void *data)
305
305
 
306
306
  CALL_EVENT_SETUP;
307
307
 
308
- /* nil method_id means we are at top level so there can't be a method
309
- * breakpoint here. Just leave then. */
310
308
  msym = rb_tracearg_method_id(trace_arg);
311
- if (NIL_P(msym))
312
- {
313
- EVENT_TEARDOWN;
314
- return;
315
- }
316
309
 
317
310
  mid = SYM2ID(msym);
318
311
  klass = rb_tracearg_defined_class(trace_arg);
@@ -367,7 +360,9 @@ return_event(VALUE trace_point, void *data)
367
360
  * [#7] b_return@/hort/core_ext/numeric/conversions.rb:133 BigDecimal#to_s
368
361
  * [#7] return@:0 Fixnum#to_s # => This guy...
369
362
  */
370
- if (!NIL_P(file))
363
+ if (NIL_P(file))
364
+ rb_warn("The TracePoint API emitted a return event without file information. It might be a bug, please report this.");
365
+ else
371
366
  {
372
367
  line = rb_tracearg_lineno(trace_arg);
373
368
  binding = rb_tracearg_binding(trace_arg);
@@ -436,7 +431,7 @@ raise_event(VALUE trace_point, void *data)
436
431
 
437
432
  raised_exception = rb_tracearg_raised_exception(trace_arg);
438
433
 
439
- if (post_mortem == Qtrue)
434
+ if (post_mortem == Qtrue && !rb_ivar_defined(raised_exception, rb_intern("@__bb_context")))
440
435
  {
441
436
  pm_context = context_dup(dc);
442
437
  rb_ivar_set(raised_exception, rb_intern("@__bb_context"), pm_context);
data/ext/byebug/byebug.h CHANGED
@@ -30,7 +30,8 @@
30
30
  } while (0)
31
31
 
32
32
  /* types */
33
- typedef enum {
33
+ typedef enum
34
+ {
34
35
  CTX_STOP_NONE,
35
36
  CTX_STOP_STEP,
36
37
  CTX_STOP_BREAKPOINT,
@@ -54,7 +55,8 @@ typedef struct
54
55
  VALUE backtrace; /* [[loc, self, klass, binding], ...] */
55
56
  } debug_context_t;
56
57
 
57
- typedef enum {
58
+ typedef enum
59
+ {
58
60
  LOCATION,
59
61
  SELF,
60
62
  CLASS,
data/ext/byebug/context.c CHANGED
@@ -177,6 +177,13 @@ open_debug_inspector(struct call_with_inspection_data *cwi)
177
177
  return rb_debug_inspector_open(open_debug_inspector_i, cwi);
178
178
  }
179
179
 
180
+ static VALUE
181
+ open_debug_inspector_ensure(VALUE v)
182
+ {
183
+ return open_debug_inspector((struct call_with_inspection_data *)v);
184
+ }
185
+
186
+
180
187
  static VALUE
181
188
  close_debug_inspector(struct call_with_inspection_data *cwi)
182
189
  {
@@ -184,10 +191,16 @@ close_debug_inspector(struct call_with_inspection_data *cwi)
184
191
  return Qnil;
185
192
  }
186
193
 
194
+ static VALUE
195
+ close_debug_inspector_ensure(VALUE v)
196
+ {
197
+ return close_debug_inspector((struct call_with_inspection_data *)v);
198
+ }
199
+
187
200
  extern VALUE
188
201
  call_with_debug_inspector(struct call_with_inspection_data *data)
189
202
  {
190
- return rb_ensure(open_debug_inspector, (VALUE)data, close_debug_inspector,
203
+ return rb_ensure(open_debug_inspector_ensure, (VALUE)data, close_debug_inspector_ensure,
191
204
  (VALUE)data);
192
205
  }
193
206
 
@@ -669,5 +682,5 @@ Init_byebug_context(VALUE mByebug)
669
682
  rb_define_method(cContext, "tracing=", Context_set_tracing, 1);
670
683
 
671
684
  cDebugThread = rb_define_class_under(mByebug, "DebugThread", rb_cThread);
672
- rb_define_singleton_method(cDebugThread, "inherited", dt_inherited, 1);
685
+ rb_define_singleton_method(cDebugThread, "inherited", dt_inherited, 0);
673
686
  }