readapt 0.7.1 → 1.1.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.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +16 -14
  3. data/.rspec +2 -2
  4. data/.travis.yml +18 -13
  5. data/CHANGELOG.md +76 -53
  6. data/Gemfile +4 -4
  7. data/LICENSE.txt +21 -21
  8. data/README.md +37 -29
  9. data/Rakefile +14 -25
  10. data/bin/console +14 -14
  11. data/bin/setup +8 -8
  12. data/exe/readapt +5 -5
  13. data/ext/readapt/breakpoints.c +83 -88
  14. data/ext/readapt/breakpoints.h +11 -12
  15. data/ext/readapt/extconf.rb +0 -0
  16. data/ext/readapt/frame.c +137 -0
  17. data/ext/readapt/frame.h +17 -0
  18. data/ext/readapt/hash_table.c +211 -212
  19. data/ext/readapt/hash_table.h +30 -32
  20. data/ext/readapt/inspector.c +51 -0
  21. data/ext/readapt/inspector.h +8 -0
  22. data/ext/readapt/monitor.c +40 -27
  23. data/ext/readapt/monitor.h +0 -0
  24. data/ext/readapt/normalize.c +59 -53
  25. data/ext/readapt/normalize.h +7 -7
  26. data/ext/readapt/readapt.c +18 -16
  27. data/ext/readapt/stack.c +86 -0
  28. data/ext/readapt/stack.h +20 -0
  29. data/ext/readapt/threads.c +111 -17
  30. data/ext/readapt/threads.h +11 -4
  31. data/lib/readapt.rb +21 -19
  32. data/lib/readapt/adapter.rb +98 -138
  33. data/lib/readapt/breakpoint.rb +20 -13
  34. data/lib/readapt/data_reader.rb +62 -0
  35. data/lib/readapt/debugger.rb +220 -204
  36. data/lib/readapt/error.rb +63 -0
  37. data/lib/readapt/finder.rb +20 -20
  38. data/lib/readapt/frame.rb +40 -42
  39. data/lib/readapt/input.rb +7 -0
  40. data/lib/readapt/message.rb +62 -59
  41. data/lib/readapt/message/attach.rb +11 -11
  42. data/lib/readapt/message/base.rb +32 -32
  43. data/lib/readapt/message/configuration_done.rb +11 -11
  44. data/lib/readapt/message/continue.rb +15 -15
  45. data/lib/readapt/message/disconnect.rb +13 -14
  46. data/lib/readapt/message/evaluate.rb +18 -18
  47. data/lib/readapt/message/initialize.rb +13 -13
  48. data/lib/readapt/message/launch.rb +11 -11
  49. data/lib/readapt/message/next.rb +12 -12
  50. data/lib/readapt/message/pause.rb +11 -11
  51. data/lib/readapt/message/scopes.rb +26 -25
  52. data/lib/readapt/message/set_breakpoints.rb +25 -25
  53. data/lib/readapt/message/set_exception_breakpoints.rb +8 -8
  54. data/lib/readapt/message/stack_trace.rb +38 -26
  55. data/lib/readapt/message/step_in.rb +11 -11
  56. data/lib/readapt/message/step_out.rb +11 -11
  57. data/lib/readapt/message/threads.rb +18 -18
  58. data/lib/readapt/message/variables.rb +61 -57
  59. data/lib/readapt/monitor.rb +0 -0
  60. data/lib/readapt/output.rb +25 -0
  61. data/lib/readapt/references.rb +27 -0
  62. data/lib/readapt/server.rb +22 -0
  63. data/lib/readapt/shell.rb +104 -39
  64. data/lib/readapt/snapshot.rb +1 -13
  65. data/lib/readapt/thread.rb +23 -39
  66. data/lib/readapt/variable.rb +1 -1
  67. data/lib/readapt/version.rb +3 -3
  68. data/readapt.gemspec +39 -39
  69. metadata +19 -8
  70. data/lib/readapt/location.rb +0 -25
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d414f01a0f666c2b96e522ca8eaed42a796cbb929c46d13e813837cad1bafc0
4
- data.tar.gz: 18be9da48ce7f0ea2d2c1bcf038492fc73945617f9b650c51fedb69ae0aef8f5
3
+ metadata.gz: 295695183ba788850e623e648d35a63a4c9ecbf43c3c94c1dc927669fd5c2b9f
4
+ data.tar.gz: ac4e9d7285ba410753e5a20e0043ca4fa805d491c48a3bc02a6337ecec801454
5
5
  SHA512:
