byebug 9.1.0 → 10.0.0
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 +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,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/command"
|
2
4
|
|
3
5
|
module Byebug
|
4
6
|
#
|
@@ -12,18 +14,20 @@ module Byebug
|
|
12
14
|
end
|
13
15
|
|
14
16
|
def self.description
|
15
|
-
<<-
|
17
|
+
<<-DESCRIPTION
|
16
18
|
int[errupt]
|
17
19
|
|
18
20
|
#{short_description}
|
19
|
-
|
21
|
+
DESCRIPTION
|
20
22
|
end
|
21
23
|
|
22
24
|
def self.short_description
|
23
|
-
|
25
|
+
"Interrupts the program"
|
24
26
|
end
|
25
27
|
|
26
28
|
def execute
|
29
|
+
Byebug.start
|
30
|
+
|
27
31
|
Byebug.thread_context(Thread.main).interrupt
|
28
32
|
end
|
29
33
|
end
|
data/lib/byebug/commands/irb.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/command"
|
4
|
+
require "irb"
|
5
|
+
require "English"
|
4
6
|
|
5
7
|
module Byebug
|
6
8
|
#
|
@@ -14,20 +16,20 @@ module Byebug
|
|
14
16
|
end
|
15
17
|
|
16
18
|
def self.description
|
17
|
-
<<-
|
19
|
+
<<-DESCRIPTION
|
18
20
|
irb
|
19
21
|
|
20
22
|
#{short_description}
|
21
|
-
|
23
|
+
DESCRIPTION
|
22
24
|
end
|
23
25
|
|
24
26
|
def self.short_description
|
25
|
-
|
27
|
+
"Starts an IRB session"
|
26
28
|
end
|
27
29
|
|
28
30
|
def execute
|
29
31
|
unless processor.interface.instance_of?(LocalInterface)
|
30
|
-
return errmsg(pr(
|
32
|
+
return errmsg(pr("base.errors.only_local"))
|
31
33
|
end
|
32
34
|
|
33
35
|
# @todo IRB tries to parse $ARGV so we must clear it (see #197). Add a
|
data/lib/byebug/commands/kill.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/command"
|
2
4
|
|
3
5
|
module Byebug
|
4
6
|
#
|
@@ -12,17 +14,17 @@ module Byebug
|
|
12
14
|
end
|
13
15
|
|
14
16
|
def self.description
|
15
|
-
<<-
|
17
|
+
<<-DESCRIPTION
|
16
18
|
kill[ signal]
|
17
19
|
|
18
20
|
#{short_description}
|
19
21
|
|
20
22
|
Equivalent of Process.kill(Process.pid)
|
21
|
-
|
23
|
+
DESCRIPTION
|
22
24
|
end
|
23
25
|
|
24
26
|
def self.short_description
|
25
|
-
|
27
|
+
"Sends a signal to the current process"
|
26
28
|
end
|
27
29
|
|
28
30
|
def execute
|
@@ -33,12 +35,12 @@ module Byebug
|
|
33
35
|
return errmsg("signal name #{signame} is not a signal I know about\n")
|
34
36
|
end
|
35
37
|
else
|
36
|
-
return unless confirm(
|
38
|
+
return unless confirm("Really kill? (y/n) ")
|
37
39
|
|
38
|
-
signame =
|
40
|
+
signame = "KILL"
|
39
41
|
end
|
40
42
|
|
41
|
-
processor.interface.close if signame ==
|
43
|
+
processor.interface.close if signame == "KILL"
|
42
44
|
Process.kill(signame, Process.pid)
|
43
45
|
end
|
44
46
|
end
|
data/lib/byebug/commands/list.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/command"
|
4
|
+
require "byebug/source_file_formatter"
|
5
|
+
require "byebug/helpers/file"
|
6
|
+
require "byebug/helpers/parse"
|
4
7
|
|
5
8
|
module Byebug
|
6
9
|
#
|
@@ -17,7 +20,7 @@ module Byebug
|
|
17
20
|
end
|
18
21
|
|
19
22
|
def self.description
|
20
|
-
<<-
|
23
|
+
<<-DESCRIPTION
|
21
24
|
l[ist][[-=]][ nn-mm]
|
22
25
|
|
23
26
|
#{short_description}
|
@@ -27,20 +30,18 @@ module Byebug
|
|
27
30
|
"list=" is specified, lists from current line regardless of where code
|
28
31
|
was last listed. A line range can also be specified to list specific
|
29
32
|
sections of code.
|
30
|
-
|
33
|
+
DESCRIPTION
|
31
34
|
end
|
32
35
|
|
33
36
|
def self.short_description
|
34
|
-
|
37
|
+
"Lists lines of source code"
|
35
38
|
end
|
36
39
|
|
37
40
|
def execute
|
38
41
|
msg = "No sourcefile available for #{frame.file}"
|
39
42
|
raise(msg) unless File.exist?(frame.file)
|
40
43
|
|
41
|
-
|
42
|
-
b, e = range(@match[2], max_lines)
|
43
|
-
raise('Invalid line range') unless valid_range?(b, e, max_lines)
|
44
|
+
b, e = range(@match[2])
|
44
45
|
|
45
46
|
display_lines(b, e)
|
46
47
|
|
@@ -56,42 +57,44 @@ module Byebug
|
|
56
57
|
#
|
57
58
|
# Otherwise it's automatically chosen.
|
58
59
|
#
|
59
|
-
def range(input
|
60
|
-
|
60
|
+
def range(input)
|
61
|
+
return auto_range(@match[1] || "+") unless input
|
61
62
|
|
62
|
-
|
63
|
+
b, e = parse_range(input)
|
64
|
+
raise("Invalid line range") unless valid_range?(b, e)
|
63
65
|
|
64
|
-
|
66
|
+
[b, e]
|
65
67
|
end
|
66
68
|
|
67
|
-
def valid_range?(first, last
|
68
|
-
first <= last && (1..
|
69
|
+
def valid_range?(first, last)
|
70
|
+
first <= last && (1..max_line).cover?(first) && (1..max_line).cover?(last)
|
69
71
|
end
|
70
72
|
|
71
73
|
#
|
72
74
|
# Set line range to be printed by list
|
73
75
|
#
|
74
|
-
# @param size - number of lines to be printed
|
75
|
-
# @param max_line - max line number that can be printed
|
76
|
-
#
|
77
76
|
# @return first line number to list
|
78
77
|
# @return last line number to list
|
79
78
|
#
|
80
|
-
def
|
81
|
-
|
79
|
+
def auto_range(direction)
|
80
|
+
prev_line = processor.prev_line
|
82
81
|
|
83
|
-
|
82
|
+
if direction == "=" || prev_line.nil?
|
83
|
+
source_file_formatter.range_around(frame.line)
|
84
|
+
else
|
85
|
+
source_file_formatter.range_from(move(prev_line, size, direction))
|
86
|
+
end
|
84
87
|
end
|
85
88
|
|
86
|
-
def parse_range(input
|
87
|
-
first, err = get_int(lower_bound(input),
|
89
|
+
def parse_range(input)
|
90
|
+
first, err = get_int(lower_bound(input), "List", 1, max_line)
|
88
91
|
raise(err) unless first
|
89
92
|
|
90
93
|
if upper_bound(input)
|
91
|
-
last, err = get_int(upper_bound(input),
|
94
|
+
last, err = get_int(upper_bound(input), "List", 1, max_line)
|
92
95
|
raise(err) unless last
|
93
96
|
|
94
|
-
last =
|
97
|
+
last = amend_final(last)
|
95
98
|
else
|
96
99
|
first -= (size / 2)
|
97
100
|
end
|
@@ -99,20 +102,7 @@ module Byebug
|
|
99
102
|
[first, last || move(first, size - 1)]
|
100
103
|
end
|
101
104
|
|
102
|
-
def
|
103
|
-
return 1 if line < 1
|
104
|
-
|
105
|
-
[max_line, line].min
|
106
|
-
end
|
107
|
-
|
108
|
-
def lower(size, direction = '+')
|
109
|
-
prev_line = processor.prev_line
|
110
|
-
return frame.line - size / 2 if direction == '=' || prev_line.nil?
|
111
|
-
|
112
|
-
move(prev_line, size, direction)
|
113
|
-
end
|
114
|
-
|
115
|
-
def move(line, size, direction = '+')
|
105
|
+
def move(line, size, direction = "+")
|
116
106
|
line.send(direction, size)
|
117
107
|
end
|
118
108
|
|
@@ -125,13 +115,7 @@ module Byebug
|
|
125
115
|
def display_lines(min, max)
|
126
116
|
puts "\n[#{min}, #{max}] in #{frame.file}"
|
127
117
|
|
128
|
-
|
129
|
-
break if lineno + 1 > max
|
130
|
-
next unless (min..max).cover?(lineno + 1)
|
131
|
-
|
132
|
-
mark = lineno + 1 == frame.line ? '=> ' : ' '
|
133
|
-
puts format("#{mark}%#{max.to_s.size}d: %s", lineno + 1, line)
|
134
|
-
end
|
118
|
+
puts source_file_formatter.lines(min, max).join
|
135
119
|
end
|
136
120
|
|
137
121
|
#
|
@@ -160,5 +144,16 @@ module Byebug
|
|
160
144
|
def split_range(str)
|
161
145
|
str.split(/[-,]/)
|
162
146
|
end
|
147
|
+
|
148
|
+
extend Forwardable
|
149
|
+
|
150
|
+
def_delegators :source_file_formatter, :amend_final, :size, :max_line
|
151
|
+
|
152
|
+
def source_file_formatter
|
153
|
+
@source_file_formatter ||= SourceFileFormatter.new(
|
154
|
+
frame.file,
|
155
|
+
->(n) { n == frame.line ? "=>" : " " }
|
156
|
+
)
|
157
|
+
end
|
163
158
|
end
|
164
159
|
end
|
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/command"
|
4
|
+
require "byebug/helpers/eval"
|
3
5
|
|
4
6
|
module Byebug
|
5
7
|
#
|
@@ -15,7 +17,7 @@ module Byebug
|
|
15
17
|
end
|
16
18
|
|
17
19
|
def self.description
|
18
|
-
<<-
|
20
|
+
<<-DESCRIPTION
|
19
21
|
m[ethod] (i[nstance][ <obj>]|<class|module>)
|
20
22
|
|
21
23
|
#{short_description}
|
@@ -25,11 +27,11 @@ module Byebug
|
|
25
27
|
|
26
28
|
When invoked only with a class or module, shows class methods of the
|
27
29
|
class or module specified as argument.
|
28
|
-
|
30
|
+
DESCRIPTION
|
29
31
|
end
|
30
32
|
|
31
33
|
def self.short_description
|
32
|
-
|
34
|
+
"Shows methods of an object, class or module"
|
33
35
|
end
|
34
36
|
|
35
37
|
def execute
|
@@ -37,11 +39,11 @@ module Byebug
|
|
37
39
|
|
38
40
|
result =
|
39
41
|
if @match[1]
|
40
|
-
prc(
|
42
|
+
prc("method.methods", obj.methods.sort) { |item, _| { name: item } }
|
41
43
|
elsif !obj.is_a?(Module)
|
42
|
-
pr(
|
44
|
+
pr("variable.errors.not_module", object: @match.post_match)
|
43
45
|
else
|
44
|
-
prc(
|
46
|
+
prc("method.methods", obj.instance_methods(false).sort) do |item, _|
|
45
47
|
{ name: item }
|
46
48
|
end
|
47
49
|
end
|
data/lib/byebug/commands/next.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/command"
|
4
|
+
require "byebug/helpers/parse"
|
3
5
|
|
4
6
|
module Byebug
|
5
7
|
#
|
@@ -16,19 +18,19 @@ module Byebug
|
|
16
18
|
end
|
17
19
|
|
18
20
|
def self.description
|
19
|
-
<<-
|
21
|
+
<<-DESCRIPTION
|
20
22
|
n[ext][ nnn]
|
21
23
|
|
22
24
|
#{short_description}
|
23
|
-
|
25
|
+
DESCRIPTION
|
24
26
|
end
|
25
27
|
|
26
28
|
def self.short_description
|
27
|
-
|
29
|
+
"Runs one or more lines of code"
|
28
30
|
end
|
29
31
|
|
30
32
|
def execute
|
31
|
-
steps, err = parse_steps(@match[1],
|
33
|
+
steps, err = parse_steps(@match[1], "Next")
|
32
34
|
return errmsg(err) unless steps
|
33
35
|
|
34
36
|
context.step_over(steps, context.frame.pos)
|
data/lib/byebug/commands/pry.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/command"
|
4
|
+
require "byebug/helpers/eval"
|
3
5
|
|
4
6
|
module Byebug
|
5
7
|
#
|
@@ -13,26 +15,26 @@ module Byebug
|
|
13
15
|
end
|
14
16
|
|
15
17
|
def self.description
|
16
|
-
<<-
|
18
|
+
<<-DESCRIPTION
|
17
19
|
pry
|
18
20
|
|
19
21
|
#{short_description}
|
20
|
-
|
22
|
+
DESCRIPTION
|
21
23
|
end
|
22
24
|
|
23
25
|
def self.short_description
|
24
|
-
|
26
|
+
"Starts a Pry session"
|
25
27
|
end
|
26
28
|
|
27
29
|
def execute
|
28
30
|
unless processor.interface.instance_of?(LocalInterface)
|
29
|
-
return errmsg(pr(
|
31
|
+
return errmsg(pr("base.errors.only_local"))
|
30
32
|
end
|
31
33
|
|
32
34
|
begin
|
33
|
-
require
|
35
|
+
require "pry"
|
34
36
|
rescue LoadError
|
35
|
-
return errmsg(pr(
|
37
|
+
return errmsg(pr("pry.errors.not_installed"))
|
36
38
|
end
|
37
39
|
|
38
40
|
Pry.start(context.frame._binding)
|
data/lib/byebug/commands/quit.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/command"
|
2
4
|
|
3
5
|
module Byebug
|
4
6
|
#
|
@@ -13,7 +15,7 @@ module Byebug
|
|
13
15
|
end
|
14
16
|
|
15
17
|
def self.description
|
16
|
-
<<-
|
18
|
+
<<-DESCRIPTION
|
17
19
|
q[uit] [!|unconditionally]
|
18
20
|
|
19
21
|
#{short_description}
|
@@ -21,15 +23,15 @@ module Byebug
|
|
21
23
|
Normally we prompt before exiting. However if the parameter
|
22
24
|
"unconditionally" is given or command is suffixed with !, we exit
|
23
25
|
without asking further questions.
|
24
|
-
|
26
|
+
DESCRIPTION
|
25
27
|
end
|
26
28
|
|
27
29
|
def self.short_description
|
28
|
-
|
30
|
+
"Exits byebug"
|
29
31
|
end
|
30
32
|
|
31
33
|
def execute
|
32
|
-
return unless @match[1] || confirm(pr(
|
34
|
+
return unless @match[1] || confirm(pr("quit.confirmations.really"))
|
33
35
|
|
34
36
|
processor.interface.autosave
|
35
37
|
processor.interface.close
|
@@ -1,9 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "byebug/command"
|
4
|
+
require "byebug/helpers/bin"
|
5
|
+
require "byebug/helpers/path"
|
6
|
+
require "shellwords"
|
7
|
+
require "English"
|
8
|
+
require "rbconfig"
|
7
9
|
|
8
10
|
module Byebug
|
9
11
|
#
|
@@ -21,18 +23,18 @@ module Byebug
|
|
21
23
|
end
|
22
24
|
|
23
25
|
def self.description
|
24
|
-
<<-
|
26
|
+
<<-DESCRIPTION
|
25
27
|
restart [args]
|
26
28
|
|
27
29
|
#{short_description}
|
28
30
|
|
29
31
|
This is a re-exec - all byebug state is lost. If command arguments are
|
30
32
|
passed those are used.
|
31
|
-
|
33
|
+
DESCRIPTION
|
32
34
|
end
|
33
35
|
|
34
36
|
def self.short_description
|
35
|
-
|
37
|
+
"Restarts the debugged program"
|
36
38
|
end
|
37
39
|
|
38
40
|
def execute
|
@@ -43,7 +45,7 @@ module Byebug
|
|
43
45
|
|
44
46
|
cmd += (@match[:args] ? @match[:args].shellsplit : $ARGV)
|
45
47
|
|
46
|
-
puts pr(
|
48
|
+
puts pr("restart.success", cmd: cmd.shelljoin)
|
47
49
|
Kernel.exec(*cmd)
|
48
50
|
end
|
49
51
|
|
@@ -55,7 +57,7 @@ module Byebug
|
|
55
57
|
end
|
56
58
|
|
57
59
|
def prepend_ruby_bin(cmd)
|
58
|
-
cmd.unshift(RbConfig.ruby) if which(
|
60
|
+
cmd.unshift(RbConfig.ruby) if which("ruby") != which(cmd.first)
|
59
61
|
cmd
|
60
62
|
end
|
61
63
|
end
|