readapt 1.4.4 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rspec.yml +38 -0
  3. data/.gitignore +16 -16
  4. data/.rspec +2 -2
  5. data/.travis.yml +19 -19
  6. data/CHANGELOG.md +103 -100
  7. data/Gemfile +4 -4
  8. data/LICENSE.txt +21 -21
  9. data/README.md +37 -37
  10. data/Rakefile +14 -14
  11. data/bin/console +14 -14
  12. data/bin/setup +8 -8
  13. data/exe/readapt +5 -5
  14. data/ext/readapt/breakpoints.c +83 -83
  15. data/ext/readapt/breakpoints.h +11 -11
  16. data/ext/readapt/extconf.rb +0 -0
  17. data/ext/readapt/frame.c +137 -137
  18. data/ext/readapt/frame.h +17 -17
  19. data/ext/readapt/inspector.c +51 -51
  20. data/ext/readapt/inspector.h +8 -8
  21. data/ext/readapt/lookup_table.c +211 -211
  22. data/ext/readapt/lookup_table.h +30 -30
  23. data/ext/readapt/monitor.c +0 -0
  24. data/ext/readapt/monitor.h +0 -0
  25. data/ext/readapt/normalize.c +62 -62
  26. data/ext/readapt/normalize.h +7 -7
  27. data/ext/readapt/readapt.c +18 -18
  28. data/ext/readapt/stack.c +86 -86
  29. data/ext/readapt/stack.h +20 -20
  30. data/ext/readapt/threads.c +1 -1
  31. data/ext/readapt/threads.h +0 -0
  32. data/lib/readapt/adapter.rb +98 -98
  33. data/lib/readapt/breakpoint.rb +21 -21
  34. data/lib/readapt/data_reader.rb +62 -62
  35. data/lib/readapt/debugger.rb +227 -227
  36. data/lib/readapt/error.rb +63 -63
  37. data/lib/readapt/finder.rb +34 -34
  38. data/lib/readapt/frame.rb +40 -40
  39. data/lib/readapt/input.rb +7 -7
  40. data/lib/readapt/message/attach.rb +11 -11
  41. data/lib/readapt/message/base.rb +32 -32
  42. data/lib/readapt/message/configuration_done.rb +11 -11
  43. data/lib/readapt/message/continue.rb +15 -15
  44. data/lib/readapt/message/disconnect.rb +13 -13
  45. data/lib/readapt/message/evaluate.rb +19 -19
  46. data/lib/readapt/message/initialize.rb +21 -21
  47. data/lib/readapt/message/launch.rb +11 -11
  48. data/lib/readapt/message/next.rb +12 -12
  49. data/lib/readapt/message/pause.rb +11 -11
  50. data/lib/readapt/message/scopes.rb +26 -26
  51. data/lib/readapt/message/set_breakpoints.rb +25 -25
  52. data/lib/readapt/message/set_exception_breakpoints.rb +11 -11
  53. data/lib/readapt/message/stack_trace.rb +38 -38
  54. data/lib/readapt/message/step_in.rb +11 -11
  55. data/lib/readapt/message/step_out.rb +11 -11
  56. data/lib/readapt/message/threads.rb +18 -18
  57. data/lib/readapt/message/variables.rb +53 -53
  58. data/lib/readapt/message.rb +62 -62
  59. data/lib/readapt/monitor.rb +0 -0
  60. data/lib/readapt/output.rb +25 -25
  61. data/lib/readapt/references.rb +27 -27
  62. data/lib/readapt/server.rb +22 -22
  63. data/lib/readapt/shell.rb +104 -104
  64. data/lib/readapt/snapshot.rb +0 -0
  65. data/lib/readapt/thread.rb +20 -20
  66. data/lib/readapt/variable.rb +0 -0
  67. data/lib/readapt/version.rb +3 -3
  68. data/lib/readapt.rb +21 -21
  69. data/readapt.gemspec +39 -39
  70. metadata +8 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 596a0d15e913469e44a32f14c5d5d2b0374c4919e05322ba5632e70b24b9d5bd
4
- data.tar.gz: fc34619e1c4767cc047497bbe792c957fd63f879d02ceb2b069d9b0b18bad2be
3
+ metadata.gz: c612b2df3f1e8a7b5f9ae5653bec9068b48d8dc7fc89ac46b8fd110a1a5ba180
4
+ data.tar.gz: d668b1b77b5b174ab48e17d89d53fee501f5322f2a13cc2722532b99a3f049d2
5
5
  SHA512:
