debase 0.2.3.beta2 → 0.2.3.beta3

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
- SHA1:
3
- metadata.gz: 6d0b4ffcf1b88d08e500071b97bd7d2679119dd8
4
- data.tar.gz: aea5553eb0fbac211cf081807605bf4226dfd08c
2
+ SHA256:
3
+ metadata.gz: 54843a17de6b5740fea57e2c8ca1759d071748beed251dd0a13a4f3737dbd898
4
+ data.tar.gz: 6f60ddfba72e780a4da776300b35f9a0d66b077d09e8453ba586175a3175c0e6
5
5
  SHA512:
6
- metadata.gz: 7e8c2f94ef8590ee3e94214f641434e5e9d67dc8eb8094830502666772a1896b8df22d9733e885213d6c28018eff2c524e680d12c906baeb7e47f68effdac90b
7
- data.tar.gz: a562cc46f2128e1fe54a71052aed7451687c6a2d28a238a7ae7994e8cc2499e23de94c6c93d5fc00c53eb7a718128cd92b543582e7061d78f9e688a3aae1c03b
6
+ metadata.gz: 1d6c8944d7e52516ac50f75b913f7680ff5af7b84563f4b12c74308d6b5677a0b629fd2d941f4a4b82d9374535a66ff5d2760c50e7e903cde1db40f40599a142
7
+ data.tar.gz: a007f10480e1f457a7aefd38ef947804dfc9712f41359c49ad2d6e45610ec489759467197e5e29f9214621fbd5dbdcabb9bef3e8114b3b24b19ee5c9a91696ce
@@ -10,7 +10,8 @@ rvm:
10
10
  - 2.2
11
11
  - 2.3
12
12
  - 2.4.2
13
- - 2.5.0
13
+ - 2.5.3
14
+ - 2.6.0
14
15
  - ruby-head
15
16
 
16
17
  matrix:
@@ -637,7 +637,7 @@ Debase_enable_file_filtering(VALUE self, VALUE value)
637
637
  return value;
638
638
  }
639
639
 
640
- #if RUBY_API_VERSION_CODE >= 20500
640
+ #if RUBY_API_VERSION_CODE >= 20500 && !(RUBY_RELEASE_YEAR == 2017 && RUBY_RELEASE_MONTH == 10 && RUBY_RELEASE_DAY == 10)
641
641
  static const rb_iseq_t *
642
642
  my_iseqw_check(VALUE iseqw)
643
643
  {
@@ -654,17 +654,28 @@ Debase_enable_file_filtering(VALUE self, VALUE value)
654
654
  }
655
655
 
656
656
  static void
