byebug 9.0.5 → 11.1.3
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 +5 -5
- data/CHANGELOG.md +399 -264
- data/CONTRIBUTING.md +12 -19
- data/GUIDE.md +40 -26
- data/LICENSE +18 -18
- data/README.md +103 -74
- data/exe/byebug +6 -0
- data/ext/byebug/breakpoint.c +2 -2
- data/ext/byebug/byebug.c +26 -31
- data/ext/byebug/byebug.h +44 -28
- data/ext/byebug/context.c +45 -32
- data/ext/byebug/extconf.rb +7 -5
- data/ext/byebug/locker.c +4 -4
- data/ext/byebug/threads.c +12 -12
- data/lib/byebug/attacher.rb +18 -4
- data/lib/byebug/breakpoint.rb +26 -6
- data/lib/byebug/command.rb +20 -14
- data/lib/byebug/command_list.rb +3 -1
- data/lib/byebug/commands/break.rb +36 -22
- data/lib/byebug/commands/catch.rb +16 -18
- data/lib/byebug/commands/condition.rb +11 -11
- data/lib/byebug/commands/continue.rb +32 -12
- data/lib/byebug/commands/debug.rb +7 -5
- data/lib/byebug/commands/delete.rb +13 -11
- data/lib/byebug/commands/disable/breakpoints.rb +7 -5
- data/lib/byebug/commands/disable/display.rb +7 -5
- data/lib/byebug/commands/disable.rb +8 -6
- data/lib/byebug/commands/display.rb +11 -9
- data/lib/byebug/commands/down.rb +10 -8
- data/lib/byebug/commands/edit.rb +11 -8
- data/lib/byebug/commands/enable/breakpoints.rb +7 -5
- data/lib/byebug/commands/enable/display.rb +7 -5
- data/lib/byebug/commands/enable.rb +8 -6
- data/lib/byebug/commands/finish.rb +9 -7
- 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/breakpoints.rb +18 -14
- data/lib/byebug/commands/info/display.rb +16 -9
- data/lib/byebug/commands/info/file.rb +13 -14
- data/lib/byebug/commands/info/line.rb +5 -3
- data/lib/byebug/commands/info/program.rb +8 -6
- data/lib/byebug/commands/info.rb +11 -9
- data/lib/byebug/commands/interrupt.rb +8 -4
- data/lib/byebug/commands/irb.rb +13 -12
- data/lib/byebug/commands/kill.rb +11 -11
- 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 -10
- data/lib/byebug/commands/quit.rb +10 -8
- data/lib/byebug/commands/restart.rb +30 -11
- data/lib/byebug/commands/save.rb +10 -8
- data/lib/byebug/commands/set.rb +13 -11
- data/lib/byebug/commands/show.rb +7 -5
- data/lib/byebug/commands/skip.rb +85 -0
- data/lib/byebug/commands/source.rb +7 -7
- data/lib/byebug/commands/step.rb +8 -6
- 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 -7
- data/lib/byebug/commands/thread/stop.rb +6 -4
- data/lib/byebug/commands/thread/switch.rb +6 -4
- data/lib/byebug/commands/thread.rb +11 -9
- data/lib/byebug/commands/tracevar.rb +10 -11
- data/lib/byebug/commands/undisplay.rb +12 -11
- data/lib/byebug/commands/untracevar.rb +8 -6
- data/lib/byebug/commands/up.rb +10 -8
- 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 -9
- 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/var.rb +12 -10
- data/lib/byebug/commands/where.rb +9 -7
- data/lib/byebug/commands.rb +40 -37
- data/lib/byebug/context.rb +7 -5
- data/lib/byebug/core.rb +26 -25
- data/lib/byebug/errors.rb +4 -2
- data/lib/byebug/frame.rb +19 -22
- data/lib/byebug/helpers/bin.rb +47 -0
- data/lib/byebug/helpers/eval.rb +15 -13
- data/lib/byebug/helpers/file.rb +6 -4
- data/lib/byebug/helpers/frame.rb +7 -5
- data/lib/byebug/helpers/parse.rb +5 -5
- data/lib/byebug/helpers/path.rb +9 -11
- data/lib/byebug/helpers/reflection.rb +2 -0
- data/lib/byebug/helpers/string.rb +11 -2
- data/lib/byebug/helpers/thread.rb +10 -8
- data/lib/byebug/helpers/toggle.rb +28 -27
- data/lib/byebug/helpers/var.rb +9 -7
- data/lib/byebug/history.rb +20 -11
- data/lib/byebug/interface.rb +13 -11
- data/lib/byebug/interfaces/local_interface.rb +25 -7
- data/lib/byebug/interfaces/remote_interface.rb +21 -9
- data/lib/byebug/interfaces/script_interface.rb +4 -1
- data/lib/byebug/interfaces/test_interface.rb +5 -3
- data/lib/byebug/option_setter.rb +14 -12
- data/lib/byebug/printers/base.rb +10 -10
- data/lib/byebug/printers/plain.rb +9 -8
- data/lib/byebug/printers/texts/base.yml +7 -3
- data/lib/byebug/printers/texts/plain.yml +1 -1
- 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/client.rb +57 -0
- data/lib/byebug/remote/server.rb +47 -0
- data/lib/byebug/remote.rb +46 -66
- data/lib/byebug/runner.rb +43 -49
- data/lib/byebug/setting.rb +11 -5
- data/lib/byebug/settings/autoirb.rb +7 -5
- data/lib/byebug/settings/autolist.rb +7 -5
- data/lib/byebug/settings/autopry.rb +7 -5
- data/lib/byebug/settings/autosave.rb +4 -2
- data/lib/byebug/settings/basename.rb +4 -2
- data/lib/byebug/settings/callstyle.rb +4 -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 +6 -4
- data/lib/byebug/settings/listsize.rb +4 -2
- data/lib/byebug/settings/post_mortem.rb +6 -4
- 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 +2 -1
- data/lib/byebug.rb +3 -1
- metadata +22 -20
- data/bin/byebug +0 -7
data/lib/byebug/remote.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "socket"
|
4
|
+
require_relative "processors/control_processor"
|
5
|
+
require_relative "remote/server"
|
6
|
+
require_relative "remote/client"
|
3
7
|
|
4
8
|
#
|
5
9
|
# Remote debugging functionality.
|
6
10
|
#
|
7
|
-
# @todo Refactor & add tests
|
8
|
-
#
|
9
11
|
module Byebug
|
10
12
|
# Port number used for remote debugging
|
11
13
|
PORT = 8989 unless defined?(PORT)
|
@@ -15,8 +17,14 @@ module Byebug
|
|
15
17
|
attr_accessor :wait_connection
|
16
18
|
|
17
19
|
# The actual port that the server is started at
|
18
|
-
|
19
|
-
|
20
|
+
def actual_port
|
21
|
+
server.actual_port
|
22
|
+
end
|
23
|
+
|
24
|
+
# The actual port that the control server is started at
|
25
|
+
def actual_control_port
|
26
|
+
control.actual_port
|
27
|
+
end
|
20
28
|
|
21
29
|
#
|
22
30
|
# Interrupts the current thread
|
@@ -26,80 +34,52 @@ module Byebug
|
|
26
34
|
end
|
27
35
|
|
28
36
|
#
|
29
|
-
# Starts
|
37
|
+
# Starts the remote server main thread
|
30
38
|
#
|
31
39
|
def start_server(host = nil, port = PORT)
|
32
|
-
|
33
|
-
|
34
|
-
Context.interface = nil
|
35
|
-
start
|
36
|
-
|
37
|
-
start_control(host, port == 0 ? 0 : port + 1)
|
40
|
+
start_control(host, port.zero? ? 0 : port + 1)
|
38
41
|
|
39
|
-
|
40
|
-
|
41
|
-
mutex = Mutex.new
|
42
|
-
proceed = ConditionVariable.new
|
43
|
-
|
44
|
-
server = TCPServer.new(host, port)
|
45
|
-
self.actual_port = server.addr[1]
|
46
|
-
|
47
|
-
@thread = DebugThread.new do
|
48
|
-
while (session = server.accept)
|
49
|
-
Context.interface = RemoteInterface.new(session)
|
50
|
-
mutex.synchronize { proceed.signal } if wait_connection
|
51
|
-
end
|
52
|
-
end
|
42
|
+
server.start(host, port)
|
43
|
+
end
|
53
44
|
|
54
|
-
|
45
|
+
#
|
46
|
+
# Starts the remote server control thread
|
47
|
+
#
|
48
|
+
def start_control(host = nil, port = PORT + 1)
|
49
|
+
control.start(host, port)
|
55
50
|
end
|
56
51
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
52
|
+
#
|
53
|
+
# Connects to the remote byebug
|
54
|
+
#
|
55
|
+
def start_client(host = "localhost", port = PORT)
|
56
|
+
client.start(host, port)
|
57
|
+
end
|
61
58
|
|
62
|
-
|
63
|
-
|
64
|
-
|
59
|
+
def parse_host_and_port(host_port_spec)
|
60
|
+
location = host_port_spec.split(":")
|
61
|
+
location[1] ? [location[0], location[1].to_i] : ["localhost", location[0]]
|
62
|
+
end
|
65
63
|
|
66
|
-
|
67
|
-
end
|
68
|
-
end
|
64
|
+
private
|
69
65
|
|
70
|
-
|
66
|
+
def client
|
67
|
+
@client ||= Remote::Client.new(Context.interface)
|
71
68
|
end
|
72
69
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
def start_client(host = 'localhost', port = PORT)
|
77
|
-
interface = LocalInterface.new
|
78
|
-
puts 'Connecting to byebug server...'
|
79
|
-
socket = TCPSocket.new(host, port)
|
80
|
-
puts 'Connected.'
|
81
|
-
|
82
|
-
while (line = socket.gets)
|
83
|
-
case line
|
84
|
-
when /^PROMPT (.*)$/
|
85
|
-
input = interface.read_command(Regexp.last_match[1])
|
86
|
-
break unless input
|
87
|
-
socket.puts input
|
88
|
-
when /^CONFIRM (.*)$/
|
89
|
-
input = interface.readline(Regexp.last_match[1])
|
90
|
-
break unless input
|
91
|
-
socket.puts input
|
92
|
-
else
|
93
|
-
puts line
|
94
|
-
end
|
70
|
+
def server
|
71
|
+
@server ||= Remote::Server.new(wait_connection: wait_connection) do |s|
|
72
|
+
Context.interface = RemoteInterface.new(s)
|
95
73
|
end
|
96
|
-
|
97
|
-
socket.close
|
98
74
|
end
|
99
75
|
|
100
|
-
def
|
101
|
-
|
102
|
-
|
76
|
+
def control
|
77
|
+
@control ||= Remote::Server.new(wait_connection: false) do |s|
|
78
|
+
context = Byebug.current_context
|
79
|
+
interface = RemoteInterface.new(s)
|
80
|
+
|
81
|
+
ControlProcessor.new(context, interface).process_commands
|
82
|
+
end
|
103
83
|
end
|
104
84
|
end
|
105
85
|
end
|
data/lib/byebug/runner.rb
CHANGED
@@ -1,17 +1,23 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require
|
4
|
-
require
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "optparse"
|
4
|
+
require "English"
|
5
|
+
require_relative "core"
|
6
|
+
require_relative "version"
|
7
|
+
require_relative "helpers/bin"
|
8
|
+
require_relative "helpers/parse"
|
9
|
+
require_relative "helpers/string"
|
10
|
+
require_relative "option_setter"
|
11
|
+
require_relative "processors/control_processor"
|
8
12
|
|
9
13
|
module Byebug
|
10
14
|
#
|
11
15
|
# Responsible for starting the debugger when started from the command line.
|
12
16
|
#
|
13
17
|
class Runner
|
18
|
+
include Helpers::BinHelper
|
14
19
|
include Helpers::ParseHelper
|
20
|
+
include Helpers::StringHelper
|
15
21
|
|
16
22
|
#
|
17
23
|
# Special working modes that don't actually start the debugger.
|
@@ -54,7 +60,9 @@ module Byebug
|
|
54
60
|
def version=(number)
|
55
61
|
@version ||= number
|
56
62
|
|
57
|
-
interface.puts
|
63
|
+
interface.puts prettify <<-VERSION
|
64
|
+
Running byebug #{number}
|
65
|
+
VERSION
|
58
66
|
end
|
59
67
|
|
60
68
|
def remote=(host_and_port)
|
@@ -71,22 +79,24 @@ module Byebug
|
|
71
79
|
# Usage banner.
|
72
80
|
#
|
73
81
|
def banner
|
74
|
-
<<-
|
75
|
-
|
82
|
+
prettify <<-BANNER
|
76
83
|
byebug #{Byebug::VERSION}
|
77
84
|
|
78
85
|
Usage: byebug [options] <script.rb> -- <script.rb parameters>
|
79
|
-
|
80
|
-
EOB
|
86
|
+
BANNER
|
81
87
|
end
|
82
88
|
|
83
89
|
#
|
84
90
|
# Starts byebug to debug a program.
|
85
91
|
#
|
86
92
|
def run
|
93
|
+
Byebug.mode = :standalone
|
94
|
+
|
87
95
|
option_parser.order!($ARGV)
|
88
96
|
return if non_script_option? || error_in_script?
|
89
97
|
|
98
|
+
$PROGRAM_NAME = program
|
99
|
+
|
90
100
|
Byebug.run_init_script if init_script
|
91
101
|
|
92
102
|
loop do
|
@@ -94,14 +104,12 @@ module Byebug
|
|
94
104
|
|
95
105
|
break if quit
|
96
106
|
|
97
|
-
ControlProcessor.new.process_commands
|
107
|
+
ControlProcessor.new(nil, interface).process_commands
|
98
108
|
end
|
99
109
|
end
|
100
110
|
|
101
|
-
attr_writer :interface
|
102
|
-
|
103
111
|
def interface
|
104
|
-
@interface ||=
|
112
|
+
@interface ||= Context.interface
|
105
113
|
end
|
106
114
|
|
107
115
|
#
|
@@ -115,6 +123,18 @@ module Byebug
|
|
115
123
|
end
|
116
124
|
end
|
117
125
|
|
126
|
+
def program
|
127
|
+
@program ||= begin
|
128
|
+
candidate = which($ARGV.shift)
|
129
|
+
|
130
|
+
if [which("ruby"), RbConfig.ruby].include?(candidate)
|
131
|
+
which($ARGV.shift)
|
132
|
+
else
|
133
|
+
candidate
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
118
138
|
#
|
119
139
|
# An option that doesn't need a script specified was given
|
120
140
|
#
|
@@ -135,7 +155,7 @@ module Byebug
|
|
135
155
|
def no_script?
|
136
156
|
return false unless $ARGV.empty?
|
137
157
|
|
138
|
-
print_error(
|
158
|
+
print_error("You must specify a program to debug")
|
139
159
|
true
|
140
160
|
end
|
141
161
|
|
@@ -143,27 +163,19 @@ module Byebug
|
|
143
163
|
# Extracts debugged program from command line args.
|
144
164
|
#
|
145
165
|
def non_existing_script?
|
146
|
-
|
166
|
+
return false if program
|
147
167
|
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
if program
|
152
|
-
$PROGRAM_NAME = program
|
153
|
-
false
|
154
|
-
else
|
155
|
-
print_error("The script doesn't exist")
|
156
|
-
true
|
157
|
-
end
|
168
|
+
print_error("The script doesn't exist")
|
169
|
+
true
|
158
170
|
end
|
159
171
|
|
160
172
|
#
|
161
173
|
# Checks the debugged script has correct syntax
|
162
174
|
#
|
163
175
|
def invalid_script?
|
164
|
-
return false if syntax_valid?(File.read(
|
176
|
+
return false if syntax_valid?(File.read(program))
|
165
177
|
|
166
|
-
print_error(
|
178
|
+
print_error("The script has incorrect syntax")
|
167
179
|
true
|
168
180
|
end
|
169
181
|
|
@@ -171,28 +183,10 @@ module Byebug
|
|
171
183
|
# Debugs a script only if syntax checks okay.
|
172
184
|
#
|
173
185
|
def debug_program
|
174
|
-
error = Byebug.debug_load(
|
186
|
+
error = Byebug.debug_load(program, stop)
|
175
187
|
puts "#{error}\n#{error.backtrace}" if error
|
176
188
|
end
|
177
189
|
|
178
|
-
#
|
179
|
-
# Cross-platform way of finding an executable in the $PATH.
|
180
|
-
# Borrowed from: http://stackoverflow.com/questions/2108727
|
181
|
-
#
|
182
|
-
def which(cmd)
|
183
|
-
return File.expand_path(cmd) if File.exist?(cmd)
|
184
|
-
|
185
|
-
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
|
186
|
-
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
|
187
|
-
exts.each do |ext|
|
188
|
-
exe = File.join(path, "#{cmd}#{ext}")
|
189
|
-
return exe if File.executable?(exe) && !File.directory?(exe)
|
190
|
-
end
|
191
|
-
end
|
192
|
-
|
193
|
-
nil
|
194
|
-
end
|
195
|
-
|
196
190
|
#
|
197
191
|
# Prints an error message and a help string
|
198
192
|
#
|
data/lib/byebug/setting.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "helpers/string"
|
2
4
|
|
3
5
|
module Byebug
|
4
6
|
#
|
@@ -28,7 +30,7 @@ module Byebug
|
|
28
30
|
end
|
29
31
|
|
30
32
|
def to_sym
|
31
|
-
name = self.class.name.gsub(/^Byebug::/,
|
33
|
+
name = self.class.name.gsub(/^Byebug::/, "").gsub(/Setting$/, "")
|
32
34
|
name.gsub(/(.)([A-Z])/, '\1_\2').downcase.to_sym
|
33
35
|
end
|
34
36
|
|
@@ -50,7 +52,7 @@ module Byebug
|
|
50
52
|
end
|
51
53
|
|
52
54
|
def find(shortcut)
|
53
|
-
abbr =
|
55
|
+
abbr = /^no/.match?(shortcut) ? shortcut[2..-1] : shortcut
|
54
56
|
matches = settings.select do |key, value|
|
55
57
|
key =~ (value.boolean? ? /#{abbr}/ : /#{shortcut}/)
|
56
58
|
end
|
@@ -63,8 +65,12 @@ module Byebug
|
|
63
65
|
def help_all
|
64
66
|
output = " List of supported settings:\n\n"
|
65
67
|
width = settings.keys.max_by(&:size).size
|
66
|
-
settings.
|
67
|
-
output
|
68
|
+
settings.each_value do |sett|
|
69
|
+
output += format(
|
70
|
+
" %<name>-#{width}s -- %<description>s\n",
|
71
|
+
name: sett.to_sym,
|
72
|
+
description: sett.banner
|
73
|
+
)
|
68
74
|
end
|
69
75
|
output + "\n"
|
70
76
|
end
|
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../setting"
|
4
|
+
require_relative "../commands/irb"
|
3
5
|
|
4
6
|
module Byebug
|
5
7
|
#
|
@@ -13,11 +15,11 @@ module Byebug
|
|
13
15
|
end
|
14
16
|
|
15
17
|
def banner
|
16
|
-
|
18
|
+
"Invoke IRB on every stop"
|
17
19
|
end
|
18
20
|
|
19
|
-
def value=(
|
20
|
-
IrbCommand.always_run =
|
21
|
+
def value=(val)
|
22
|
+
IrbCommand.always_run = val ? 1 : 0
|
21
23
|
end
|
22
24
|
|
23
25
|
def value
|
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../setting"
|
4
|
+
require_relative "../commands/list"
|
3
5
|
|
4
6
|
module Byebug
|
5
7
|
#
|
@@ -13,11 +15,11 @@ 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
|
-
def value=(
|
20
|
-
ListCommand.always_run =
|
21
|
+
def value=(val)
|
22
|
+
ListCommand.always_run = val ? 1 : 0
|
21
23
|
end
|
22
24
|
|
23
25
|
def value
|
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../setting"
|
4
|
+
require_relative "../commands/pry"
|
3
5
|
|
4
6
|
module Byebug
|
5
7
|
#
|
@@ -13,11 +15,11 @@ module Byebug
|
|
13
15
|
end
|
14
16
|
|
15
17
|
def banner
|
16
|
-
|
18
|
+
"Invoke Pry on every stop"
|
17
19
|
end
|
18
20
|
|
19
|
-
def value=(
|
20
|
-
PryCommand.always_run =
|
21
|
+
def value=(val)
|
22
|
+
PryCommand.always_run = val ? 1 : 0
|
21
23
|
end
|
22
24
|
|
23
25
|
def value
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../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_relative "../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,15 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
|
3
|
+
require_relative "../setting"
|
3
4
|
|
4
5
|
module Byebug
|
5
6
|
#
|
6
7
|
# Setting to customize the verbosity level for stack frames.
|
7
8
|
#
|
8
9
|
class CallstyleSetting < Setting
|
9
|
-
DEFAULT =
|
10
|
+
DEFAULT = "long"
|
10
11
|
|
11
12
|
def banner
|
12
|
-
|
13
|
+
"Set how you want method call parameters to be displayed"
|
13
14
|
end
|
14
15
|
|
15
16
|
def to_s
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../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_relative "../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_relative "../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_relative "../setting"
|
2
4
|
|
3
5
|
module Byebug
|
4
6
|
#
|
@@ -6,11 +8,11 @@ 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
|
-
def value=(
|
13
|
-
Byebug.tracing =
|
14
|
+
def value=(val)
|
15
|
+
Byebug.tracing = val
|
14
16
|
end
|
15
17
|
|
16
18
|
def value
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../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_relative "../setting"
|
2
4
|
|
3
5
|
module Byebug
|
4
6
|
#
|
@@ -11,11 +13,11 @@ module Byebug
|
|
11
13
|
end
|
12
14
|
|
13
15
|
def banner
|
14
|
-
|
16
|
+
"Enable/disable post-mortem mode"
|
15
17
|
end
|
16
18
|
|
17
|
-
def value=(
|
18
|
-
Byebug.post_mortem =
|
19
|
+
def value=(val)
|
20
|
+
Byebug.post_mortem = val
|
19
21
|
end
|
20
22
|
|
21
23
|
def value
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../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_relative "../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
|