debug 1.6.2 → 1.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2247fdc7a834d652c93b28303b0a8de444aedfc75952965797f3d7e0f4e5115b
4
- data.tar.gz: 6dfd3fd3f3e9a4d8e7469bb8dea86a056fc92d249353809be35691828142dbf8
3
+ metadata.gz: 61c14c6e761a2ed0f10294682cb7b152c4329d3cd0eccbffff68e3ae122d00a0
4
+ data.tar.gz: 714add08d21df0ceb674a8a9c8b8599f0dcc45cb38b68611c766fab1b6ddcd41
5
5
  SHA512:
6
- metadata.gz: 8c1defaf4f8ff5d90a7becbbcf839953f61669672eefcbe82fb14d5a11e8706fe8fe8f38a097fecc07cdc57576b2e9c30cffce24252bd6da700d24bc3495f380
7
- data.tar.gz: 620083feac21bbe224eb93d752b181a0a85421ebf1f5ae3e2f35a223737c1ad73e09215357ea231a05fb1c8b2c9157a2ea7eed04377b5103284ec6e60d33d171
6
+ metadata.gz: 2c43d785c88ce38a676941b87ab320d126d9083f8b4dcc487ef22b8f7f0c4a144ed2fe9dfc800f8d7b2bf9287694c3d5abcd3b7c5075248b5ca08bd6bd0b3bcf
7
+ data.tar.gz: 8f2e9922aac4e297c437f3fc63ec11df2af430c2f3b3406df8723d4703fc254705246300fee99fee6f38f1da62348184b3ff0dcb6a4ddf302c3345f8ae5d4634
data/CONTRIBUTING.md CHANGED
@@ -269,7 +269,7 @@ Currently, there are 2 kinds of test frameworks for DAP and CDP.
269
269
 
270
270
  If you want to write protocol-based tests, you should use the test generator.
271
271
  To run the test generator, you can enter `$ bin/gentest target.rb --open=vscode` in the terminal, VSCode will be executed.
272
- Also, if you enter ``$ bin/gentest target.rb --open=chrome` there, Chrome will be executed.
272
+ Also, if you enter `$ bin/gentest target.rb --open=chrome` there, Chrome will be executed.
273
273
  If you need to modify existing tests, it is basically a good idea to regenerate them by the test generator instead of rewriting them directly.
274
274
  Please refer to [the Microsoft "Debug Adapter Protocol" article](https://microsoft.github.io/debug-adapter-protocol/specification) to learn more about DAP formats.
275
275
  Please refer to [Procol viewer for "Chrome DevTools Protocol"](https://chromedevtools.github.io/devtools-protocol/) to learn more about CDP formats.
data/README.md CHANGED
@@ -438,12 +438,12 @@ $ rdbg target.rb --open=chrome
438
438
  DEBUGGER: Debugger can attach via TCP/IP (127.0.0.1:43633)
439
439
  DEBUGGER: With Chrome browser, type the following URL in the address-bar:
440
440
 
441
- devtools://devtools/bundled/inspector.html?ws=127.0.0.1:43633
441
+ devtools://devtools/bundled/inspector.html?v8only=true&panel=sources&ws=127.0.0.1:57231/b32a55cd-2eb5-4c5c-87d8-b3dfc59d80ef
442
442
 
443
443
  DEBUGGER: wait for debugger connection...
444
444
  ```
445
445
 
446
- Type `devtools://devtools/bundled/inspector.html?ws=127.0.0.1:43633` in the address-bar on Chrome browser, and you can continue the debugging with chrome browser.
446
+ Type `devtools://devtools/bundled/inspector.html?v8only=true&panel=sources&ws=127.0.0.1:57231/b32a55cd-2eb5-4c5c-87d8-b3dfc59d80ef` in the address-bar on Chrome browser, and you can continue the debugging with chrome browser.
447
447
 
448
448
  Also `open chrome` command works like `open vscode`.
449
449
 
data/exe/rdbg CHANGED
@@ -13,9 +13,24 @@ when :start
13
13
  start_mode = config[:remote] ? "open" : 'start'
14
14
  cmd = config[:command] ? ARGV.shift : (ENV['RUBY'] || RbConfig.ruby)
15
15
 
16
+ if defined?($:.resolve_feature_path)
17
+ begin
18
+ _, sopath = $:.resolve_feature_path('debug/debug.so')
19
+ rescue LoadError
20
+ # raises LoadError before 3.1 (2.7 and 3.0)
21
+ else
22
+ sopath = File.dirname(File.dirname(sopath)) if sopath
23
+ end
24
+ else
25
+ # `$:.resolve_feature_path` is not defined in 2.6 or earlier.
26
+ so = "debug/debug.#{RbConfig::CONFIG['DLEXT']}"
27
+ sopath = $:.find {|dir| File.exist?(File.join(dir, so))}
28
+ end
29
+ added = "-r #{libpath}/#{start_mode}"
30
+ added = "-I #{sopath} #{added}" if sopath
16
31
  rubyopt = ENV['RUBYOPT']