657
- Debase_set_trace_flag_to_iseq(VALUE self, VALUE rb_iseq)
658
- {
657
+ Debase_set_trace_flag_to_iseq(VALUE self, VALUE rb_iseq) {
659
658
  if (!SPECIAL_CONST_P(rb_iseq) && RBASIC_CLASS(rb_iseq) == rb_cISeq) {
660
659
  rb_iseq_t *iseq = my_iseqw_check(rb_iseq);
661
660
  rb_iseq_trace_set(iseq, RUBY_EVENT_TRACEPOINT_ALL);
662
661
  }
663
662
  }
663
+
664
+ static void
665
+ Debase_unset_trace_flags(VALUE self, VALUE rb_iseq) {
666
+ if (!SPECIAL_CONST_P(rb_iseq) && RBASIC_CLASS(rb_iseq) == rb_cISeq) {
667
+ rb_iseq_t *iseq = my_iseqw_check(rb_iseq);
668
+ rb_iseq_trace_set(iseq, RUBY_EVENT_NONE);
669
+ }
670
+ }
664
671
  #else
665
672
  static void
666
673
  Debase_set_trace_flag_to_iseq(VALUE self, VALUE rb_iseq) {
667
674
  }
675
+
676
+ static void
677
+ Debase_unset_trace_flags(VALUE self, VALUE rb_iseq) {
678
+ }
668
679
  #endif
669
680
 
670
681
  static VALUE
@@ -712,6 +723,9 @@ Init_debase_internals()
712
723
  rb_define_module_function(mDebase, "init_variables", Debase_init_variables, 0);
713
724
  rb_define_module_function(mDebase, "set_trace_flag_to_iseq", Debase_set_trace_flag_to_iseq, 1);
714
725
 
726
+ //use only for tests
727
+ rb_define_module_function(mDebase, "unset_iseq_flags", Debase_unset_trace_flags, 1);
728
+
715
729
  idAlive = rb_intern("alive?");
716
730
  idAtLine = rb_intern("at_line");
717
731
  idAtBreakpoint = rb_intern("at_breakpoint");
@@ -2,12 +2,7 @@
2
2
  #define DEBASE_INTERNALS
3
3
 
4
4
  #include "ruby.h"
5
- #include "vm_core.h"
6
- #include "version.h"
7
- #include "iseq.h"
8
- #include "vm_insnhelper.h"
9
- #include "method.h"
10
- #include <ruby/debug.h>
5
+ #include "ruby/debug.h"
11
6
 
12
7
  typedef struct rb_trace_arg_struct rb_trace_point_t;
13
8
 
@@ -30,7 +30,7 @@ module Debase
30
30
  class << RubyVM::InstructionSequence
31
31
  def self.prepend(mod, *smth)
32
32
  super
33
- if mod.to_s.include? 'Bootsnap'
33
+ if mod.to_s.include?('Bootsnap') && RUBY_VERSION >= "2.5"
34
34
  prepend InstructionSequenceMixin
35
35
  end
36
36
  end
@@ -107,7 +107,7 @@ module Debase
107
107
 
108
108
  def do_set_flags(iseq)
109
109
  Debugger.set_trace_flag_to_iseq(iseq)
110
- iseq.each_child{|child_iseq| do_set_flags(child_iseq)}
110
+ iseq.each_child { |child_iseq| do_set_flags(child_iseq) } if iseq.respond_to? :each_child
111
111
  end
112
112
  end
113
113
  end
@@ -1,3 +1,3 @@
1
1
  module Debase
2
- VERSION = "0.2.3.beta2" unless defined? VERSION
2
+ VERSION = "0.2.3.beta3" unless defined? VERSION
3
3
  end
@@ -0,0 +1,5 @@
1
+ class A
2
+ def foo(a)
3
+ puts a
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ require_relative 'a.rb'
2
+
3
+ A.new.foo('hi')
@@ -3,6 +3,9 @@ require File.expand_path("helper", File.dirname(__FILE__))
3
3
 
4
4
  # Test of Debugger.debug_load in C extension ruby_debug.so
5
5
  class TestDebugLoad < Test::Unit::TestCase
6
+
7
+ self.test_order = :defined
8
+
6
9
  class << self
7
10
  def at_line(file, line)
8
11
  @@at_line = [File.basename(file), line]
@@ -41,4 +44,35 @@ class TestDebugLoad < Test::Unit::TestCase
41
44
  ensure
42
45
  Debugger.stop if Debugger.started?
43
46
  end
47
+
48
+ module MyBootsnap
49
+ def load_iseq(path)
50
+ iseq = RubyVM::InstructionSequence.compile_file(path)
51
+
52
+ Debugger.unset_iseq_flags(iseq)
53
+ iseq
54
+ end
55
+ end
56
+
57
+ def test_bootsnap
58
+ @@at_line = nil
59
+ src_dir = File.dirname(__FILE__)
60
+ prog_script = File.join(src_dir, 'example', 'bootsnap', 'bootsnap.rb')
61
+
62
+ class << RubyVM::InstructionSequence
63
+ prepend MyBootsnap
64
+ end
65
+ bt = Debugger.debug_load(prog_script, true)
66
+ assert_equal(nil, bt)
67
+ assert_not_nil(@@at_line)
68
+ if RUBY_VERSION >= '2.5'
69
+ assert_equal(['debase.rb', 101], @@at_line)
70
+ end
71
+
72
+ assert(Debugger.started?)
73
+ Debugger.stop
74
+
75
+ class << RubyVM::InstructionSequence; self end.class_eval { undef_method :load_iseq }
76
+
77
+ end
44
78
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: debase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3.beta2
4
+ version: 0.2.3.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dennis Ushakov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-30 00:00:00.000000000 Z
11
+ date: 2019-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debase-ruby_core_source
@@ -94,6 +94,8 @@ files:
94
94
  - test/example/a/example.rb
95
95
  - test/example/at-exit.rb
96
96
  - test/example/b/example.rb
97
+ - test/example/bootsnap/a.rb
98
+ - test/example/bootsnap/bootsnap.rb
97
99
  - test/example/bp_loop_issue.rb
98
100
  - test/example/breakpoints-basename.rb
99
101
  - test/example/brkpt-class-bug.rb
@@ -134,10 +136,35 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
136
  - !ruby/object:Gem::Version
135
137
  version: 1.3.1
136
138
  requirements: []
137
- rubyforge_project: debase
138
- rubygems_version: 2.6.10
139
+ rubygems_version: 3.0.1
139
140
  signing_key:
140
141
  specification_version: 4
141
142
  summary: debase is a fast implementation of the standard Ruby debugger debug.rb for
142
143
  Ruby 2.0
143
- test_files: []
144
+ test_files:
145
+ - test/example/a/example.rb
146
+ - test/example/at-exit.rb
147
+ - test/example/b/example.rb
148
+ - test/example/bootsnap/a.rb
149
+ - test/example/bootsnap/bootsnap.rb
150
+ - test/example/bp_loop_issue.rb
151
+ - test/example/breakpoints-basename.rb
152
+ - test/example/brkpt-class-bug.rb
153
+ - test/example/classes.rb
154
+ - test/example/dollar-0.rb
155
+ - test/example/except-bug1.rb
156
+ - test/example/file with space.rb
157
+ - test/example/gcd.rb
158
+ - test/example/info-var-bug.rb
159
+ - test/example/info-var-bug2.rb
160
+ - test/example/null.rb
161
+ - test/example/output.rb
162
+ - test/example/pm-bug.rb
163
+ - test/example/pm.rb
164
+ - test/example/raise.rb
165
+ - test/helper.rb
166
+ - test/test_base.rb
167
+ - test/test_breakpoints.rb
168
+ - test/test_catchpoint.rb
169
+ - test/test_load.rb
170
+ - test/test_reload_bug.rb