6
- metadata.gz: aa3fdb1fc8fc12a58dfec52c6f3cabe7876165efcbc56f88ee0c1f5ce1f734e79a2b53f4340be9f4ade0491c96ac0aec0683007022f93c598a70b25ef6b2606d
7
- data.tar.gz: 3087142261e3e42add244d763dd1555db7f0318839896e342d4cddada267a8538801cf66c1bb952e8f11e26166a50d6b8efcb216fbab7d1d7f1be381acd0e147
6
+ metadata.gz: eea4ad41e690bc2f3ee820dde72da7555d8d856a722f3607a8defe35fb134128ca3af70a3711d9cd8db77a074d54003631b6946f533687cd2523af4b67bd1847
7
+ data.tar.gz: 83801884e0a1a8f043920ced5938c5095cb0a98c10c9e9cb4fa530600a67024a7aa5d443ea5499d11c194b438b5126bc4571793565b8d675cbe8dfe657d46d73
data/.gitignore CHANGED
@@ -1,14 +1,16 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
- *.so
10
- /.vscode/
11
- Gemfile.lock
12
-
13
- # rspec failure tracking
14
- .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
@@ -1,13 +1,18 @@
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
- before_script:
11
- - bundle install
12
- - rake compile
13
- 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
+ matrix:
12
+ include:
13
+ - rvm: 2.6
14
+ os: osx
15
+ before_script:
16
+ - bundle install
17
+ - rake compile
18
+ script: rspec
@@ -1,53 +1,76 @@
1
- # 0.7.1 - October 13, 2019
2
- - Debugger sets program name
3
-
4
- # 0.7.0 - October 12, 2019
5
- - Conditional breakpoints
6
- - Graceful shutdown (#2)
7
-
8
- # 0.6.2 - September 10, 2019
9
- - Monitor processes all new threads
10
- - Discard buggy output redirection
11
-
12
- # 0.6.1 - September 7, 2019
13
- - Ignore nilable paths in thread events
14
-
15
- # 0.6.0 - August 26, 2019
16
- - Evaluate in REPL
17
-
18
- # 0.5.0 - August 20, 2019
19
- - Monitor stores paths as C strings
20
- - Fixed malloc size for normalized paths
21
- - Fixed table insertion before existing items
22
-
23
- # 0.4.0 - August 19. 2019
24
- - Breakpoints use C implementation of hash tables
25
- - Simplified entry point detection
26
-
27
- # 0.3.5 - August 16, 2019
28
- - Variables message checks for null frames
29
-
30
- # 0.3.4 - August 12, 2019
31
- - Monitor normalizes paths.
32
-
33
- # 0.3.3 - August 12, 2019
34
- - Remove RB_NIL_P for backwards compatibility
35
-
36
- # 0.3.2 - August 11, 2019
37
- - Unnecessary thread in Backport.run
38
-
39
- # 0.3.1 - August 10. 2019
40
- - Require Ruby >= 2.2
41
-
42
- # 0.3.0 - August 9. 2019
43
- - Synchronized events
44
- - Handle multiple paused threads
45
- - Isolate the Backport machine
46
-
47
- # 0.2.0 - August 7, 2019
48
- - Find external programs
49
- - Improved stdout/stderr redirects
50
- - Individual thread control
51
-
52
- # 0.1.0 - August 5, 2019
53
- - First release
1
+ # 1.1.1 - December 15, 2020
2
+ - Update rake
3
+ - Fix Encoding::UndefinedConversionError (#8)
4
+
5
+ # 1.1.0 - September 13, 2020
6
+ - Use 32-bit integers for variable and thread references (#6)
7
+
8
+ # 1.0.0 - February 9, 2020
9
+ - Refactor server and target process communication
10
+ - STDIO server support
11
+ - Fix zombie process bugs
12
+ - Sort variables alphabetically
13
+
14
+ # 0.8.1 - November 14, 2019
15
+ - Header name conflict in MacOS (#4)
16
+
17
+ # 0.8.0 - November 9, 2019
18
+ - Multiple frames
19
+ - Flush output on disconnect
20
+ - Use Ruby debug inspector for stack frames
21
+ - Faster line processing
22
+ - Monitor disables GC
23
+
24
+ # 0.7.1 - October 13, 2019
25
+ - Debugger sets program name
26
+
27
+ # 0.7.0 - October 12, 2019
28
+ - Conditional breakpoints
29
+ - Graceful shutdown (#2)
30
+
31
+ # 0.6.2 - September 10, 2019
32
+ - Monitor processes all new threads
33
+ - Discard buggy output redirection
34
+
35
+ # 0.6.1 - September 7, 2019
36
+ - Ignore nilable paths in thread events
37
+
38
+ # 0.6.0 - August 26, 2019
39
+ - Evaluate in REPL
40
+
41
+ # 0.5.0 - August 20, 2019
42
+ - Monitor stores paths as C strings
43
+ - Fixed malloc size for normalized paths
44
+ - Fixed table insertion before existing items
45
+
46
+ # 0.4.0 - August 19. 2019
47
+ - Breakpoints use C implementation of hash tables
48
+ - Simplified entry point detection
49
+
50
+ # 0.3.5 - August 16, 2019
51
+ - Variables message checks for null frames
52
+
53
+ # 0.3.4 - August 12, 2019
54
+ - Monitor normalizes paths.
55
+
56
+ # 0.3.3 - August 12, 2019
57
+ - Remove RB_NIL_P for backwards compatibility
58
+
59
+ # 0.3.2 - August 11, 2019
60
+ - Unnecessary thread in Backport.run
61
+
62
+ # 0.3.1 - August 10. 2019
63
+ - Require Ruby >= 2.2
64
+
65
+ # 0.3.0 - August 9. 2019
66
+ - Synchronized events
67
+ - Handle multiple paused threads
68
+ - Isolate the Backport machine
69
+
70
+ # 0.2.0 - August 7, 2019
71
+ - Find external programs
72
+ - Improved stdout/stderr redirects
73
+ - Individual thread control
74
+
75
+ # 0.1.0 - August 5, 2019
76
+ - 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
@@ -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,29 +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
- Readapt is available for Visual Studio Code in the [Ruby Debug extension](https://marketplace.visualstudio.com/items?itemName=castwide.ruby-debug).
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,25 +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
15
-
16
- namespace :install do
17
- desc 'Install on Windows'
18
- task :win do
19
- Dir.mktmpdir do |tmp|
20
- gemfile = File.join(tmp, 'readapt.gem')
21
- system("gem build readapt.gemspec -o #{gemfile}") &&
22
- system("gem install #{gemfile}")
23
- end
24
- end
25
- 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
@@ -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
@@ -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)
@@ -1,88 +1,83 @@
1
- #include "ruby.h"
2
- #include "hash_table.h"
3
-
4
- static VALUE m_Breakpoints;
5
- ht_hash_table *ht;
6
-
7
- void breakpoints_set(char *file, long *lines)
8
- {
9
-
10
- }
11
-
12
- static VALUE breakpoints_set_s(VALUE self, VALUE file, VALUE lines)
13
- {
14
- long length = NUM2LONG(rb_funcall(lines, rb_intern("length"), 0));
15
- long *ll;
16
- long i;
17
-
18
- ll = malloc(sizeof(long) * length);
19
- for (i = 0; i < length; i++)
20
- {
21
- ll[i] = NUM2LONG(rb_ary_entry(lines, i));
22
- }
23
- ht_insert(ht, StringValueCStr(file), ll, length);
24
- free(ll);
25
- return Qnil;
26
- }
27
-
28
- void breakpoints_delete(char *file)
29
- {
30
-
31
- }
32
-
33
- static VALUE breakpoints_delete_s(VALUE self, VALUE file)
34
- {
35
- return Qnil;
36
- }
37
-
38
- int breakpoints_match(char *file, long line)
39
- {
40
- ht_long_array *lines;
41
- long i;
42
-
43
- lines = ht_search(ht, file);
44
- if (lines != NULL)
45
- {
46
- for (i = 0; i < lines->size; i++)
47
- {
48
- if (lines->items[i] == line)
49
- {
50
- return 1;
51
- }
52
- }
53
- }
54
- return 0;
55
- }
56
-
57
- // int breakpoints_match(char *file, long line)
58
- // {
59
- // return breakpoints_match_id(rb_intern(file), line);
60
- // }
61
-
62
- static VALUE breakpoints_match_s(VALUE self, VALUE file, VALUE line)
63
- {
64
- return breakpoints_match(StringValueCStr(file), NUM2LONG(line)) == 0 ? Qfalse : Qtrue;
65
- }
66
-
67
- static VALUE breakpoints_clear_s(VALUE self)
68
- {
69
- ht_del_hash_table(ht);
70
- ht = ht_new();
71
- return Qnil;
72
- }
73
-
74
- long breakpoints_files()
75
- {
76
- return ht->size;
77
- }
78
-
79
- void initialize_breakpoints(VALUE m_Readapt)
80
- {
81
- m_Breakpoints = rb_define_module_under(m_Readapt, "Breakpoints");
82
- rb_define_singleton_method(m_Breakpoints, "set", breakpoints_set_s, 2);
83
- rb_define_singleton_method(m_Breakpoints, "delete", breakpoints_delete_s, 1);
84
- rb_define_singleton_method(m_Breakpoints, "match", breakpoints_match_s, 2);
85
- rb_define_singleton_method(m_Breakpoints, "clear", breakpoints_clear_s, 0);
86
-
87
- ht = ht_new(); // TODO Need to free?
88
- }
1
+ #include "ruby.h"
2
+ #include "hash_table.h"
3
+
4
+ static VALUE m_Breakpoints;
5
+ ht_hash_table *ht;
6
+
7
+ void breakpoints_set(char *file, long *lines)
8
+ {
9
+
10
+ }
11
+
12
+ static VALUE breakpoints_set_s(VALUE self, VALUE file, VALUE lines)
13
+ {
14
+ long length = NUM2LONG(rb_funcall(lines, rb_intern("length"), 0));
15
+ long *ll;
16
+ long i;
17
+
18
+ ll = malloc(sizeof(long) * length);
19
+ for (i = 0; i < length; i++)
20
+ {
21
+ ll[i] = NUM2LONG(rb_ary_entry(lines, i));
22
+ }
23
+ ht_insert(ht, StringValueCStr(file), ll, length);
24
+ free(ll);
25
+ return Qnil;
26
+ }
27
+
28
+ void breakpoints_delete(char *file)
29
+ {
30
+
31
+ }
32
+
33
+ static VALUE breakpoints_delete_s(VALUE self, VALUE file)
34
+ {
35
+ return Qnil;
36
+ }
37
+
38
+ int breakpoints_match(char *file, long line)
39
+ {
40
+ ht_long_array *lines;
41
+ long i;
42
+
43
+ lines = ht_search(ht, file);
44
+ if (lines != NULL)
45
+ {
46
+ for (i = 0; i < lines->size; i++)
47
+ {
48
+ if (lines->items[i] == line)
49
+ {
50
+ return 1;
51
+ }
52
+ }
53
+ }
54
+ return 0;
55
+ }
56
+
57
+ static VALUE breakpoints_match_s(VALUE self, VALUE file, VALUE line)
58
+ {
59
+ return breakpoints_match(StringValueCStr(file), NUM2LONG(line)) == 0 ? Qfalse : Qtrue;
60
+ }
61
+
62
+ static VALUE breakpoints_clear_s(VALUE self)
63
+ {
64
+ ht_del_hash_table(ht);
65
+ ht = ht_new();
66
+ return Qnil;
67
+ }
68
+
69
+ long breakpoints_files()
70
+ {
71
+ return ht->size;
72
+ }
73
+
74
+ void initialize_breakpoints(VALUE m_Readapt)
75
+ {
76
+ m_Breakpoints = rb_define_module_under(m_Readapt, "Breakpoints");
77
+ rb_define_singleton_method(m_Breakpoints, "set", breakpoints_set_s, 2);
78
+ rb_define_singleton_method(m_Breakpoints, "delete", breakpoints_delete_s, 1);
79
+ rb_define_singleton_method(m_Breakpoints, "match", breakpoints_match_s, 2);
80
+ rb_define_singleton_method(m_Breakpoints, "clear", breakpoints_clear_s, 0);
81
+
82
+ ht = ht_new(); // TODO Need to free?
83
+ }