byebug 10.0.0 → 11.1.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 +4 -4
- data/CHANGELOG.md +350 -284
- data/CONTRIBUTING.md +6 -34
- data/GUIDE.md +9 -8
- data/LICENSE +18 -18
- data/README.md +83 -70
- data/exe/byebug +1 -1
- data/ext/byebug/breakpoint.c +1 -1
- data/ext/byebug/byebug.c +10 -15
- data/ext/byebug/byebug.h +11 -9
- data/ext/byebug/context.c +21 -8
- data/ext/byebug/locker.c +4 -4
- data/ext/byebug/threads.c +4 -4
- data/lib/byebug.rb +1 -1
- data/lib/byebug/attacher.rb +4 -4
- data/lib/byebug/command.rb +2 -2
- data/lib/byebug/command_list.rb +1 -1
- data/lib/byebug/commands.rb +38 -37
- data/lib/byebug/commands/break.rb +10 -14
- data/lib/byebug/commands/catch.rb +4 -8
- data/lib/byebug/commands/condition.rb +3 -5
- data/lib/byebug/commands/continue.rb +27 -9
- data/lib/byebug/commands/debug.rb +2 -2
- data/lib/byebug/commands/delete.rb +3 -5
- data/lib/byebug/commands/disable.rb +4 -4
- data/lib/byebug/commands/disable/breakpoints.rb +1 -1
- data/lib/byebug/commands/disable/display.rb +1 -1
- data/lib/byebug/commands/display.rb +2 -2
- data/lib/byebug/commands/down.rb +3 -3
- data/lib/byebug/commands/edit.rb +2 -1
- data/lib/byebug/commands/enable.rb +3 -3
- data/lib/byebug/commands/enable/breakpoints.rb +1 -1
- data/lib/byebug/commands/enable/display.rb +1 -1
- data/lib/byebug/commands/finish.rb +2 -2
- data/lib/byebug/commands/frame.rb +3 -3
- data/lib/byebug/commands/help.rb +2 -2
- data/lib/byebug/commands/history.rb +2 -2
- data/lib/byebug/commands/info.rb +6 -6
- data/lib/byebug/commands/info/breakpoints.rb +2 -4
- data/lib/byebug/commands/info/display.rb +1 -3
- data/lib/byebug/commands/info/file.rb +2 -4
- data/lib/byebug/commands/interrupt.rb +1 -1
- data/lib/byebug/commands/irb.rb +2 -4
- data/lib/byebug/commands/kill.rb +3 -5
- data/lib/byebug/commands/list.rb +4 -4
- data/lib/byebug/commands/method.rb +2 -2
- data/lib/byebug/commands/next.rb +2 -2
- data/lib/byebug/commands/pry.rb +3 -5
- data/lib/byebug/commands/quit.rb +4 -4
- data/lib/byebug/commands/restart.rb +3 -3
- data/lib/byebug/commands/save.rb +1 -1
- data/lib/byebug/commands/set.rb +3 -3
- data/lib/byebug/commands/show.rb +1 -1
- data/lib/byebug/commands/skip.rb +85 -0
- data/lib/byebug/commands/source.rb +2 -4
- data/lib/byebug/commands/step.rb +2 -2
- data/lib/byebug/commands/thread.rb +6 -6
- data/lib/byebug/commands/thread/current.rb +1 -1
- data/lib/byebug/commands/thread/list.rb +1 -1
- data/lib/byebug/commands/thread/resume.rb +2 -4
- data/lib/byebug/commands/thread/stop.rb +1 -1
- data/lib/byebug/commands/thread/switch.rb +1 -1
- data/lib/byebug/commands/tracevar.rb +2 -5
- data/lib/byebug/commands/undisplay.rb +5 -6
- data/lib/byebug/commands/untracevar.rb +1 -1
- data/lib/byebug/commands/up.rb +3 -3
- data/lib/byebug/commands/var.rb +8 -8
- data/lib/byebug/commands/var/all.rb +1 -1
- data/lib/byebug/commands/var/args.rb +1 -1
- data/lib/byebug/commands/var/const.rb +2 -4
- data/lib/byebug/commands/var/instance.rb +1 -1
- data/lib/byebug/commands/var/local.rb +1 -1
- data/lib/byebug/commands/where.rb +2 -2
- data/lib/byebug/context.rb +4 -4
- data/lib/byebug/core.rb +11 -10
- data/lib/byebug/frame.rb +2 -2
- data/lib/byebug/helpers/bin.rb +2 -2
- data/lib/byebug/helpers/eval.rb +7 -7
- data/lib/byebug/helpers/frame.rb +3 -3
- data/lib/byebug/helpers/parse.rb +1 -3
- data/lib/byebug/helpers/string.rb +0 -3
- data/lib/byebug/helpers/toggle.rb +2 -4
- data/lib/byebug/helpers/var.rb +1 -1
- data/lib/byebug/history.rb +5 -5
- data/lib/byebug/interface.rb +6 -6
- data/lib/byebug/interfaces/local_interface.rb +1 -1
- data/lib/byebug/interfaces/remote_interface.rb +1 -1
- data/lib/byebug/interfaces/script_interface.rb +2 -1
- data/lib/byebug/printers/base.rb +4 -5
- data/lib/byebug/printers/plain.rb +2 -2
- data/lib/byebug/processors/command_processor.rb +2 -2
- data/lib/byebug/processors/control_processor.rb +1 -1
- data/lib/byebug/processors/post_mortem_processor.rb +1 -1
- data/lib/byebug/processors/script_processor.rb +1 -1
- data/lib/byebug/remote.rb +3 -3
- data/lib/byebug/remote/client.rb +2 -0
- data/lib/byebug/runner.rb +7 -7
- data/lib/byebug/setting.rb +2 -2
- data/lib/byebug/settings/autoirb.rb +4 -4
- data/lib/byebug/settings/autolist.rb +4 -4
- data/lib/byebug/settings/autopry.rb +4 -4
- data/lib/byebug/settings/autosave.rb +1 -1
- data/lib/byebug/settings/basename.rb +1 -1
- data/lib/byebug/settings/callstyle.rb +2 -2
- data/lib/byebug/settings/fullpath.rb +1 -1
- data/lib/byebug/settings/histfile.rb +1 -1
- data/lib/byebug/settings/histsize.rb +1 -1
- data/lib/byebug/settings/linetrace.rb +3 -3
- data/lib/byebug/settings/listsize.rb +1 -1
- data/lib/byebug/settings/post_mortem.rb +3 -3
- data/lib/byebug/settings/savefile.rb +1 -1
- data/lib/byebug/settings/stack_on_error.rb +1 -1
- data/lib/byebug/settings/width.rb +1 -1
- data/lib/byebug/source_file_formatter.rb +2 -2
- data/lib/byebug/subcommands.rb +2 -2
- data/lib/byebug/version.rb +1 -1
- metadata +9 -9
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
require_relative "../command"
|
4
|
+
require_relative "../helpers/parse"
|
5
5
|
|
6
6
|
module Byebug
|
7
7
|
#
|
@@ -14,7 +14,7 @@ module Byebug
|
|
14
14
|
include Helpers::ParseHelper
|
15
15
|
|
16
16
|
def self.regexp
|
17
|
-
/^\s* c(?:ont(?:inue)?)? (
|
17
|
+
/^\s* c(?:ont(?:inue)?)? (?:(!|\s+unconditionally|\s+\S+))? \s*$/x
|
18
18
|
end
|
19
19
|
|
20
20
|
def self.description
|
@@ -22,6 +22,11 @@ module Byebug
|
|
22
22
|
c[ont[inue]][ <line_number>]
|
23
23
|
|
24
24
|
#{short_description}
|
25
|
+
|
26
|
+
Normally the program stops at the next breakpoint. However, if the
|
27
|
+
parameter "unconditionally" is given or the command is suffixed with
|
28
|
+
"!", the program will run until the end regardless of any enabled
|
29
|
+
breakpoints.
|
25
30
|
DESCRIPTION
|
26
31
|
end
|
27
32
|
|
@@ -30,21 +35,34 @@ module Byebug
|
|
30
35
|
end
|
31
36
|
|
32
37
|
def execute
|
33
|
-
if
|
34
|
-
num, err = get_int(
|
38
|
+
if until_line?
|
39
|
+
num, err = get_int(modifier, "Continue", 0, nil)
|
35
40
|
return errmsg(err) unless num
|
36
41
|
|
37
42
|
filename = File.expand_path(frame.file)
|
38
|
-
unless Breakpoint.potential_line?(filename, num)
|
39
|
-
return errmsg(pr("continue.errors.unstopped_line", line: num))
|
40
|
-
end
|
43
|
+
return errmsg(pr("continue.errors.unstopped_line", line: num)) unless Breakpoint.potential_line?(filename, num)
|
41
44
|
|
42
45
|
Breakpoint.add(filename, num)
|
43
46
|
end
|
44
47
|
|
45
48
|
processor.proceed!
|
46
49
|
|
47
|
-
Byebug.
|
50
|
+
Byebug.mode = :off if unconditionally?
|
51
|
+
Byebug.stop if unconditionally? || Byebug.stoppable?
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
def until_line?
|
57
|
+
@match[1] && !["!", "unconditionally"].include?(modifier)
|
58
|
+
end
|
59
|
+
|
60
|
+
def unconditionally?
|
61
|
+
@match[1] && ["!", "unconditionally"].include?(modifier)
|
62
|
+
end
|
63
|
+
|
64
|
+
def modifier
|
65
|
+
@match[1].lstrip
|
48
66
|
end
|
49
67
|
end
|
50
68
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
require_relative "../command"
|
4
|
+
require_relative "../helpers/parse"
|
5
5
|
|
6
6
|
module Byebug
|
7
7
|
#
|
@@ -34,9 +34,7 @@ module Byebug
|
|
34
34
|
|
35
35
|
def execute
|
36
36
|
unless @match[1]
|
37
|
-
if confirm(pr("break.confirmations.delete_all"))
|
38
|
-
Byebug.breakpoints.clear
|
39
|
-
end
|
37
|
+
Byebug.breakpoints.clear if confirm(pr("break.confirmations.delete_all"))
|
40
38
|
|
41
39
|
return
|
42
40
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "../subcommands"
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
require_relative "../commands/disable/breakpoints"
|
6
|
+
require_relative "../commands/disable/display"
|
7
7
|
|
8
8
|
module Byebug
|
9
9
|
#
|
@@ -23,7 +23,7 @@ module Byebug
|
|
23
23
|
dis[able][[ breakpoints| display)][ n1[ n2[ ...[ nn]]]]]
|
24
24
|
|
25
25
|
#{short_description}
|
26
|
-
|
26
|
+
DESCRIPTION
|
27
27
|
end
|
28
28
|
|
29
29
|
def self.short_description
|
data/lib/byebug/commands/down.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "pathname"
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
require_relative "../command"
|
5
|
+
require_relative "../helpers/frame"
|
6
|
+
require_relative "../helpers/parse"
|
7
7
|
|
8
8
|
module Byebug
|
9
9
|
#
|
data/lib/byebug/commands/edit.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "../command"
|
4
4
|
|
5
5
|
module Byebug
|
6
6
|
#
|
@@ -46,6 +46,7 @@ module Byebug
|
|
46
46
|
if matched.nil?
|
47
47
|
file = frame.file
|
48
48
|
return errmsg(pr("edit.errors.state")) unless file
|
49
|
+
|
49
50
|
line = frame.line
|
50
51
|
elsif (@pos_match = /([^:]+)[:]([0-9]+)/.match(matched))
|
51
52
|
file, line = @pos_match.captures
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "../subcommands"
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
require_relative "../commands/enable/breakpoints"
|
6
|
+
require_relative "../commands/enable/display"
|
7
7
|
|
8
8
|
module Byebug
|
9
9
|
#
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "pathname"
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
require_relative "../command"
|
5
|
+
require_relative "../helpers/frame"
|
6
|
+
require_relative "../helpers/parse"
|
7
7
|
|
8
8
|
module Byebug
|
9
9
|
#
|
data/lib/byebug/commands/help.rb
CHANGED
data/lib/byebug/commands/info.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "../subcommands"
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
require_relative "../commands/info/breakpoints"
|
6
|
+
require_relative "../commands/info/display"
|
7
|
+
require_relative "../commands/info/file"
|
8
|
+
require_relative "../commands/info/line"
|
9
|
+
require_relative "../commands/info/program"
|
10
10
|
|
11
11
|
module Byebug
|
12
12
|
#
|
@@ -35,9 +35,7 @@ module Byebug
|
|
35
35
|
if @match[1]
|
36
36
|
indices = @match[1].split(/ +/).map(&:to_i)
|
37
37
|
breakpoints = breakpoints.select { |b| indices.member?(b.id) }
|
38
|
-
if breakpoints.empty?
|
39
|
-
return errmsg("No breakpoints found among list given")
|
40
|
-
end
|
38
|
+
return errmsg("No breakpoints found among list given") if breakpoints.empty?
|
41
39
|
end
|
42
40
|
|
43
41
|
puts "Num Enb What"
|
@@ -57,7 +55,7 @@ module Byebug
|
|
57
55
|
)
|
58
56
|
puts interp
|
59
57
|
hits = brkpt.hit_count
|
60
|
-
return unless hits
|
58
|
+
return unless hits.positive?
|
61
59
|
|
62
60
|
s = hits > 1 ? "s" : ""
|
63
61
|
puts " breakpoint already hit #{hits} time#{s}"
|
@@ -28,9 +28,7 @@ module Byebug
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def execute
|
31
|
-
unless Byebug.displays.find { |d| d[0] }
|
32
|
-
return puts("There are no auto-display expressions now.")
|
33
|
-
end
|
31
|
+
return puts("There are no auto-display expressions now.") unless Byebug.displays.find { |d| d[0] }
|
34
32
|
|
35
33
|
puts "Auto-display expressions now in effect:"
|
36
34
|
puts "Num Enb Expression"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "../../helpers/file"
|
4
4
|
|
5
5
|
module Byebug
|
6
6
|
#
|
@@ -37,9 +37,7 @@ module Byebug
|
|
37
37
|
|
38
38
|
def execute
|
39
39
|
file = @match[1] || frame.file
|
40
|
-
unless File.exist?(file)
|
41
|
-
return errmsg(pr("info.errors.undefined_file", file: file))
|
42
|
-
end
|
40
|
+
return errmsg(pr("info.errors.undefined_file", file: file)) unless File.exist?(file)
|
43
41
|
|
44
42
|
puts prettify <<-RUBY
|
45
43
|
File #{info_file_basic(file)}
|
data/lib/byebug/commands/irb.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "../command"
|
4
4
|
require "irb"
|
5
5
|
require "English"
|
6
6
|
|
@@ -28,9 +28,7 @@ module Byebug
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def execute
|
31
|
-
unless processor.interface.instance_of?(LocalInterface)
|
32
|
-
return errmsg(pr("base.errors.only_local"))
|
33
|
-
end
|
31
|
+
return errmsg(pr("base.errors.only_local")) unless processor.interface.instance_of?(LocalInterface)
|
34
32
|
|
35
33
|
# @todo IRB tries to parse $ARGV so we must clear it (see #197). Add a
|
36
34
|
# test case for it so we can remove this comment.
|
data/lib/byebug/commands/kill.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "../command"
|
4
4
|
|
5
5
|
module Byebug
|
6
6
|
#
|
@@ -10,7 +10,7 @@ module Byebug
|
|
10
10
|
self.allow_in_control = true
|
11
11
|
|
12
12
|
def self.regexp
|
13
|
-
/^\s*
|
13
|
+
/^\s* kill \s* (?:\s+(\S+))? \s*$/x
|
14
14
|
end
|
15
15
|
|
16
16
|
def self.description
|
@@ -31,9 +31,7 @@ module Byebug
|
|
31
31
|
if @match[1]
|
32
32
|
signame = @match[1]
|
33
33
|
|
34
|
-
unless Signal.list.member?(signame)
|
35
|
-
return errmsg("signal name #{signame} is not a signal I know about\n")
|
36
|
-
end
|
34
|
+
return errmsg("signal name #{signame} is not a signal I know about\n") unless Signal.list.member?(signame)
|
37
35
|
else
|
38
36
|
return unless confirm("Really kill? (y/n) ")
|
39
37
|
|
data/lib/byebug/commands/list.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
require_relative "../command"
|
4
|
+
require_relative "../source_file_formatter"
|
5
|
+
require_relative "../helpers/file"
|
6
|
+
require_relative "../helpers/parse"
|
7
7
|
|
8
8
|
module Byebug
|
9
9
|
#
|
data/lib/byebug/commands/next.rb
CHANGED
data/lib/byebug/commands/pry.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
require_relative "../command"
|
4
|
+
require_relative "../helpers/eval"
|
5
5
|
|
6
6
|
module Byebug
|
7
7
|
#
|
@@ -27,9 +27,7 @@ module Byebug
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def execute
|
30
|
-
unless processor.interface.instance_of?(LocalInterface)
|
31
|
-
return errmsg(pr("base.errors.only_local"))
|
32
|
-
end
|
30
|
+
return errmsg(pr("base.errors.only_local")) unless processor.interface.instance_of?(LocalInterface)
|
33
31
|
|
34
32
|
begin
|
35
33
|
require "pry"
|