debug 0.2.0 → 0.2.1
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/README.md +1 -1
- data/debug.gemspec +2 -2
- data/lib/debug.rb +22 -13
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3eef42a29a223014d5f00320882cf6e6fdc1b35671b8e600341269b37c2832cb
|
4
|
+
data.tar.gz: be32e52c4010218f3ca3ab3836ef4358c887775308f16a2e740f3bac39c976a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3b53ac6abee0ba7e9caa4b86c4e83845ddce62a41460f203112378e0226217cfd6e792a74c78086832d66615281dd00792aa64f017958719166ce216e725fee
|
7
|
+
data.tar.gz: 8f4c3124d8c0d0b4f970ab7f08238360d4535eb54cfec41f1b330560a3ddffd89bc67a7f50039c26a7d0f160e2210eaff0b3f0c267cfe94919ff5cf358100bbd
|
data/README.md
CHANGED
@@ -48,5 +48,5 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
48
48
|
|
49
49
|
## Contributing
|
50
50
|
|
51
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
51
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/debug.
|
52
52
|
|
data/debug.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "debug"
|
3
|
-
spec.version = "0.2.
|
3
|
+
spec.version = "0.2.1"
|
4
4
|
spec.authors = ["Yukihiro Matsumoto"]
|
5
5
|
spec.email = ["matz@ruby-lang.org"]
|
6
6
|
|
@@ -17,6 +17,6 @@ Gem::Specification.new do |spec|
|
|
17
17
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
18
|
end
|
19
19
|
spec.bindir = "exe"
|
20
|
-
spec.executables =
|
20
|
+
spec.executables = []
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
end
|
data/lib/debug.rb
CHANGED
@@ -3,8 +3,6 @@
|
|
3
3
|
# Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
4
4
|
# Copyright (C) 2000-2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
|
5
5
|
|
6
|
-
require 'continuation'
|
7
|
-
|
8
6
|
if $SAFE > 0
|
9
7
|
STDERR.print "-r debug.rb is not available in safe mode\n"
|
10
8
|
exit 1
|
@@ -183,6 +181,9 @@ SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__ # :nodoc:
|
|
183
181
|
|
184
182
|
class DEBUGGER__
|
185
183
|
MUTEX = Thread::Mutex.new # :nodoc:
|
184
|
+
CONTINUATIONS_SUPPORTED = RUBY_ENGINE == 'ruby'
|
185
|
+
|
186
|
+
require 'continuation' if CONTINUATIONS_SUPPORTED
|
186
187
|
|
187
188
|
class Context # :nodoc:
|
188
189
|
DEBUG_LAST_CMD = []
|
@@ -380,8 +381,10 @@ class DEBUGGER__
|
|
380
381
|
|
381
382
|
def debug_command(file, line, id, binding)
|
382
383
|
MUTEX.lock
|
383
|
-
|
384
|
-
|
384
|
+
if CONTINUATIONS_SUPPORTED
|
385
|
+
unless defined?($debugger_restart) and $debugger_restart
|
386
|
+
callcc{|c| $debugger_restart = c}
|
387
|
+
end
|
385
388
|
end
|
386
389
|
set_last_thread(Thread.current)
|
387
390
|
frame_pos = 0
|
@@ -432,7 +435,7 @@ class DEBUGGER__
|
|
432
435
|
pos = $2
|
433
436
|
if $1
|
434
437
|
klass = debug_silent_eval($1, binding)
|
435
|
-
file = $1
|
438
|
+
file = File.expand_path($1)
|
436
439
|
end
|
437
440
|
if pos =~ /^\d+$/
|
438
441
|
pname = pos
|
@@ -653,7 +656,11 @@ class DEBUGGER__
|
|
653
656
|
stdout.printf "%s\n", debug_eval($', binding).inspect
|
654
657
|
|
655
658
|
when /^\s*r(?:estart)?$/
|
656
|
-
|
659
|
+
if CONTINUATIONS_SUPPORTED
|
660
|
+
$debugger_restart.call
|
661
|
+
else
|
662
|
+
stdout.print "Restart requires continuations.\n"
|
663
|
+
end
|
657
664
|
|
658
665
|
when /^\s*h(?:elp)?$/
|
659
666
|
debug_print_help()
|
@@ -1017,8 +1024,8 @@ EOHELP
|
|
1017
1024
|
#
|
1018
1025
|
# (rdb:1) DEBUGGER__.thread_list_all
|
1019
1026
|
# +1 #<Thread:0x007fb2320c03f0 run> debug_me.rb.rb:3
|
1020
|
-
# 2 #<Thread:0x007fb23218a538
|
1021
|
-
# 3 #<Thread:0x007fb23218b0f0
|
1027
|
+
# 2 #<Thread:0x007fb23218a538 debug_me.rb.rb:3 sleep>
|
1028
|
+
# 3 #<Thread:0x007fb23218b0f0 debug_me.rb.rb:3 sleep>
|
1022
1029
|
# [1, 2, 3]
|
1023
1030
|
#
|
1024
1031
|
# Your current thread is indicated by a <b>+</b>
|
@@ -1027,8 +1034,8 @@ EOHELP
|
|
1027
1034
|
#
|
1028
1035
|
# (rdb:1) th l
|
1029
1036
|
# +1 #<Thread:0x007f99328c0410 run> debug_me.rb:3
|
1030
|
-
# 2 #<Thread:0x007f9932938230
|
1031
|
-
# 3 #<Thread:0x007f9932938e10
|
1037
|
+
# 2 #<Thread:0x007f9932938230 debug_me.rb:3 sleep> debug_me.rb:3
|
1038
|
+
# 3 #<Thread:0x007f9932938e10 debug_me.rb:3 sleep> debug_me.rb:3
|
1032
1039
|
#
|
1033
1040
|
# See DEBUGGER__ for more usage.
|
1034
1041
|
|
@@ -1102,9 +1109,11 @@ EOHELP
|
|
1102
1109
|
|
1103
1110
|
stdout.printf "Debug.rb\n"
|
1104
1111
|
stdout.printf "Emacs support available.\n\n"
|
1105
|
-
RubyVM::InstructionSequence
|
1106
|
-
|
1107
|
-
|
1112
|
+
if defined?(RubyVM::InstructionSequence)
|
1113
|
+
RubyVM::InstructionSequence.compile_option = {
|
1114
|
+
trace_instruction: true
|
1115
|
+
}
|
1116
|
+
end
|
1108
1117
|
set_trace_func proc { |event, file, line, id, binding, klass, *rest|
|
1109
1118
|
DEBUGGER__.context.trace_func event, file, line, id, binding, klass
|
1110
1119
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: debug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yukihiro Matsumoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Debugging functionality for Ruby
|
14
14
|
email:
|
@@ -48,7 +48,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
50
|
requirements: []
|
51
|
-
rubygems_version: 3.
|
51
|
+
rubygems_version: 3.3.0.dev
|
52
52
|
signing_key:
|
53
53
|
specification_version: 4
|
54
54
|
summary: Debugging functionality for Ruby
|