runger_byebug 11.2.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 +7 -0
- data/CHANGELOG.md +954 -0
- data/CONTRIBUTING.md +58 -0
- data/GUIDE.md +1806 -0
- data/LICENSE +23 -0
- data/README.md +199 -0
- data/exe/byebug +6 -0
- data/ext/byebug/breakpoint.c +521 -0
- data/ext/byebug/byebug.c +900 -0
- data/ext/byebug/byebug.h +145 -0
- data/ext/byebug/context.c +687 -0
- data/ext/byebug/extconf.rb +12 -0
- data/ext/byebug/locker.c +96 -0
- data/ext/byebug/threads.c +241 -0
- data/lib/byebug/attacher.rb +48 -0
- data/lib/byebug/breakpoint.rb +94 -0
- data/lib/byebug/command.rb +111 -0
- data/lib/byebug/command_list.rb +34 -0
- data/lib/byebug/commands/break.rb +114 -0
- data/lib/byebug/commands/catch.rb +78 -0
- data/lib/byebug/commands/condition.rb +55 -0
- data/lib/byebug/commands/continue.rb +68 -0
- data/lib/byebug/commands/debug.rb +38 -0
- data/lib/byebug/commands/delete.rb +55 -0
- data/lib/byebug/commands/disable/breakpoints.rb +42 -0
- data/lib/byebug/commands/disable/display.rb +43 -0
- data/lib/byebug/commands/disable.rb +33 -0
- data/lib/byebug/commands/display.rb +66 -0
- data/lib/byebug/commands/down.rb +45 -0
- data/lib/byebug/commands/edit.rb +69 -0
- data/lib/byebug/commands/enable/breakpoints.rb +42 -0
- data/lib/byebug/commands/enable/display.rb +43 -0
- data/lib/byebug/commands/enable.rb +33 -0
- data/lib/byebug/commands/finish.rb +57 -0
- data/lib/byebug/commands/frame.rb +57 -0
- data/lib/byebug/commands/help.rb +64 -0
- data/lib/byebug/commands/history.rb +39 -0
- data/lib/byebug/commands/info/breakpoints.rb +65 -0
- data/lib/byebug/commands/info/display.rb +49 -0
- data/lib/byebug/commands/info/file.rb +80 -0
- data/lib/byebug/commands/info/line.rb +35 -0
- data/lib/byebug/commands/info/program.rb +49 -0
- data/lib/byebug/commands/info.rb +37 -0
- data/lib/byebug/commands/interrupt.rb +34 -0
- data/lib/byebug/commands/irb.rb +50 -0
- data/lib/byebug/commands/kill.rb +45 -0
- data/lib/byebug/commands/list.rb +159 -0
- data/lib/byebug/commands/method.rb +53 -0
- data/lib/byebug/commands/next.rb +40 -0
- data/lib/byebug/commands/pry.rb +41 -0
- data/lib/byebug/commands/quit.rb +42 -0
- data/lib/byebug/commands/restart.rb +64 -0
- data/lib/byebug/commands/save.rb +72 -0
- data/lib/byebug/commands/set.rb +79 -0
- data/lib/byebug/commands/show.rb +45 -0
- data/lib/byebug/commands/skip.rb +85 -0
- data/lib/byebug/commands/source.rb +40 -0
- data/lib/byebug/commands/step.rb +40 -0
- data/lib/byebug/commands/thread/current.rb +37 -0
- data/lib/byebug/commands/thread/list.rb +43 -0
- data/lib/byebug/commands/thread/resume.rb +45 -0
- data/lib/byebug/commands/thread/stop.rb +43 -0
- data/lib/byebug/commands/thread/switch.rb +46 -0
- data/lib/byebug/commands/thread.rb +34 -0
- data/lib/byebug/commands/tracevar.rb +54 -0
- data/lib/byebug/commands/undisplay.rb +51 -0
- data/lib/byebug/commands/untracevar.rb +36 -0
- data/lib/byebug/commands/up.rb +45 -0
- data/lib/byebug/commands/var/all.rb +41 -0
- data/lib/byebug/commands/var/args.rb +39 -0
- data/lib/byebug/commands/var/const.rb +49 -0
- data/lib/byebug/commands/var/global.rb +37 -0
- data/lib/byebug/commands/var/instance.rb +39 -0
- data/lib/byebug/commands/var/local.rb +39 -0
- data/lib/byebug/commands/var.rb +37 -0
- data/lib/byebug/commands/where.rb +64 -0
- data/lib/byebug/commands.rb +40 -0
- data/lib/byebug/context.rb +157 -0
- data/lib/byebug/core.rb +115 -0
- data/lib/byebug/errors.rb +29 -0
- data/lib/byebug/frame.rb +185 -0
- data/lib/byebug/helpers/bin.rb +47 -0
- data/lib/byebug/helpers/eval.rb +134 -0
- data/lib/byebug/helpers/file.rb +63 -0
- data/lib/byebug/helpers/frame.rb +75 -0
- data/lib/byebug/helpers/parse.rb +80 -0
- data/lib/byebug/helpers/path.rb +40 -0
- data/lib/byebug/helpers/reflection.rb +19 -0
- data/lib/byebug/helpers/string.rb +33 -0
- data/lib/byebug/helpers/thread.rb +67 -0
- data/lib/byebug/helpers/toggle.rb +62 -0
- data/lib/byebug/helpers/var.rb +70 -0
- data/lib/byebug/history.rb +130 -0
- data/lib/byebug/interface.rb +146 -0
- data/lib/byebug/interfaces/local_interface.rb +63 -0
- data/lib/byebug/interfaces/remote_interface.rb +50 -0
- data/lib/byebug/interfaces/script_interface.rb +33 -0
- data/lib/byebug/interfaces/test_interface.rb +67 -0
- data/lib/byebug/option_setter.rb +95 -0
- data/lib/byebug/printers/base.rb +68 -0
- data/lib/byebug/printers/plain.rb +44 -0
- data/lib/byebug/printers/texts/base.yml +115 -0
- data/lib/byebug/printers/texts/plain.yml +33 -0
- data/lib/byebug/processors/command_processor.rb +173 -0
- data/lib/byebug/processors/control_processor.rb +24 -0
- data/lib/byebug/processors/post_mortem_processor.rb +18 -0
- data/lib/byebug/processors/script_processor.rb +49 -0
- data/lib/byebug/remote/client.rb +57 -0
- data/lib/byebug/remote/server.rb +47 -0
- data/lib/byebug/remote.rb +85 -0
- data/lib/byebug/runner.rb +198 -0
- data/lib/byebug/setting.rb +79 -0
- data/lib/byebug/settings/autoirb.rb +29 -0
- data/lib/byebug/settings/autolist.rb +29 -0
- data/lib/byebug/settings/autopry.rb +29 -0
- data/lib/byebug/settings/autosave.rb +17 -0
- data/lib/byebug/settings/basename.rb +16 -0
- data/lib/byebug/settings/callstyle.rb +20 -0
- data/lib/byebug/settings/fullpath.rb +16 -0
- data/lib/byebug/settings/histfile.rb +20 -0
- data/lib/byebug/settings/histsize.rb +20 -0
- data/lib/byebug/settings/linetrace.rb +22 -0
- data/lib/byebug/settings/listsize.rb +21 -0
- data/lib/byebug/settings/post_mortem.rb +27 -0
- data/lib/byebug/settings/savefile.rb +20 -0
- data/lib/byebug/settings/stack_on_error.rb +15 -0
- data/lib/byebug/settings/width.rb +20 -0
- data/lib/byebug/source_file_formatter.rb +71 -0
- data/lib/byebug/subcommands.rb +54 -0
- data/lib/byebug/version.rb +8 -0
- data/lib/byebug.rb +3 -0
- metadata +194 -0
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../setting"
|
4
|
+
|
5
|
+
module Byebug
|
6
|
+
#
|
7
|
+
# Setting to enable/disable the display of backtraces when evaluations raise
|
8
|
+
# errors.
|
9
|
+
#
|
10
|
+
class StackOnErrorSetting < Setting
|
11
|
+
def banner
|
12
|
+
"Display stack trace when `eval` raises an exception"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../setting"
|
4
|
+
|
5
|
+
module Byebug
|
6
|
+
#
|
7
|
+
# Setting to customize the maximum width of byebug's output.
|
8
|
+
#
|
9
|
+
class WidthSetting < Setting
|
10
|
+
DEFAULT = 160
|
11
|
+
|
12
|
+
def banner
|
13
|
+
"Number of characters per line in byebug's output"
|
14
|
+
end
|
15
|
+
|
16
|
+
def to_s
|
17
|
+
"Maximum width of byebug's output is #{value}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "helpers/file"
|
4
|
+
require_relative "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
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "forwardable"
|
4
|
+
|
5
|
+
require_relative "helpers/reflection"
|
6
|
+
require_relative "command_list"
|
7
|
+
|
8
|
+
module Byebug
|
9
|
+
#
|
10
|
+
# Subcommand additions.
|
11
|
+
#
|
12
|
+
module Subcommands
|
13
|
+
def self.included(command)
|
14
|
+
command.extend(ClassMethods)
|
15
|
+
end
|
16
|
+
|
17
|
+
extend Forwardable
|
18
|
+
def_delegators "self.class", :subcommand_list
|
19
|
+
|
20
|
+
#
|
21
|
+
# Delegates to subcommands or prints help if no subcommand specified.
|
22
|
+
#
|
23
|
+
def execute
|
24
|
+
subcmd_name = @match[1]
|
25
|
+
return puts(help) unless subcmd_name
|
26
|
+
|
27
|
+
subcmd = subcommand_list.match(subcmd_name)
|
28
|
+
raise CommandNotFound.new(subcmd_name, self.class) unless subcmd
|
29
|
+
|
30
|
+
subcmd.new(processor, arguments).execute
|
31
|
+
end
|
32
|
+
|
33
|
+
#
|
34
|
+
# Class methods added to subcommands
|
35
|
+
#
|
36
|
+
module ClassMethods
|
37
|
+
include Helpers::ReflectionHelper
|
38
|
+
|
39
|
+
#
|
40
|
+
# Default help text for a command with subcommands
|
41
|
+
#
|
42
|
+
def help
|
43
|
+
super + subcommand_list.to_s
|
44
|
+
end
|
45
|
+
|
46
|
+
#
|
47
|
+
# Command's subcommands.
|
48
|
+
#
|
49
|
+
def subcommand_list
|
50
|
+
@subcommand_list ||= CommandList.new(commands)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
data/lib/byebug.rb
ADDED
metadata
ADDED
@@ -0,0 +1,194 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: runger_byebug
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 11.2.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- David Runger
|
8
|
+
bindir: exe
|
9
|
+
cert_chain: []
|
10
|
+
date: 2025-02-04 00:00:00.000000000 Z
|
11
|
+
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: bundler
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - "~>"
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '2.0'
|
19
|
+
type: :development
|
20
|
+
prerelease: false
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - "~>"
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: '2.0'
|
26
|
+
description: |-
|
27
|
+
Byebug is a Ruby debugger. It's implemented using the
|
28
|
+
TracePoint C API for execution control and the Debug Inspector C API for
|
29
|
+
call stack navigation. The core component provides support that front-ends
|
30
|
+
can build on. It provides breakpoint handling and bindings for stack frames
|
31
|
+
among other things and it comes with an easy to use command line interface.
|
32
|
+
email: davidjrunger@gmail.com
|
33
|
+
executables:
|
34
|
+
- byebug
|
35
|
+
extensions:
|
36
|
+
- ext/byebug/extconf.rb
|
37
|
+
extra_rdoc_files:
|
38
|
+
- CHANGELOG.md
|
39
|
+
- CONTRIBUTING.md
|
40
|
+
- README.md
|
41
|
+
- GUIDE.md
|
42
|
+
files:
|
43
|
+
- CHANGELOG.md
|
44
|
+
- CONTRIBUTING.md
|
45
|
+
- GUIDE.md
|
46
|
+
- LICENSE
|
47
|
+
- README.md
|
48
|
+
- exe/byebug
|
49
|
+
- ext/byebug/breakpoint.c
|
50
|
+
- ext/byebug/byebug.c
|
51
|
+
- ext/byebug/byebug.h
|
52
|
+
- ext/byebug/context.c
|
53
|
+
- ext/byebug/extconf.rb
|
54
|
+
- ext/byebug/locker.c
|
55
|
+
- ext/byebug/threads.c
|
56
|
+
- lib/byebug.rb
|
57
|
+
- lib/byebug/attacher.rb
|
58
|
+
- lib/byebug/breakpoint.rb
|
59
|
+
- lib/byebug/command.rb
|
60
|
+
- lib/byebug/command_list.rb
|
61
|
+
- lib/byebug/commands.rb
|
62
|
+
- lib/byebug/commands/break.rb
|
63
|
+
- lib/byebug/commands/catch.rb
|
64
|
+
- lib/byebug/commands/condition.rb
|
65
|
+
- lib/byebug/commands/continue.rb
|
66
|
+
- lib/byebug/commands/debug.rb
|
67
|
+
- lib/byebug/commands/delete.rb
|
68
|
+
- lib/byebug/commands/disable.rb
|
69
|
+
- lib/byebug/commands/disable/breakpoints.rb
|
70
|
+
- lib/byebug/commands/disable/display.rb
|
71
|
+
- lib/byebug/commands/display.rb
|
72
|
+
- lib/byebug/commands/down.rb
|
73
|
+
- lib/byebug/commands/edit.rb
|
74
|
+
- lib/byebug/commands/enable.rb
|
75
|
+
- lib/byebug/commands/enable/breakpoints.rb
|
76
|
+
- lib/byebug/commands/enable/display.rb
|
77
|
+
- lib/byebug/commands/finish.rb
|
78
|
+
- lib/byebug/commands/frame.rb
|
79
|
+
- lib/byebug/commands/help.rb
|
80
|
+
- lib/byebug/commands/history.rb
|
81
|
+
- lib/byebug/commands/info.rb
|
82
|
+
- lib/byebug/commands/info/breakpoints.rb
|
83
|
+
- lib/byebug/commands/info/display.rb
|
84
|
+
- lib/byebug/commands/info/file.rb
|
85
|
+
- lib/byebug/commands/info/line.rb
|
86
|
+
- lib/byebug/commands/info/program.rb
|
87
|
+
- lib/byebug/commands/interrupt.rb
|
88
|
+
- lib/byebug/commands/irb.rb
|
89
|
+
- lib/byebug/commands/kill.rb
|
90
|
+
- lib/byebug/commands/list.rb
|
91
|
+
- lib/byebug/commands/method.rb
|
92
|
+
- lib/byebug/commands/next.rb
|
93
|
+
- lib/byebug/commands/pry.rb
|
94
|
+
- lib/byebug/commands/quit.rb
|
95
|
+
- lib/byebug/commands/restart.rb
|
96
|
+
- lib/byebug/commands/save.rb
|
97
|
+
- lib/byebug/commands/set.rb
|
98
|
+
- lib/byebug/commands/show.rb
|
99
|
+
- lib/byebug/commands/skip.rb
|
100
|
+
- lib/byebug/commands/source.rb
|
101
|
+
- lib/byebug/commands/step.rb
|
102
|
+
- lib/byebug/commands/thread.rb
|
103
|
+
- lib/byebug/commands/thread/current.rb
|
104
|
+
- lib/byebug/commands/thread/list.rb
|
105
|
+
- lib/byebug/commands/thread/resume.rb
|
106
|
+
- lib/byebug/commands/thread/stop.rb
|
107
|
+
- lib/byebug/commands/thread/switch.rb
|
108
|
+
- lib/byebug/commands/tracevar.rb
|
109
|
+
- lib/byebug/commands/undisplay.rb
|
110
|
+
- lib/byebug/commands/untracevar.rb
|
111
|
+
- lib/byebug/commands/up.rb
|
112
|
+
- lib/byebug/commands/var.rb
|
113
|
+
- lib/byebug/commands/var/all.rb
|
114
|
+
- lib/byebug/commands/var/args.rb
|
115
|
+
- lib/byebug/commands/var/const.rb
|
116
|
+
- lib/byebug/commands/var/global.rb
|
117
|
+
- lib/byebug/commands/var/instance.rb
|
118
|
+
- lib/byebug/commands/var/local.rb
|
119
|
+
- lib/byebug/commands/where.rb
|
120
|
+
- lib/byebug/context.rb
|
121
|
+
- lib/byebug/core.rb
|
122
|
+
- lib/byebug/errors.rb
|
123
|
+
- lib/byebug/frame.rb
|
124
|
+
- lib/byebug/helpers/bin.rb
|
125
|
+
- lib/byebug/helpers/eval.rb
|
126
|
+
- lib/byebug/helpers/file.rb
|
127
|
+
- lib/byebug/helpers/frame.rb
|
128
|
+
- lib/byebug/helpers/parse.rb
|
129
|
+
- lib/byebug/helpers/path.rb
|
130
|
+
- lib/byebug/helpers/reflection.rb
|
131
|
+
- lib/byebug/helpers/string.rb
|
132
|
+
- lib/byebug/helpers/thread.rb
|
133
|
+
- lib/byebug/helpers/toggle.rb
|
134
|
+
- lib/byebug/helpers/var.rb
|
135
|
+
- lib/byebug/history.rb
|
136
|
+
- lib/byebug/interface.rb
|
137
|
+
- lib/byebug/interfaces/local_interface.rb
|
138
|
+
- lib/byebug/interfaces/remote_interface.rb
|
139
|
+
- lib/byebug/interfaces/script_interface.rb
|
140
|
+
- lib/byebug/interfaces/test_interface.rb
|
141
|
+
- lib/byebug/option_setter.rb
|
142
|
+
- lib/byebug/printers/base.rb
|
143
|
+
- lib/byebug/printers/plain.rb
|
144
|
+
- lib/byebug/printers/texts/base.yml
|
145
|
+
- lib/byebug/printers/texts/plain.yml
|
146
|
+
- lib/byebug/processors/command_processor.rb
|
147
|
+
- lib/byebug/processors/control_processor.rb
|
148
|
+
- lib/byebug/processors/post_mortem_processor.rb
|
149
|
+
- lib/byebug/processors/script_processor.rb
|
150
|
+
- lib/byebug/remote.rb
|
151
|
+
- lib/byebug/remote/client.rb
|
152
|
+
- lib/byebug/remote/server.rb
|
153
|
+
- lib/byebug/runner.rb
|
154
|
+
- lib/byebug/setting.rb
|
155
|
+
- lib/byebug/settings/autoirb.rb
|
156
|
+
- lib/byebug/settings/autolist.rb
|
157
|
+
- lib/byebug/settings/autopry.rb
|
158
|
+
- lib/byebug/settings/autosave.rb
|
159
|
+
- lib/byebug/settings/basename.rb
|
160
|
+
- lib/byebug/settings/callstyle.rb
|
161
|
+
- lib/byebug/settings/fullpath.rb
|
162
|
+
- lib/byebug/settings/histfile.rb
|
163
|
+
- lib/byebug/settings/histsize.rb
|
164
|
+
- lib/byebug/settings/linetrace.rb
|
165
|
+
- lib/byebug/settings/listsize.rb
|
166
|
+
- lib/byebug/settings/post_mortem.rb
|
167
|
+
- lib/byebug/settings/savefile.rb
|
168
|
+
- lib/byebug/settings/stack_on_error.rb
|
169
|
+
- lib/byebug/settings/width.rb
|
170
|
+
- lib/byebug/source_file_formatter.rb
|
171
|
+
- lib/byebug/subcommands.rb
|
172
|
+
- lib/byebug/version.rb
|
173
|
+
homepage: https://github.com/davidrunger/byebug
|
174
|
+
licenses:
|
175
|
+
- BSD-2-Clause
|
176
|
+
metadata: {}
|
177
|
+
rdoc_options: []
|
178
|
+
require_paths:
|
179
|
+
- lib
|
180
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
181
|
+
requirements:
|
182
|
+
- - ">="
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
version: 2.5.0
|
185
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
|
+
requirements:
|
187
|
+
- - ">="
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
version: '0'
|
190
|
+
requirements: []
|
191
|
+
rubygems_version: 3.6.2
|
192
|
+
specification_version: 4
|
193
|
+
summary: Ruby fast debugger - base + CLI
|
194
|
+
test_files: []
|