17
32
  env = ::DEBUGGER__::Config.config_to_env_hash(config)
18
- env['RUBY_DEBUG_ADDED_RUBYOPT'] = added = "-r #{libpath}/#{start_mode}"
33
+ env['RUBY_DEBUG_ADDED_RUBYOPT'] = added
19
34
  env['RUBYOPT'] = "#{rubyopt} #{added}"
20
35
 
21
36
  exec(env, cmd, *ARGV)
data/lib/debug/client.rb CHANGED
@@ -42,7 +42,7 @@ module DEBUGGER__
42
42
  when /csh/
43
43
  :csh
44
44
  when /zsh/
45
- :szh
45
+ :zsh
46
46
  when /dash/
47
47
  :dash
48
48
  else
@@ -998,7 +998,7 @@ module DEBUGGER__
998
998
 
999
999
  def search_const b, expr
1000
1000
  cs = expr.delete_prefix('::').split('::')
1001
- [Object, *b.eval('Module.nesting')].reverse_each{|mod|
1001
+ [Object, *b.eval('::Module.nesting')].reverse_each{|mod|
1002
1002
  if cs.all?{|c|
1003
1003
  if mod.const_defined?(c)
1004
1004
  mod = mod.const_get(c)
@@ -911,7 +911,7 @@ module DEBUGGER__
911
911
 
912
912
  def search_const b, expr
913
913
  cs = expr.delete_prefix('::').split('::')
914
- [Object, *b.eval('Module.nesting')].reverse_each{|mod|
914
+ [Object, *b.eval('::Module.nesting')].reverse_each{|mod|
915
915
  if cs.all?{|c|
916
916
  if mod.const_defined?(c)
917
917
  mod = mod.const_get(c)
data/lib/debug/session.rb CHANGED
@@ -1893,9 +1893,11 @@ module DEBUGGER__
1893
1893
 
1894
1894
  def after_fork child: true
1895
1895
  if child || !@lock_file
1896
- @m = Mutex.new
1897
- @lock_level = 0
1898
- @lock_file = open(@lock_tempfile.path, 'w')
1896
+ @m = Mutex.new unless @m
1897
+ @m.synchronize do
1898
+ @lock_level = 0
1899
+ @lock_file = open(@lock_tempfile.path, 'w')
1900
+ end
1899
1901
  end
1900
1902
  end
1901
1903
 
@@ -2229,7 +2231,7 @@ module DEBUGGER__
2229
2231
  # depend on the file system. So this check is only roughly estimation.
2230
2232
 
2231
2233
  def self.compare_path(a, b)
2232
- a.downcase == b.downcase
2234
+ a&.downcase == b&.downcase
2233
2235
  end
2234
2236
  else
2235
2237
  def self.compare_path(a, b)
@@ -568,7 +568,7 @@ module DEBUGGER__
568
568
  unless only_self
569
569
  s.ancestors.each{|c| break if c == Object; cs[c] = :ancestors}
570
570
  if b = current_frame&.binding
571
- b.eval('Module.nesting').each{|c| cs[c] = :nesting unless cs.has_key? c}
571
+ b.eval('::Module.nesting').each{|c| cs[c] = :nesting unless cs.has_key? c}
572
572
  end
573
573
  end
574
574
 
data/lib/debug/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DEBUGGER__
4
- VERSION = "1.6.2"
4
+ VERSION = "1.6.3"
5
5
  end
data/misc/README.md.erb CHANGED
@@ -438,12 +438,12 @@ $ rdbg target.rb --open=chrome
438
438
  DEBUGGER: Debugger can attach via TCP/IP (127.0.0.1:43633)
439
439
  DEBUGGER: With Chrome browser, type the following URL in the address-bar:
440
440
 
441
- devtools://devtools/bundled/inspector.html?ws=127.0.0.1:43633
441
+ devtools://devtools/bundled/inspector.html?v8only=true&panel=sources&ws=127.0.0.1:57231/b32a55cd-2eb5-4c5c-87d8-b3dfc59d80ef
442
442
 
443
443
  DEBUGGER: wait for debugger connection...
444
444
  ```
445
445
 
446
- Type `devtools://devtools/bundled/inspector.html?ws=127.0.0.1:43633` in the address-bar on Chrome browser, and you can continue the debugging with chrome browser.
446
+ Type `devtools://devtools/bundled/inspector.html?v8only=true&panel=sources&ws=127.0.0.1:57231/b32a55cd-2eb5-4c5c-87d8-b3dfc59d80ef` in the address-bar on Chrome browser, and you can continue the debugging with chrome browser.
447
447
 
448
448
  Also `open chrome` command works like `open vscode`.
449
449
 
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: 1.6.2
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koichi Sasada
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-10 00:00:00.000000000 Z
11
+ date: 2022-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: irb