6
- metadata.gz: e0df6dd24e88988845ae549221c08fa9a3443d5910903edd1c59198564c239c869738c19d9d2f8d1e2c5a269f274787ab6df2b0e8f64e5cef5923889fd00c532
7
- data.tar.gz: b4f3e78e520977ecda0bc7b7b0c36d2dc38510b86ae690b216deb55e295e51de9bfd02e4555bf9136fdc8ab5951a4ff8e9eeff1cc0c877e40305048bce54bd29
6
+ metadata.gz: 10274443ec52185275d9037622e969563e3fa7a333c39482ea76d0ef72cb736332c19a695dfc0f6d34d45d61542b16b8e085f367a9fd92d9f7f260fdf6a8419d
7
+ data.tar.gz: 832f9d04858f4b9f3fc6c7883fb10e7aed9d1ef1efa1861ca1c79c7de6cfe11b974b475b704de6e413b1f4d5d83e858f24128301db45372a447395c81a1981ac
@@ -0,0 +1,38 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with rspec.
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: RSpec
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ jobs:
20
+ test:
21
+
22
+ runs-on: ubuntu-latest
23
+ strategy:
24
+ matrix:
25
+ ruby-version: ['2.6', '2.7', '3.0']
26
+
27
+ steps:
28
+ - uses: actions/checkout@v3
29
+ - name: Set up Ruby
30
+ uses: ruby/setup-ruby@v1
31
+ with:
32
+ ruby-version: ${{ matrix.ruby-version }}
33
+ bundler-cache: false
34
+ - run: bundle install
35
+ - name: Compile native extension
36
+ run: rake compile
37
+ - name: Run tests
38
+ run: bundle exec rspec
data/.gitignore CHANGED
@@ -1,16 +1,16 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
- *.so
10
- *.bundle
11
- /.vscode/
12
- .project
13
- Gemfile.lock
14
-
15
- # rspec failure tracking
16
- .rspec_status
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ *.so
10
+ *.bundle
11
+ /.vscode/
12
+ .project
13
+ Gemfile.lock
14
+
15
+ # rspec failure tracking
16
+ .rspec_status
data/.rspec CHANGED
@@ -1,2 +1,2 @@
1
- --color
2
- --require spec_helper
1
+ --color
2
+ --require spec_helper
data/.travis.yml CHANGED
@@ -1,19 +1,19 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- rvm:
5
- - 2.2
6
- - 2.3
7
- - 2.4
8
- - 2.5
9
- - 2.6
10
- - 2.7
11
- - 3.0
12
- matrix:
13
- include:
14
- - rvm: 2.7
15
- os: osx
16
- before_script:
17
- - bundle install
18
- - rake compile
19
- script: rspec
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ rvm:
5
+ - 2.2
6
+ - 2.3
7
+ - 2.4
8
+ - 2.5
9
+ - 2.6
10
+ - 2.7
11
+ - 3.0
12
+ matrix:
13
+ include:
14
+ - rvm: 2.7
15
+ os: osx
16
+ before_script:
17
+ - bundle install
18
+ - rake compile
19
+ script: rspec
data/CHANGELOG.md CHANGED
@@ -1,100 +1,103 @@
1
- # 1.4.4 - May 27, 2022
2
- - Evaluate expressions in global scope when frame is unavailable
3
-
4
- # 1.4.3 - July 23, 2021
5
- - Remove unneeded debug output
6
-
7
- # 1.4.2 - July 23, 2021
8
- - Fix path normalizing in Windows
9
-
10
- # 1.4.1 - July 8, 2021
11
- - Thread object handling
12
- - Rescue StandardError instead of Exception
13
-
14
- # 1.4.0 - June 14, 2021
15
- - Configurable exception breakpoints
16
- - Update backport gem
17
-
18
- # 1.3.0 - June 3, 2021
19
- - Variables message reads class/instance variables
20
-
21
- # 1.2.0 - February 24, 2021
22
- - Pause on exceptions
23
- - Refactored lookup tables
24
-
25
- # 1.1.1 - December 15, 2020
26
- - Update rake
27
- - Fix Encoding::UndefinedConversionError (#8)
28
-
29
- # 1.1.0 - September 13, 2020
30
- - Use 32-bit integers for variable and thread references (#6)
31
-
32
- # 1.0.0 - February 9, 2020
33
- - Refactor server and target process communication
34
- - STDIO server support
35
- - Fix zombie process bugs
36
- - Sort variables alphabetically
37
-
38
- # 0.8.1 - November 14, 2019
39
- - Header name conflict in MacOS (#4)
40
-
41
- # 0.8.0 - November 9, 2019
42
- - Multiple frames
43
- - Flush output on disconnect
44
- - Use Ruby debug inspector for stack frames
45
- - Faster line processing
46
- - Monitor disables GC
47
-
48
- # 0.7.1 - October 13, 2019
49
- - Debugger sets program name
50
-
51
- # 0.7.0 - October 12, 2019
52
- - Conditional breakpoints
53
- - Graceful shutdown (#2)
54
-
55
- # 0.6.2 - September 10, 2019
56
- - Monitor processes all new threads
57
- - Discard buggy output redirection
58
-
59
- # 0.6.1 - September 7, 2019
60
- - Ignore nilable paths in thread events
61
-
62
- # 0.6.0 - August 26, 2019
63
- - Evaluate in REPL
64
-
65
- # 0.5.0 - August 20, 2019
66
- - Monitor stores paths as C strings
67
- - Fixed malloc size for normalized paths
68
- - Fixed table insertion before existing items
69
-
70
- # 0.4.0 - August 19. 2019
71
- - Breakpoints use C implementation of hash tables
72
- - Simplified entry point detection
73
-
74
- # 0.3.5 - August 16, 2019
75
- - Variables message checks for null frames
76
-
77
- # 0.3.4 - August 12, 2019
78
- - Monitor normalizes paths.
79
-
80
- # 0.3.3 - August 12, 2019
81
- - Remove RB_NIL_P for backwards compatibility
82
-
83
- # 0.3.2 - August 11, 2019
84
- - Unnecessary thread in Backport.run
85
-
86
- # 0.3.1 - August 10. 2019
87
- - Require Ruby >= 2.2
88
-
89
- # 0.3.0 - August 9. 2019
90
- - Synchronized events
91
- - Handle multiple paused threads
92
- - Isolate the Backport machine
93
-
94
- # 0.2.0 - August 7, 2019
95
- - Find external programs
96
- - Improved stdout/stderr redirects
97
- - Individual thread control
98
-
99
- # 0.1.0 - August 5, 2019
100
- - First release
1
+ # 2.0.0
2
+ - Extension update for Ruby 3.3
3
+
4
+ # 1.4.4 - May 27, 2022
5
+ - Evaluate expressions in global scope when frame is unavailable
6
+
7
+ # 1.4.3 - July 23, 2021
8
+ - Remove unneeded debug output
9
+
10
+ # 1.4.2 - July 23, 2021
11
+ - Fix path normalizing in Windows
12
+
13
+ # 1.4.1 - July 8, 2021
14
+ - Thread object handling
15
+ - Rescue StandardError instead of Exception
16
+
17
+ # 1.4.0 - June 14, 2021
18
+ - Configurable exception breakpoints
19
+ - Update backport gem
20
+
21
+ # 1.3.0 - June 3, 2021
22
+ - Variables message reads class/instance variables
23
+
24
+ # 1.2.0 - February 24, 2021
25
+ - Pause on exceptions
26
+ - Refactored lookup tables
27
+
28
+ # 1.1.1 - December 15, 2020
29
+ - Update rake
30
+ - Fix Encoding::UndefinedConversionError (#8)
31
+
32
+ # 1.1.0 - September 13, 2020
33
+ - Use 32-bit integers for variable and thread references (#6)
34
+
35
+ # 1.0.0 - February 9, 2020
36
+ - Refactor server and target process communication
37
+ - STDIO server support
38
+ - Fix zombie process bugs
39
+ - Sort variables alphabetically
40
+
41
+ # 0.8.1 - November 14, 2019
42
+ - Header name conflict in MacOS (#4)
43
+
44
+ # 0.8.0 - November 9, 2019
45
+ - Multiple frames
46
+ - Flush output on disconnect
47
+ - Use Ruby debug inspector for stack frames
48
+ - Faster line processing
49
+ - Monitor disables GC
50
+
51
+ # 0.7.1 - October 13, 2019
52
+ - Debugger sets program name
53
+
54
+ # 0.7.0 - October 12, 2019
55
+ - Conditional breakpoints
56
+ - Graceful shutdown (#2)
57
+
58
+ # 0.6.2 - September 10, 2019
59
+ - Monitor processes all new threads
60
+ - Discard buggy output redirection
61
+
62
+ # 0.6.1 - September 7, 2019
63
+ - Ignore nilable paths in thread events
64
+
65
+ # 0.6.0 - August 26, 2019
66
+ - Evaluate in REPL
67
+
68
+ # 0.5.0 - August 20, 2019
69
+ - Monitor stores paths as C strings
70
+ - Fixed malloc size for normalized paths
71
+ - Fixed table insertion before existing items
72
+
73
+ # 0.4.0 - August 19. 2019
74
+ - Breakpoints use C implementation of hash tables
75
+ - Simplified entry point detection
76
+
77
+ # 0.3.5 - August 16, 2019
78
+ - Variables message checks for null frames
79
+
80
+ # 0.3.4 - August 12, 2019
81
+ - Monitor normalizes paths.
82
+
83
+ # 0.3.3 - August 12, 2019
84
+ - Remove RB_NIL_P for backwards compatibility
85
+
86
+ # 0.3.2 - August 11, 2019
87
+ - Unnecessary thread in Backport.run
88
+
89
+ # 0.3.1 - August 10. 2019
90
+ - Require Ruby >= 2.2
91
+
92
+ # 0.3.0 - August 9. 2019
93
+ - Synchronized events
94
+ - Handle multiple paused threads
95
+ - Isolate the Backport machine
96
+
97
+ # 0.2.0 - August 7, 2019
98
+ - Find external programs
99
+ - Improved stdout/stderr redirects
100
+ - Individual thread control
101
+
102
+ # 0.1.0 - August 5, 2019
103
+ - First release
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in readapt.gemspec
4
- gemspec
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in readapt.gemspec
4
+ gemspec
data/LICENSE.txt CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2019 Fred Snyder
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Fred Snyder
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,37 +1,37 @@
1
- # Readapt
2
-
3
- A Ruby debugger that supports the [Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/specification).
4
-
5
- *This gem is currently in early development*.
6
-
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'readapt'
13
- ```
14
-
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install readapt
22
-
23
- ## Usage
24
-
25
- Run `readapt serve` to start the server. The default client connection is host 127.0.0.1, port 1234.
26
-
27
- ## Integrations
28
-
29
- Plug-ins and extensions using Readapt are available for the following editors:
30
-
31
- * **Visual Studio Code**
32
- * Marketplace: https://marketplace.visualstudio.com/items?itemName=castwide.ruby-debug
33
- * GitHub: https://github.com/castwide/vscode-ruby-debug
34
-
35
- * **Eclipse**
36
- * Marketplace: https://marketplace.eclipse.org/content/ruby-solargraph
37
- * GitHub: https://github.com/PyvesB/eclipse-solargraph
1
+ # Readapt
2
+
3
+ A Ruby debugger that supports the [Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/specification).
4
+
5
+ *This gem is currently in early development*.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'readapt'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install readapt
22
+
23
+ ## Usage
24
+
25
+ Run `readapt serve` to start the server. The default client connection is host 127.0.0.1, port 1234.
26
+
27
+ ## Integrations
28
+
29
+ Plug-ins and extensions using Readapt are available for the following editors:
30
+
31
+ * **Visual Studio Code**
32
+ * Marketplace: https://marketplace.visualstudio.com/items?itemName=castwide.ruby-debug
33
+ * GitHub: https://github.com/castwide/vscode-ruby-debug
34
+
35
+ * **Eclipse**
36
+ * Marketplace: https://marketplace.eclipse.org/content/ruby-solargraph
37
+ * GitHub: https://github.com/PyvesB/eclipse-solargraph
data/Rakefile CHANGED
@@ -1,14 +1,14 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
- require "rake/extensiontask"
4
- require 'readapt/version'
5
- require 'tmpdir'
6
-
7
- RSpec::Core::RakeTask.new(:spec)
8
-
9
- task :default => :spec
10
-
11
- # Compile tasks
12
- Rake::ExtensionTask.new "readapt" do |ext|
13
- ext.lib_dir = "lib/readapt"
14
- end
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+ require "rake/extensiontask"
4
+ require 'readapt/version'
5
+ require 'tmpdir'
6
+
7
+ RSpec::Core::RakeTask.new(:spec)
8
+
9
+ task :default => :spec
10
+
11
+ # Compile tasks
12
+ Rake::ExtensionTask.new "readapt" do |ext|
13
+ ext.lib_dir = "lib/readapt"
14
+ end
data/bin/console CHANGED
@@ -1,14 +1,14 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "readapt"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "readapt"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup CHANGED
@@ -1,8 +1,8 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/exe/readapt CHANGED
@@ -1,5 +1,5 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "readapt"
4
-
5
- Readapt::Shell.start(ARGV)
1
+ #!/usr/bin/env ruby
2
+
3
+ require "readapt"
4
+
5
+ Readapt::Shell.start(ARGV)