debug 1.0.0.rc2 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 253c51808e29545d8954144abc1a821b1a795e18f56a9521840d368dcf09b63b
4
- data.tar.gz: 40b9bc722ce6dd5b1cfa2d0617f97302b5127fd84dd12e17afd6f1b2a69a3058
3
+ metadata.gz: a3e49208dc5aafac57624c1bfb06a1f1d4975bc1a3ea1739b170cd97b4805f80
4
+ data.tar.gz: 631bb42bb4bb78cb6bda141e062e317edfb49fc01bbf6e4ca65036efc5175c12
5
5
  SHA512:
6
- metadata.gz: fc6192ec83e3eee164d26a5958c7dd4fede162d42f5824b5922847986b6e9f6ba00dba92ceb7789de36bf5954a53974a3e1d7d509cc304fe260a8459a395aba2
7
- data.tar.gz: f3835f17d28780d2abf16943891ad189dfb17de7c44fba72115e6ee24b04b6eab321b702cf8bd93965e70464590d5d0c20d9f4a9f3cba08a63551491c9e7b195
6
+ metadata.gz: 03d36a4f2ba792570d77206897e112e74947cf951f36dbd62b94f6faefbc431735b92da833682b1e768368e9393051cc7efea784daf853ab6d927b57780ca780
7
+ data.tar.gz: 837963016cb3d8cb932796706323761ecbcdda55d9c8da0cc68d1d324ad92018e06959489273edbb7a3f0fadc817d699dd744266a3e48ce6ce1647370a77cd1d
data/README.md CHANGED
@@ -25,7 +25,7 @@ New debug.rb has several advantages:
25
25
  # Installation
26
26
 
27
27
  ```
28
- $ gem install debug --pre
28
+ $ gem install debug
29
29
  ```
30
30
 
31
31
  or specify `-Ipath/to/debug/lib` in `RUBYOPT` or each ruby command-line option, especially for debug this gem development.
@@ -33,7 +33,7 @@ or specify `-Ipath/to/debug/lib` in `RUBYOPT` or each ruby command-line option,
33
33
  If you use Bundler, write the following line to your Gemfile.
34
34
 
35
35
  ```
36
- gem "debug", ">= 1.0.0.rc"
36
+ gem "debug", ">= 1.0.0"
37
37
  ```
38
38
 
39
39
  # HOW TO USE
@@ -397,7 +397,12 @@ If there are `~/.rdbgrc.rb` is available, it is also loaded as a ruby script at
397
397
 
398
398
  On the debug console, you can use the following debug commands.
399
399
 
400
- * `Enter` repeats the last command (useful when repeating `step`s).
400
+ There are additional features:
401
+
402
+ * `<expr>` without debug command is almost same as `pp <expr>`.
403
+ * If the input line `<expr>` does *NOT* start with any debug command, the line `<expr>` will be evaluated as a Ruby expression and the result will be printed with `pp` method. So that the input `foo.bar` is same as `pp foo.bar`.
404
+ * If `<expr>` is recognized as a debug command, of course it is not evaluated as a Ruby expression, but is executed as debug command. For example, you can not evaluate such single letter local variables `i`, `b`, `n`, `c` because they are single letter debug commands. Use `p i` instead.
405
+ * `Enter` without any input repeats the last command (useful when repeating `step`s).
401
406
  * `Ctrl-D` is equal to `quit` command.
