debug 1.6.1 → 1.6.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78f83c7a7b44c3cae68d784d70fd653410ebce976c02bf846a9992f102634d98
4
- data.tar.gz: b34c3d6b060aa20db1794905aef969105070d556862ceac4cf02ccc88db9bf0a
3
+ metadata.gz: 2247fdc7a834d652c93b28303b0a8de444aedfc75952965797f3d7e0f4e5115b
4
+ data.tar.gz: 6dfd3fd3f3e9a4d8e7469bb8dea86a056fc92d249353809be35691828142dbf8
5
5
  SHA512:
6
- metadata.gz: c408ae087cd00a03e53410a9f6c3c54e2e4536d41784fb109dedd278d8b7941182a925593bf34991bfc2c15ed43e7baa20c736bde0aecb72b832fbdb4f4b55fe
7
- data.tar.gz: b223e415ae539a0b95303b065f029afe48cd2007697979d66ca94e157d7823b848ffd40c1ccc5e2947d69a8aa1c23c08961ade262bc6315f267ec73176c2d882
6
+ metadata.gz: 8c1defaf4f8ff5d90a7becbbcf839953f61669672eefcbe82fb14d5a11e8706fe8fe8f38a097fecc07cdc57576b2e9c30cffce24252bd6da700d24bc3495f380
7
+ data.tar.gz: 620083feac21bbe224eb93d752b181a0a85421ebf1f5ae3e2f35a223737c1ad73e09215357ea231a05fb1c8b2c9157a2ea7eed04377b5103284ec6e60d33d171
data/exe/rdbg CHANGED
@@ -13,10 +13,10 @@ when :start
13
13
  start_mode = config[:remote] ? "open" : 'start'
14
14
  cmd = config[:command] ? ARGV.shift : (ENV['RUBY'] || RbConfig.ruby)
15
15
 
16
+ rubyopt = ENV['RUBYOPT']
16
17
  env = ::DEBUGGER__::Config.config_to_env_hash(config)
17
- rubyopt = env['RUBYOPT']
18
18
  env['RUBY_DEBUG_ADDED_RUBYOPT'] = added = "-r #{libpath}/#{start_mode}"
19
- env['RUBYOPT'] = "#{added} #{rubyopt}"
19
+ env['RUBYOPT'] = "#{rubyopt} #{added}"
20
20
 
21
21
  exec(env, cmd, *ARGV)
22
22
 
data/lib/debug/prelude.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ return if ENV['RUBY_DEBUG_ENABLE'] == '0'
3
4
  return if defined?(::DEBUGGER__)
4
5
 
5
6
  # Put the following line in your login script (e.g. ~/.bash_profile) with modified path:
@@ -263,7 +263,7 @@ module DEBUGGER__
263
263
 
264
264
  def process
265
265
  while req = recv_request
266
- raise "not a request: #{req.inpsect}" unless req['type'] == 'request'
266
+ raise "not a request: #{req.inspect}" unless req['type'] == 'request'
267
267
  args = req.dig('arguments')
268
268
 
269
269
  case req['command']
@@ -348,6 +348,9 @@ module DEBUGGER__
348
348
  when 'disconnect'
349
349
  terminate = args.fetch("terminateDebuggee", false)
350
350
 
351
+ SESSION.clear_all_breakpoints
352
+ send_response req
353
+
351
354
  if SESSION.in_subsession?
352
355
  if terminate
353
356
  @q_msg << 'kill!'
@@ -361,9 +364,6 @@ module DEBUGGER__
361
364
  end
362
365
  end
363
366
 
364
- SESSION.clear_all_breakpoints
365
- send_response req
366
-
367
367
  ## control
368
368
  when 'continue'
369
369
  @q_msg << 'c'
data/lib/debug/session.rb CHANGED
@@ -22,8 +22,9 @@ end
22
22
  # restore RUBYOPT
23
23
  if (added_opt = ENV['RUBY_DEBUG_ADDED_RUBYOPT']) &&
24
24
  (rubyopt = ENV['RUBYOPT']) &&
25
- rubyopt.start_with?(added_opt)
26
- ENV['RUBYOPT'] = rubyopt.delete_prefix(rubyopt)
25
+ rubyopt.end_with?(added_opt)
26
+
27
+ ENV['RUBYOPT'] = rubyopt.delete_suffix(added_opt)
27
28
  ENV['RUBY_DEBUG_ADDED_RUBYOPT'] = nil
28
29
  end
29
30
 
@@ -212,18 +213,24 @@ module DEBUGGER__
212
213
 
213
214
  def process_event evt
214
215
  # variable `@internal_info` is only used for test
215
- @tc, output, ev, @internal_info, *ev_args = evt
216
+ tc, output, ev, @internal_info, *ev_args = evt
216
217
 
217
218
  output.each{|str| @ui.puts str} if ev != :suspend
218
219
 
219
- case ev
220
-
221
- when :thread_begin # special event, tc is nil
220
+ # special event, tc is nil
221
+ # and we don't want to set @tc to the newly created thread's ThreadClient
222
+ if ev == :thread_begin
222
223
  th = ev_args.shift
223
224
  q = ev_args.shift
224
225
  on_thread_begin th
225
226
  q << true
226
227
 
228
+ return
229
+ end
230
+
231
+ @tc = tc
232
+
233
+ case ev
227
234
  when :init
228
235
  enter_subsession
229
236
  wait_command_loop
@@ -2120,7 +2127,7 @@ module DEBUGGER__
2120
2127
  end
2121
2128
 
2122
2129
  # Inspector
2123
-
2130
+
2124
2131
  SHORT_INSPECT_LENGTH = 40
2125
2132
 
2126
2133
  class LimitedPP
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.1"
4
+ VERSION = "1.6.2"
5
5
  end
data/lib/debug.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'debug/session'
4
+ return unless defined?(DEBUGGER__)
4
5
  DEBUGGER__::start no_sigint_hook: true, nonstop: true
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.1
4
+ version: 1.6.2
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-07-13 00:00:00.000000000 Z
11
+ date: 2022-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: irb