byebug 9.1.0 → 10.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +24 -3
- data/CONTRIBUTING.md +39 -18
- data/GUIDE.md +16 -17
- data/README.md +64 -52
- data/exe/byebug +6 -0
- data/ext/byebug/breakpoint.c +1 -1
- data/ext/byebug/byebug.c +16 -16
- data/ext/byebug/byebug.h +40 -26
- data/ext/byebug/context.c +26 -26
- data/ext/byebug/extconf.rb +7 -5
- data/ext/byebug/threads.c +8 -8
- data/lib/byebug.rb +3 -1
- data/lib/byebug/attacher.rb +17 -3
- data/lib/byebug/breakpoint.rb +25 -3
- data/lib/byebug/command.rb +20 -14
- data/lib/byebug/command_list.rb +3 -1
- data/lib/byebug/commands.rb +39 -37
- data/lib/byebug/commands/break.rb +33 -15
- data/lib/byebug/commands/catch.rb +16 -14
- data/lib/byebug/commands/condition.rb +11 -9
- data/lib/byebug/commands/continue.rb +9 -7
- data/lib/byebug/commands/debug.rb +7 -5
- data/lib/byebug/commands/delete.rb +11 -9
- data/lib/byebug/commands/disable.rb +8 -6
- data/lib/byebug/commands/disable/breakpoints.rb +7 -5
- data/lib/byebug/commands/disable/display.rb +7 -5
- data/lib/byebug/commands/display.rb +11 -9
- data/lib/byebug/commands/down.rb +10 -8
- data/lib/byebug/commands/edit.rb +10 -8
- data/lib/byebug/commands/enable.rb +8 -6
- data/lib/byebug/commands/enable/breakpoints.rb +7 -5
- data/lib/byebug/commands/enable/display.rb +7 -5
- data/lib/byebug/commands/finish.rb +8 -6
- data/lib/byebug/commands/frame.rb +11 -9
- data/lib/byebug/commands/help.rb +7 -5
- data/lib/byebug/commands/history.rb +7 -5
- data/lib/byebug/commands/info.rb +11 -9
- data/lib/byebug/commands/info/breakpoints.rb +17 -11
- data/lib/byebug/commands/info/display.rb +16 -7
- data/lib/byebug/commands/info/file.rb +12 -10
- data/lib/byebug/commands/info/line.rb +5 -3
- data/lib/byebug/commands/info/program.rb +8 -6
- data/lib/byebug/commands/interrupt.rb +8 -4
- data/lib/byebug/commands/irb.rb +9 -7
- data/lib/byebug/commands/kill.rb +9 -7
- data/lib/byebug/commands/list.rb +41 -46
- data/lib/byebug/commands/method.rb +10 -8
- data/lib/byebug/commands/next.rb +8 -6
- data/lib/byebug/commands/pry.rb +10 -8
- data/lib/byebug/commands/quit.rb +7 -5
- data/lib/byebug/commands/restart.rb +13 -11
- data/lib/byebug/commands/save.rb +9 -7
- data/lib/byebug/commands/set.rb +12 -10
- data/lib/byebug/commands/show.rb +7 -5
- data/lib/byebug/commands/source.rb +7 -5
- data/lib/byebug/commands/step.rb +8 -6
- data/lib/byebug/commands/thread.rb +11 -9
- data/lib/byebug/commands/thread/current.rb +6 -4
- data/lib/byebug/commands/thread/list.rb +7 -5
- data/lib/byebug/commands/thread/resume.rb +7 -5
- data/lib/byebug/commands/thread/stop.rb +6 -4
- data/lib/byebug/commands/thread/switch.rb +6 -4
- data/lib/byebug/commands/tracevar.rb +10 -8
- data/lib/byebug/commands/undisplay.rb +10 -8
- data/lib/byebug/commands/untracevar.rb +8 -6
- data/lib/byebug/commands/up.rb +10 -8
- data/lib/byebug/commands/var.rb +12 -10
- data/lib/byebug/commands/var/all.rb +7 -5
- data/lib/byebug/commands/var/args.rb +6 -4
- data/lib/byebug/commands/var/const.rb +9 -7
- data/lib/byebug/commands/var/global.rb +5 -3
- data/lib/byebug/commands/var/instance.rb +6 -4
- data/lib/byebug/commands/var/local.rb +6 -4
- data/lib/byebug/commands/where.rb +9 -7
- data/lib/byebug/context.rb +7 -5
- data/lib/byebug/core.rb +25 -25
- data/lib/byebug/errors.rb +4 -2
- data/lib/byebug/frame.rb +16 -16
- data/lib/byebug/helpers/bin.rb +28 -7
- data/lib/byebug/helpers/eval.rb +8 -6
- data/lib/byebug/helpers/file.rb +4 -2
- data/lib/byebug/helpers/frame.rb +5 -3
- data/lib/byebug/helpers/parse.rb +5 -3
- data/lib/byebug/helpers/path.rb +7 -5
- data/lib/byebug/helpers/reflection.rb +2 -0
- data/lib/byebug/helpers/string.rb +4 -2
- data/lib/byebug/helpers/thread.rb +10 -8
- data/lib/byebug/helpers/toggle.rb +10 -8
- data/lib/byebug/helpers/var.rb +8 -6
- data/lib/byebug/history.rb +7 -5
- data/lib/byebug/interface.rb +13 -11
- data/lib/byebug/interfaces/local_interface.rb +4 -4
- data/lib/byebug/interfaces/remote_interface.rb +21 -9
- data/lib/byebug/interfaces/script_interface.rb +2 -0
- data/lib/byebug/interfaces/test_interface.rb +5 -3
- data/lib/byebug/option_setter.rb +14 -12
- data/lib/byebug/printers/base.rb +6 -6
- data/lib/byebug/printers/plain.rb +8 -6
- data/lib/byebug/printers/texts/base.yml +3 -3
- data/lib/byebug/processors/command_processor.rb +11 -12
- data/lib/byebug/processors/control_processor.rb +4 -6
- data/lib/byebug/processors/post_mortem_processor.rb +4 -2
- data/lib/byebug/processors/script_processor.rb +7 -3
- data/lib/byebug/remote.rb +45 -65
- data/lib/byebug/remote/client.rb +55 -0
- data/lib/byebug/remote/server.rb +47 -0
- data/lib/byebug/runner.rb +26 -19
- data/lib/byebug/setting.rb +10 -4
- data/lib/byebug/settings/autoirb.rb +5 -3
- data/lib/byebug/settings/autolist.rb +5 -3
- data/lib/byebug/settings/autopry.rb +5 -3
- data/lib/byebug/settings/autosave.rb +4 -2
- data/lib/byebug/settings/basename.rb +4 -2
- data/lib/byebug/settings/callstyle.rb +3 -3
- data/lib/byebug/settings/fullpath.rb +4 -2
- data/lib/byebug/settings/histfile.rb +5 -3
- data/lib/byebug/settings/histsize.rb +4 -2
- data/lib/byebug/settings/linetrace.rb +4 -2
- data/lib/byebug/settings/listsize.rb +4 -2
- data/lib/byebug/settings/post_mortem.rb +4 -2
- data/lib/byebug/settings/savefile.rb +4 -2
- data/lib/byebug/settings/stack_on_error.rb +4 -2
- data/lib/byebug/settings/width.rb +3 -1
- data/lib/byebug/source_file_formatter.rb +71 -0
- data/lib/byebug/subcommands.rb +6 -4
- data/lib/byebug/version.rb +1 -1
- metadata +8 -5
- data/bin/byebug +0 -9
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/setting"
|
4
|
+
require "byebug/commands/irb"
|
3
5
|
|
4
6
|
module Byebug
|
5
7
|
#
|
@@ -13,7 +15,7 @@ module Byebug
|
|
13
15
|
end
|
14
16
|
|
15
17
|
def banner
|
16
|
-
|
18
|
+
"Invoke IRB on every stop"
|
17
19
|
end
|
18
20
|
|
19
21
|
def value=(v)
|
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/setting"
|
4
|
+
require "byebug/commands/list"
|
3
5
|
|
4
6
|
module Byebug
|
5
7
|
#
|
@@ -13,7 +15,7 @@ module Byebug
|
|
13
15
|
end
|
14
16
|
|
15
17
|
def banner
|
16
|
-
|
18
|
+
"Invoke list command on every stop"
|
17
19
|
end
|
18
20
|
|
19
21
|
def value=(v)
|
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/setting"
|
4
|
+
require "byebug/commands/pry"
|
3
5
|
|
4
6
|
module Byebug
|
5
7
|
#
|
@@ -13,7 +15,7 @@ module Byebug
|
|
13
15
|
end
|
14
16
|
|
15
17
|
def banner
|
16
|
-
|
18
|
+
"Invoke Pry on every stop"
|
17
19
|
end
|
18
20
|
|
19
21
|
def value=(v)
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/setting"
|
2
4
|
|
3
5
|
module Byebug
|
4
6
|
#
|
@@ -9,7 +11,7 @@ module Byebug
|
|
9
11
|
DEFAULT = true
|
10
12
|
|
11
13
|
def banner
|
12
|
-
|
14
|
+
"Automatically save command history record on exit"
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/setting"
|
2
4
|
|
3
5
|
module Byebug
|
4
6
|
#
|
@@ -8,7 +10,7 @@ module Byebug
|
|
8
10
|
#
|
9
11
|
class BasenameSetting < Setting
|
10
12
|
def banner
|
11
|
-
|
13
|
+
"<file>:<line> information after every stop uses short paths"
|
12
14
|
end
|
13
15
|
end
|
14
16
|
end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "byebug/setting"
|
4
4
|
|
5
5
|
module Byebug
|
6
6
|
#
|
7
7
|
# Setting to customize the verbosity level for stack frames.
|
8
8
|
#
|
9
9
|
class CallstyleSetting < Setting
|
10
|
-
DEFAULT =
|
10
|
+
DEFAULT = "long".freeze
|
11
11
|
|
12
12
|
def banner
|
13
|
-
|
13
|
+
"Set how you want method call parameters to be displayed"
|
14
14
|
end
|
15
15
|
|
16
16
|
def to_s
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/setting"
|
2
4
|
|
3
5
|
module Byebug
|
4
6
|
#
|
@@ -8,7 +10,7 @@ module Byebug
|
|
8
10
|
DEFAULT = true
|
9
11
|
|
10
12
|
def banner
|
11
|
-
|
13
|
+
"Display full file names in backtraces"
|
12
14
|
end
|
13
15
|
end
|
14
16
|
end
|
@@ -1,14 +1,16 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/setting"
|
2
4
|
|
3
5
|
module Byebug
|
4
6
|
#
|
5
7
|
# Setting to customize the file where byebug's history is saved.
|
6
8
|
#
|
7
9
|
class HistfileSetting < Setting
|
8
|
-
DEFAULT = File.expand_path(
|
10
|
+
DEFAULT = File.expand_path(".byebug_history")
|
9
11
|
|
10
12
|
def banner
|
11
|
-
|
13
|
+
"File where cmd history is saved to. Default: ./.byebug_history"
|
12
14
|
end
|
13
15
|
|
14
16
|
def to_s
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/setting"
|
2
4
|
|
3
5
|
module Byebug
|
4
6
|
#
|
@@ -8,7 +10,7 @@ module Byebug
|
|
8
10
|
DEFAULT = 256
|
9
11
|
|
10
12
|
def banner
|
11
|
-
|
13
|
+
"Maximum number of commands that can be stored in byebug history"
|
12
14
|
end
|
13
15
|
|
14
16
|
def to_s
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/setting"
|
2
4
|
|
3
5
|
module Byebug
|
4
6
|
#
|
@@ -6,7 +8,7 @@ module Byebug
|
|
6
8
|
#
|
7
9
|
class LinetraceSetting < Setting
|
8
10
|
def banner
|
9
|
-
|
11
|
+
"Enable line execution tracing"
|
10
12
|
end
|
11
13
|
|
12
14
|
def value=(v)
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/setting"
|
2
4
|
|
3
5
|
module Byebug
|
4
6
|
#
|
@@ -9,7 +11,7 @@ module Byebug
|
|
9
11
|
DEFAULT = 10
|
10
12
|
|
11
13
|
def banner
|
12
|
-
|
14
|
+
"Set number of source lines to list by default"
|
13
15
|
end
|
14
16
|
|
15
17
|
def to_s
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/setting"
|
2
4
|
|
3
5
|
module Byebug
|
4
6
|
#
|
@@ -11,7 +13,7 @@ module Byebug
|
|
11
13
|
end
|
12
14
|
|
13
15
|
def banner
|
14
|
-
|
16
|
+
"Enable/disable post-mortem mode"
|
15
17
|
end
|
16
18
|
|
17
19
|
def value=(v)
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/setting"
|
2
4
|
|
3
5
|
module Byebug
|
4
6
|
#
|
@@ -8,7 +10,7 @@ module Byebug
|
|
8
10
|
DEFAULT = File.expand_path("#{ENV['HOME'] || '.'}/.byebug_save")
|
9
11
|
|
10
12
|
def banner
|
11
|
-
|
13
|
+
"File where settings are saved to. Default: ~/.byebug_save"
|
12
14
|
end
|
13
15
|
|
14
16
|
def to_s
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/setting"
|
2
4
|
|
3
5
|
module Byebug
|
4
6
|
#
|
@@ -7,7 +9,7 @@ module Byebug
|
|
7
9
|
#
|
8
10
|
class StackOnErrorSetting < Setting
|
9
11
|
def banner
|
10
|
-
|
12
|
+
"Display stack trace when `eval` raises an exception"
|
11
13
|
end
|
12
14
|
end
|
13
15
|
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/helpers/file"
|
4
|
+
require "byebug/setting"
|
5
|
+
|
6
|
+
module Byebug
|
7
|
+
#
|
8
|
+
# Formats specific line ranges in a source file
|
9
|
+
#
|
10
|
+
class SourceFileFormatter
|
11
|
+
include Helpers::FileHelper
|
12
|
+
|
13
|
+
attr_reader :file, :annotator
|
14
|
+
|
15
|
+
def initialize(file, annotator)
|
16
|
+
@file = file
|
17
|
+
@annotator = annotator
|
18
|
+
end
|
19
|
+
|
20
|
+
def lines(min, max)
|
21
|
+
File.foreach(file).with_index.map do |line, lineno|
|
22
|
+
next unless (min..max).cover?(lineno + 1)
|
23
|
+
|
24
|
+
format(
|
25
|
+
"%<annotation>s %<lineno>#{max.to_s.size}d: %<source>s",
|
26
|
+
annotation: annotator.call(lineno + 1),
|
27
|
+
lineno: lineno + 1,
|
28
|
+
source: line
|
29
|
+
)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def lines_around(center)
|
34
|
+
lines(*range_around(center))
|
35
|
+
end
|
36
|
+
|
37
|
+
def range_around(center)
|
38
|
+
range_from(center - size / 2)
|
39
|
+
end
|
40
|
+
|
41
|
+
def range_from(min)
|
42
|
+
first = amend_initial(min)
|
43
|
+
|
44
|
+
[first, first + size - 1]
|
45
|
+
end
|
46
|
+
|
47
|
+
def amend_initial(line)
|
48
|
+
amend(line, max_initial_line)
|
49
|
+
end
|
50
|
+
|
51
|
+
def amend_final(line)
|
52
|
+
amend(line, max_line)
|
53
|
+
end
|
54
|
+
|
55
|
+
def max_initial_line
|
56
|
+
max_line - size + 1
|
57
|
+
end
|
58
|
+
|
59
|
+
def max_line
|
60
|
+
@max_line ||= n_lines(file)
|
61
|
+
end
|
62
|
+
|
63
|
+
def size
|
64
|
+
[Setting[:listsize], max_line].min
|
65
|
+
end
|
66
|
+
|
67
|
+
def amend(line, ceiling)
|
68
|
+
[ceiling, [1, line].max].min
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
data/lib/byebug/subcommands.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
|
3
|
+
require "forwardable"
|
4
|
+
|
5
|
+
require "byebug/helpers/reflection"
|
6
|
+
require "byebug/command_list"
|
5
7
|
|
6
8
|
module Byebug
|
7
9
|
#
|
@@ -13,7 +15,7 @@ module Byebug
|
|
13
15
|
end
|
14
16
|
|
15
17
|
extend Forwardable
|
16
|
-
def_delegators
|
18
|
+
def_delegators "self.class", :subcommand_list
|
17
19
|
|
18
20
|
#
|
19
21
|
# Delegates to subcommands or prints help if no subcommand specified.
|
data/lib/byebug/version.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: byebug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 10.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Rodriguez
|
8
8
|
- Kent Sibilev
|
9
9
|
- Mark Moseley
|
10
10
|
autorequire:
|
11
|
-
bindir:
|
11
|
+
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2018-01-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -48,7 +48,7 @@ files:
|
|
48
48
|
- GUIDE.md
|
49
49
|
- LICENSE
|
50
50
|
- README.md
|
51
|
-
-
|
51
|
+
- exe/byebug
|
52
52
|
- ext/byebug/breakpoint.c
|
53
53
|
- ext/byebug/byebug.c
|
54
54
|
- ext/byebug/byebug.h
|
@@ -150,6 +150,8 @@ files:
|
|
150
150
|
- lib/byebug/processors/post_mortem_processor.rb
|
151
151
|
- lib/byebug/processors/script_processor.rb
|
152
152
|
- lib/byebug/remote.rb
|
153
|
+
- lib/byebug/remote/client.rb
|
154
|
+
- lib/byebug/remote/server.rb
|
153
155
|
- lib/byebug/runner.rb
|
154
156
|
- lib/byebug/setting.rb
|
155
157
|
- lib/byebug/settings/autoirb.rb
|
@@ -167,6 +169,7 @@ files:
|
|
167
169
|
- lib/byebug/settings/savefile.rb
|
168
170
|
- lib/byebug/settings/stack_on_error.rb
|
169
171
|
- lib/byebug/settings/width.rb
|
172
|
+
- lib/byebug/source_file_formatter.rb
|
170
173
|
- lib/byebug/subcommands.rb
|
171
174
|
- lib/byebug/version.rb
|
172
175
|
homepage: http://github.com/deivid-rodriguez/byebug
|
@@ -189,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
192
|
version: '0'
|
190
193
|
requirements: []
|
191
194
|
rubyforge_project:
|
192
|
-
rubygems_version: 2.
|
195
|
+
rubygems_version: 2.7.4
|
193
196
|
signing_key:
|
194
197
|
specification_version: 4
|
195
198
|
summary: Ruby fast debugger - base + CLI
|