402
407
  * [debug command compare sheet - Google Sheets](https://docs.google.com/spreadsheets/d/1TlmmUDsvwK4sSIyoMv-io52BUUz__R5wpu-ComXlsw0/edit?usp=sharing)
403
408
 
@@ -529,7 +534,7 @@ The `<...>` notation means the argument.
529
534
  * Evaluate like `p <expr>` on the current frame.
530
535
  * `pp <expr>`
531
536
  * Evaluate like `pp <expr>` on the current frame.
532
- * `e[val] <expr>`
537
+ * `eval <expr>`
533
538
  * Evaluate `<expr>` on the current frame.
534
539
  * `irb`
535
540
  * Invoke `irb` on the current frame.
data/TODO.md CHANGED
@@ -3,11 +3,13 @@
3
3
  ## Basic functionality
4
4
 
5
5
  * Support Ractors
6
- * Signal (SIGINT) support
6
+ * Signal (SIGINT) trap handling
7
7
 
8
8
  ## UI
9
9
 
10
+ * Completion for Ruby's code
10
11
  * Interactive breakpoint setting
12
+ * Interactive record & play debugging
11
13
  * irb integration
12
14
  * Web browser integrated UI
13
15
 
@@ -15,13 +17,6 @@
15
17
 
16
18
  * Breakpoints
17
19
  * Lightweight pending method break points with Ruby 3.1 feature (TP:method_added)
18
- * Non-stop breakpoint but runs some code.
19
20
  * Watch points
20
21
  * Lightweight watchpoints for instance variables with Ruby 3.1 features (TP:ivar_set)
21
22
  * Faster `next`/`finish` command by specifying target code.
22
- * `set`/`show` configurations
23
- * In-memory line traces
24
- * Timemachine debugging
25
-
26
- ## Tests
27
-
data/exe/rdbg CHANGED
@@ -9,7 +9,7 @@ when :start
9
9
 
10
10
  libpath = File.join(File.expand_path(File.dirname(__dir__)), 'lib/debug')
11
11
  start_mode = config[:remote] ? "open" : 'start'
12
- cmd = config[:command] ? ARGV.shift : RbConfig.ruby
12
+ cmd = config[:command] ? ARGV.shift : (ENV['RUBY'] || RbConfig.ruby)
13
13
 
14
14
  env = ::DEBUGGER__::Config.config_to_env_hash(config)
15
15
  env['RUBYOPT'] = "-r #{libpath}/#{start_mode}"
data/lib/debug/session.rb CHANGED
@@ -303,7 +303,9 @@ module DEBUGGER__
303
303
  if @preset_command.commands.empty?
304
304
  if @preset_command.auto_continue
305
305
  @preset_command = nil
306
+
306
307
  @tc << :continue
308
+ restart_all_threads
307
309
  return
308
310
  else
309
311
  @preset_command = nil
@@ -702,10 +704,16 @@ module DEBUGGER__
702
704
  when 'pp'
703
705
  @tc << [:eval, :pp, arg.to_s]
704
706
 
705
- # * `e[val] <expr>`
707
+ # * `eval <expr>`
706
708
  # * Evaluate `<expr>` on the current frame.
707
- when 'e', 'eval', 'call'
708
- @tc << [:eval, :call, arg]
709
+ when 'eval', 'call'
710
+ if arg == nil || arg.empty?
711
+ show_help 'eval'
712
+ @ui.puts "\nTo evaluate the variable `#{cmd}`, use `pp #{cmd}` instead."
713
+ return :retry
714
+ else
715
+ @tc << [:eval, :call, arg]
716
+ end
709
717
 
710
718
  # * `irb`
711
719
  # * Invoke `irb` on the current frame.
@@ -1145,6 +1153,11 @@ module DEBUGGER__
1145
1153
  add_bp bp
1146
1154
  end
1147
1155
 
1156
+ def add_catch_breakpoint pat
1157
+ bp = CatchBreakpoint.new(pat)
1158
+ add_bp bp
1159
+ end
1160
+
1148
1161
  def add_check_breakpoint expr
1149
1162
  bp = CheckBreakpoint.new(expr)
1150
1163
  add_bp bp
@@ -356,7 +356,7 @@ module DEBUGGER__
356
356
 
357
357
  puts "eval error: #{e}"
358
358
 
359
- e.backtrace_locations.each do |loc|
359
+ e.backtrace_locations&.each do |loc|
360
360
  break if loc.path == __FILE__
361
361
  puts " #{loc}"
362
362
  end
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.0.0.rc2"
4
+ VERSION = "1.0.0"
5
5
  end
data/misc/README.md.erb CHANGED
@@ -25,7 +25,7 @@ New debug.rb has several advantages:
25
25
  # Installation
26
26
 
27
27
  ```
28
- $ gem install debug --pre
28
+ $ gem install debug
29
29
  ```
30
30
 
31
31
  or specify `-Ipath/to/debug/lib` in `RUBYOPT` or each ruby command-line option, especially for debug this gem development.
@@ -33,7 +33,7 @@ or specify `-Ipath/to/debug/lib` in `RUBYOPT` or each ruby command-line option,
33
33
  If you use Bundler, write the following line to your Gemfile.
34
34
 
35
35
  ```
36
- gem "debug", ">= 1.0.0.rc"
36
+ gem "debug", ">= 1.0.0"
37
37
  ```
38
38
 
39
39
  # HOW TO USE
@@ -370,7 +370,12 @@ If there are `~/.rdbgrc.rb` is available, it is also loaded as a ruby script at
370
370
 
371
371
  On the debug console, you can use the following debug commands.
372
372
 
373
- * `Enter` repeats the last command (useful when repeating `step`s).
373
+ There are additional features:
374
+
375
+ * `<expr>` without debug command is almost same as `pp <expr>`.
376
+ * If the input line `<expr>` does *NOT* start with any debug command, the line `<expr>` will be evaluated as a Ruby expression and the result will be printed with `pp` method. So that the input `foo.bar` is same as `pp foo.bar`.
377
+ * If `<expr>` is recognized as a debug command, of course it is not evaluated as a Ruby expression, but is executed as debug command. For example, you can not evaluate such single letter local variables `i`, `b`, `n`, `c` because they are single letter debug commands. Use `p i` instead.
378
+ * `Enter` without any input repeats the last command (useful when repeating `step`s).
374
379
  * `Ctrl-D` is equal to `quit` command.
375
380
  * [debug command compare sheet - Google Sheets](https://docs.google.com/spreadsheets/d/1TlmmUDsvwK4sSIyoMv-io52BUUz__R5wpu-ComXlsw0/edit?usp=sharing)
376
381
 
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.0.0.rc2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koichi Sasada
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-03 00:00:00.000000000 Z
11
+ date: 2021-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: irb
@@ -102,9 +102,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
102
102
  version: 2.6.0
103
103
  required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  requirements:
105
- - - ">"
105
+ - - ">="
106
106
  - !ruby/object:Gem::Version
107
- version: 1.3.1
107
+ version: '0'
108
108
  requirements: []
109
109
  rubygems_version: 3.1.6
110
110
  signing_key: