bindex 0.2.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +13 -33
- data/bindex.gemspec +1 -1
- data/ext/bindex/com/gsamokovarov/bindex/JRubyIntegration.java +2 -2
- data/ext/bindex/com/gsamokovarov/bindex/SetExceptionBindingsEventHook.java +4 -1
- data/ext/bindex/cruby.c +49 -15
- data/ext/bindex/extconf.rb +0 -15
- data/lib/bindex/jruby.rb +0 -1
- data/lib/bindex/jruby_internals.jar +0 -0
- data/lib/bindex/jruby_internals_9k.jar +0 -0
- data/lib/bindex/version.rb +1 -1
- metadata +4 -139
- data/ext/bindex/bindex.h +0 -11
- data/ext/bindex/bindings.c +0 -106
- data/ext/bindex/ruby_193.h +0 -101
- data/ext/bindex/ruby_193/addr2line.h +0 -21
- data/ext/bindex/ruby_193/constant.h +0 -34
- data/ext/bindex/ruby_193/debug.h +0 -41
- data/ext/bindex/ruby_193/dln.h +0 -50
- data/ext/bindex/ruby_193/encdb.h +0 -167
- data/ext/bindex/ruby_193/eval_intern.h +0 -234
- data/ext/bindex/ruby_193/gc.h +0 -99
- data/ext/bindex/ruby_193/id.h +0 -177
- data/ext/bindex/ruby_193/internal.h +0 -242
- data/ext/bindex/ruby_193/iseq.h +0 -126
- data/ext/bindex/ruby_193/method.h +0 -105
- data/ext/bindex/ruby_193/node.h +0 -504
- data/ext/bindex/ruby_193/parse.h +0 -302
- data/ext/bindex/ruby_193/probes.h +0 -369
- data/ext/bindex/ruby_193/regenc.h +0 -219
- data/ext/bindex/ruby_193/regint.h +0 -850
- data/ext/bindex/ruby_193/regparse.h +0 -362
- data/ext/bindex/ruby_193/revision.h +0 -1
- data/ext/bindex/ruby_193/ruby_atomic.h +0 -175
- data/ext/bindex/ruby_193/siphash.h +0 -48
- data/ext/bindex/ruby_193/thread_pthread.h +0 -51
- data/ext/bindex/ruby_193/thread_win32.h +0 -40
- data/ext/bindex/ruby_193/timev.h +0 -21
- data/ext/bindex/ruby_193/transcode_data.h +0 -117
- data/ext/bindex/ruby_193/transdb.h +0 -186
- data/ext/bindex/ruby_193/verconf.h +0 -12
- data/ext/bindex/ruby_193/version.h +0 -52
- data/ext/bindex/ruby_193/vm_core.h +0 -763
- data/ext/bindex/ruby_193/vm_exec.h +0 -184
- data/ext/bindex/ruby_193/vm_insnhelper.h +0 -220
- data/ext/bindex/ruby_193/vm_opts.h +0 -51
- data/ext/bindex/ruby_20.h +0 -142
- data/ext/bindex/ruby_20/addr2line.h +0 -21
- data/ext/bindex/ruby_20/constant.h +0 -36
- data/ext/bindex/ruby_20/dln.h +0 -50
- data/ext/bindex/ruby_20/encdb.h +0 -169
- data/ext/bindex/ruby_20/eval_intern.h +0 -241
- data/ext/bindex/ruby_20/gc.h +0 -104
- data/ext/bindex/ruby_20/id.h +0 -135
- data/ext/bindex/ruby_20/internal.h +0 -395
- data/ext/bindex/ruby_20/iseq.h +0 -140
- data/ext/bindex/ruby_20/method.h +0 -138
- data/ext/bindex/ruby_20/node.h +0 -541
- data/ext/bindex/ruby_20/parse.h +0 -292
- data/ext/bindex/ruby_20/probes.h +0 -369
- data/ext/bindex/ruby_20/probes_helper.h +0 -67
- data/ext/bindex/ruby_20/regenc.h +0 -227
- data/ext/bindex/ruby_20/regint.h +0 -915
- data/ext/bindex/ruby_20/regparse.h +0 -367
- data/ext/bindex/ruby_20/revision.h +0 -1
- data/ext/bindex/ruby_20/ruby_atomic.h +0 -170
- data/ext/bindex/ruby_20/siphash.h +0 -48
- data/ext/bindex/ruby_20/thread_pthread.h +0 -56
- data/ext/bindex/ruby_20/thread_win32.h +0 -45
- data/ext/bindex/ruby_20/timev.h +0 -21
- data/ext/bindex/ruby_20/transcode_data.h +0 -127
- data/ext/bindex/ruby_20/transdb.h +0 -190
- data/ext/bindex/ruby_20/verconf.h +0 -12
- data/ext/bindex/ruby_20/version.h +0 -52
- data/ext/bindex/ruby_20/vm_core.h +0 -1018
- data/ext/bindex/ruby_20/vm_debug.h +0 -41
- data/ext/bindex/ruby_20/vm_exec.h +0 -173
- data/ext/bindex/ruby_20/vm_insnhelper.h +0 -274
- data/ext/bindex/ruby_20/vm_opts.h +0 -56
- data/ext/bindex/ruby_21.h +0 -142
- data/ext/bindex/ruby_21/addr2line.h +0 -21
- data/ext/bindex/ruby_21/constant.h +0 -36
- data/ext/bindex/ruby_21/dln.h +0 -51
- data/ext/bindex/ruby_21/encdb.h +0 -170
- data/ext/bindex/ruby_21/eval_intern.h +0 -260
- data/ext/bindex/ruby_21/gc.h +0 -101
- data/ext/bindex/ruby_21/id.h +0 -210
- data/ext/bindex/ruby_21/internal.h +0 -889
- data/ext/bindex/ruby_21/iseq.h +0 -136
- data/ext/bindex/ruby_21/method.h +0 -142
- data/ext/bindex/ruby_21/node.h +0 -543
- data/ext/bindex/ruby_21/parse.h +0 -298
- data/ext/bindex/ruby_21/probes.h +0 -401
- data/ext/bindex/ruby_21/probes_helper.h +0 -67
- data/ext/bindex/ruby_21/regenc.h +0 -223
- data/ext/bindex/ruby_21/regint.h +0 -911
- data/ext/bindex/ruby_21/regparse.h +0 -363
- data/ext/bindex/ruby_21/revision.h +0 -1
- data/ext/bindex/ruby_21/ruby_atomic.h +0 -170
- data/ext/bindex/ruby_21/siphash.h +0 -48
- data/ext/bindex/ruby_21/thread_native.h +0 -23
- data/ext/bindex/ruby_21/thread_pthread.h +0 -56
- data/ext/bindex/ruby_21/thread_win32.h +0 -45
- data/ext/bindex/ruby_21/timev.h +0 -42
- data/ext/bindex/ruby_21/transcode_data.h +0 -123
- data/ext/bindex/ruby_21/transdb.h +0 -190
- data/ext/bindex/ruby_21/verconf.h +0 -13
- data/ext/bindex/ruby_21/version.h +0 -52
- data/ext/bindex/ruby_21/vm_core.h +0 -1043
- data/ext/bindex/ruby_21/vm_debug.h +0 -37
- data/ext/bindex/ruby_21/vm_exec.h +0 -182
- data/ext/bindex/ruby_21/vm_insnhelper.h +0 -273
- data/ext/bindex/ruby_21/vm_opts.h +0 -56
- data/ext/bindex/ruby_21preview.h +0 -146
- data/ext/bindex/ruby_21preview/addr2line.h +0 -21
- data/ext/bindex/ruby_21preview/constant.h +0 -36
- data/ext/bindex/ruby_21preview/dln.h +0 -51
- data/ext/bindex/ruby_21preview/encdb.h +0 -270
- data/ext/bindex/ruby_21preview/eval_intern.h +0 -217
- data/ext/bindex/ruby_21preview/gc.h +0 -100
- data/ext/bindex/ruby_21preview/id.h +0 -169
- data/ext/bindex/ruby_21preview/internal.h +0 -765
- data/ext/bindex/ruby_21preview/iseq.h +0 -136
- data/ext/bindex/ruby_21preview/method.h +0 -141
- data/ext/bindex/ruby_21preview/node.h +0 -543
- data/ext/bindex/ruby_21preview/parse.h +0 -298
- data/ext/bindex/ruby_21preview/probes.h +0 -385
- data/ext/bindex/ruby_21preview/probes_helper.h +0 -67
- data/ext/bindex/ruby_21preview/regenc.h +0 -223
- data/ext/bindex/ruby_21preview/regint.h +0 -911
- data/ext/bindex/ruby_21preview/regparse.h +0 -363
- data/ext/bindex/ruby_21preview/revision.h +0 -1
- data/ext/bindex/ruby_21preview/ruby_atomic.h +0 -130
- data/ext/bindex/ruby_21preview/siphash.h +0 -48
- data/ext/bindex/ruby_21preview/thread_native.h +0 -23
- data/ext/bindex/ruby_21preview/thread_pthread.h +0 -56
- data/ext/bindex/ruby_21preview/thread_win32.h +0 -45
- data/ext/bindex/ruby_21preview/timev.h +0 -42
- data/ext/bindex/ruby_21preview/transcode_data.h +0 -123
- data/ext/bindex/ruby_21preview/transdb.h +0 -190
- data/ext/bindex/ruby_21preview/verconf.h +0 -13
- data/ext/bindex/ruby_21preview/version.h +0 -53
- data/ext/bindex/ruby_21preview/vm_core.h +0 -1017
- data/ext/bindex/ruby_21preview/vm_debug.h +0 -37
- data/ext/bindex/ruby_21preview/vm_exec.h +0 -180
- data/ext/bindex/ruby_21preview/vm_insnhelper.h +0 -272
- data/ext/bindex/ruby_21preview/vm_opts.h +0 -56
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee2e50960f0fc636073a2d4a2597d169fae84bf2
|
4
|
+
data.tar.gz: d456453d22c61a8f19a6c8e1a73c149c7930a386
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28100af5bd5b378da0a983d381c10f235ccfb98db38ad6513fa9ac5b793042f07c5755912fe8b1723c8b36438929a4b96aed02b64810fe5b6c6b4e2dda1ddd37
|
7
|
+
data.tar.gz: da0c772ab6d28e3d1edfe1b2284c86fbf2d7a3cbca0a2a3d782807268b97ef2c95bcdd0d0b4e9a208458b0e1be8a181db76aa9af2a66df88915d943ee00eea2e
|
data/.travis.yml
CHANGED
@@ -1,43 +1,21 @@
|
|
1
1
|
language: ruby
|
2
2
|
|
3
3
|
rvm:
|
4
|
-
- ruby-
|
5
|
-
- ruby-1.
|
6
|
-
- ruby-1.9.3-p547
|
7
|
-
- ruby-1.9.3-p545
|
8
|
-
- ruby-1.9.3-p484
|
9
|
-
|
10
|
-
- ruby-2.0.0-p598
|
11
|
-
- ruby-2.0.0-p576
|
12
|
-
- ruby-2.0.0-p481
|
13
|
-
- ruby-2.0.0-p451
|
14
|
-
- ruby-2.0.0-p353
|
15
|
-
- ruby-2.0.0-p247
|
16
|
-
- ruby-2.0.0-p195
|
17
|
-
- ruby-2.0.0-p0
|
18
|
-
|
19
|
-
- ruby-2.1.5
|
20
|
-
- ruby-2.1.4
|
21
|
-
- ruby-2.1.3
|
22
|
-
- ruby-2.1.2-clang
|
23
|
-
- ruby-2.1.2
|
24
|
-
- ruby-2.1.1-clang
|
25
|
-
- ruby-2.1.1
|
26
|
-
- ruby-2.1.0-rc1
|
27
|
-
- ruby-2.1.0-preview2
|
28
|
-
- ruby-2.1.0-preview1
|
4
|
+
- ruby-2.0.0-p648
|
5
|
+
- ruby-2.1.10
|
29
6
|
- ruby-2.1.0
|
30
|
-
|
7
|
+
- ruby-2.2.6
|
8
|
+
- ruby-2.3.3
|
9
|
+
- ruby-2.4.0
|
31
10
|
- ruby-head
|
32
11
|
|
33
|
-
-
|
34
|
-
-
|
35
|
-
- rbx-2.2.2
|
36
|
-
|
12
|
+
- jruby-9.1.8.0
|
13
|
+
- jruby-1.7.26
|
37
14
|
- jruby-head
|
38
|
-
|
39
|
-
|
40
|
-
|
15
|
+
|
16
|
+
allow_failures:
|
17
|
+
- rvm: ruby-head
|
18
|
+
- rvm: jruby-head
|
41
19
|
|
42
20
|
env:
|
43
21
|
global:
|
@@ -46,3 +24,5 @@ env:
|
|
46
24
|
before_install: gem install bundler
|
47
25
|
|
48
26
|
sudo: false
|
27
|
+
|
28
|
+
cache: bundler
|
data/bindex.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.homepage = "https://github.com/gsamokovarov/bindex"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
15
|
-
spec.required_ruby_version = ">=
|
15
|
+
spec.required_ruby_version = ">= 2.0.0"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0")
|
18
18
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
@@ -26,14 +26,14 @@ public class JRubyIntegration {
|
|
26
26
|
}
|
27
27
|
}
|
28
28
|
|
29
|
-
|
29
|
+
public static class BindexMethods {
|
30
30
|
@JRubyMethod(name = "current_bindings", meta = true)
|
31
31
|
public static IRubyObject currentBindings(ThreadContext context, IRubyObject self) {
|
32
32
|
return RubyBindingsCollector.collectCurrentFor(context);
|
33
33
|
}
|
34
34
|
}
|
35
35
|
|
36
|
-
|
36
|
+
public static class ExceptionExtensionMethods {
|
37
37
|
@JRubyMethod
|
38
38
|
public static IRubyObject bindings(ThreadContext context, IRubyObject self) {
|
39
39
|
InstanceVariables instanceVariables = self.getInstanceVariables();
|
@@ -16,6 +16,9 @@ public class SetExceptionBindingsEventHook extends EventHook {
|
|
16
16
|
RubyArray bindings = RubyBindingsCollector.collectCurrentFor(context);
|
17
17
|
RubyException exception = (RubyException) context.runtime.getGlobalVariables().get("$!");
|
18
18
|
|
19
|
-
exception.
|
19
|
+
IRubyObject exceptionBindings = exception.getInstanceVariable("@bindings");
|
20
|
+
if (exceptionBindings == null || exceptionBindings.isNil()) {
|
21
|
+
exception.setInstanceVariable("@bindings", bindings);
|
22
|
+
}
|
20
23
|
}
|
21
24
|
}
|
data/ext/bindex/cruby.c
CHANGED
@@ -1,32 +1,65 @@
|
|
1
|
-
#include
|
1
|
+
#include <ruby.h>
|
2
|
+
#include <ruby/debug.h>
|
2
3
|
|
3
4
|
VALUE bx_mBindex;
|
5
|
+
static ID id_bindings;
|
4
6
|
|
5
7
|
static VALUE
|
6
|
-
|
8
|
+
current_bindings_callback(const rb_debug_inspector_t *context, void *data)
|
7
9
|
{
|
8
|
-
|
10
|
+
VALUE locations = rb_debug_inspector_backtrace_locations(context);
|
11
|
+
VALUE binding, bindings = rb_ary_new();
|
12
|
+
long i, length = RARRAY_LEN(locations);
|
13
|
+
|
14
|
+
for (i = 0; i < length; i++) {
|
15
|
+
binding = rb_debug_inspector_frame_binding_get(context, i);
|
16
|
+
|
17
|
+
if (!NIL_P(binding)) {
|
18
|
+
rb_ary_push(bindings, binding);
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
return bindings;
|
9
23
|
}
|
10
24
|
|
11
|
-
|
12
|
-
|
25
|
+
VALUE
|
26
|
+
current_bindings(void)
|
27
|
+
{
|
28
|
+
return rb_debug_inspector_open(current_bindings_callback, NULL);
|
29
|
+
}
|
30
|
+
|
31
|
+
static void
|
32
|
+
set_exception_bindings_callback(VALUE tpval, void *data)
|
13
33
|
{
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
34
|
+
rb_trace_arg_t *trace_arg = rb_tracearg_from_tracepoint(tpval);
|
35
|
+
VALUE exception = rb_tracearg_raised_exception(trace_arg);
|
36
|
+
VALUE bindings = rb_attr_get(exception, id_bindings);
|
37
|
+
|
38
|
+
/* Set the bindings, only if they haven't been set already. This may reset
|
39
|
+
* the binding during reraise. */
|
40
|
+
if (NIL_P(bindings)) {
|
41
|
+
rb_ivar_set(exception, id_bindings, current_bindings());
|
42
|
+
}
|
43
|
+
}
|
18
44
|
|
19
|
-
|
45
|
+
void
|
46
|
+
set_exception_bindings_on_raise(void)
|
47
|
+
{
|
48
|
+
VALUE tpval = rb_tracepoint_new(0, RUBY_EVENT_RAISE, set_exception_bindings_callback, 0);
|
49
|
+
rb_tracepoint_enable(tpval);
|
50
|
+
}
|
20
51
|
|
21
|
-
|
52
|
+
static VALUE
|
53
|
+
bx_current_bindings(VALUE self)
|
54
|
+
{
|
55
|
+
return current_bindings();
|
22
56
|
}
|
23
57
|
|
24
58
|
static VALUE
|
25
59
|
bx_exc_bindings(VALUE self)
|
26
60
|
{
|
27
|
-
VALUE bindings;
|
61
|
+
VALUE bindings = rb_attr_get(self, id_bindings);
|
28
62
|
|
29
|
-
bindings = rb_iv_get(self, "bindings");
|
30
63
|
if (NIL_P(bindings)) {
|
31
64
|
bindings = rb_ary_new();
|
32
65
|
}
|
@@ -38,9 +71,10 @@ void
|
|
38
71
|
Init_cruby(void)
|
39
72
|
{
|
40
73
|
bx_mBindex = rb_define_module("Bindex");
|
74
|
+
id_bindings = rb_intern("bindings");
|
41
75
|
|
42
76
|
rb_define_singleton_method(bx_mBindex, "current_bindings", bx_current_bindings, 0);
|
43
|
-
|
44
|
-
rb_define_method(rb_eException, "set_backtrace", bx_exc_set_backtrace, 1);
|
45
77
|
rb_define_method(rb_eException, "bindings", bx_exc_bindings, 0);
|
78
|
+
|
79
|
+
set_exception_bindings_on_raise();
|
46
80
|
}
|
data/ext/bindex/extconf.rb
CHANGED
@@ -2,21 +2,6 @@ case RUBY_ENGINE
|
|
2
2
|
when "ruby"
|
3
3
|
require "mkmf"
|
4
4
|
|
5
|
-
case "#{RUBY_VERSION}#{RUBY_PATCHLEVEL}"
|
6
|
-
when /1\.9\.3/
|
7
|
-
$CFLAGS << " -D RUBY_193"
|
8
|
-
$INCFLAGS << " -I./ruby_193/"
|
9
|
-
when /2\.0\.*/
|
10
|
-
$CFLAGS << " -D RUBY_20"
|
11
|
-
$INCFLAGS << " -I./ruby_20/"
|
12
|
-
when "2.1.0-1"
|
13
|
-
$CFLAGS << " -D RUBY_21PREVIEW"
|
14
|
-
$INCFLAGS << " -I./ruby_21PREVIEW/"
|
15
|
-
when /2\.1\.*/
|
16
|
-
$CFLAGS << " -D RUBY_21"
|
17
|
-
$INCFLAGS << " -I./ruby_21/"
|
18
|
-
end
|
19
|
-
|
20
5
|
$CFLAGS << " -Wall"
|
21
6
|
$CFLAGS << " -g3 -O0" if ENV["DEBUG"]
|
22
7
|
|
data/lib/bindex/jruby.rb
CHANGED
Binary file
|
Binary file
|
data/lib/bindex/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bindex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genadi Samokovarov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -82,8 +82,6 @@ files:
|
|
82
82
|
- README.md
|
83
83
|
- Rakefile
|
84
84
|
- bindex.gemspec
|
85
|
-
- ext/bindex/bindex.h
|
86
|
-
- ext/bindex/bindings.c
|
87
85
|
- ext/bindex/com/gsamokovarov/bindex/BindingBuilder.java.erb
|
88
86
|
- ext/bindex/com/gsamokovarov/bindex/CurrentBindingsIterator.java
|
89
87
|
- ext/bindex/com/gsamokovarov/bindex/JRubyIntegration.java
|
@@ -93,139 +91,6 @@ files:
|
|
93
91
|
- ext/bindex/com/gsamokovarov/bindex/ThreadContextInternals.java
|
94
92
|
- ext/bindex/cruby.c
|
95
93
|
- ext/bindex/extconf.rb
|
96
|
-
- ext/bindex/ruby_193.h
|
97
|
-
- ext/bindex/ruby_193/addr2line.h
|
98
|
-
- ext/bindex/ruby_193/constant.h
|
99
|
-
- ext/bindex/ruby_193/debug.h
|
100
|
-
- ext/bindex/ruby_193/dln.h
|
101
|
-
- ext/bindex/ruby_193/encdb.h
|
102
|
-
- ext/bindex/ruby_193/eval_intern.h
|
103
|
-
- ext/bindex/ruby_193/gc.h
|
104
|
-
- ext/bindex/ruby_193/id.h
|
105
|
-
- ext/bindex/ruby_193/internal.h
|
106
|
-
- ext/bindex/ruby_193/iseq.h
|
107
|
-
- ext/bindex/ruby_193/method.h
|
108
|
-
- ext/bindex/ruby_193/node.h
|
109
|
-
- ext/bindex/ruby_193/parse.h
|
110
|
-
- ext/bindex/ruby_193/probes.h
|
111
|
-
- ext/bindex/ruby_193/regenc.h
|
112
|
-
- ext/bindex/ruby_193/regint.h
|
113
|
-
- ext/bindex/ruby_193/regparse.h
|
114
|
-
- ext/bindex/ruby_193/revision.h
|
115
|
-
- ext/bindex/ruby_193/ruby_atomic.h
|
116
|
-
- ext/bindex/ruby_193/siphash.h
|
117
|
-
- ext/bindex/ruby_193/thread_pthread.h
|
118
|
-
- ext/bindex/ruby_193/thread_win32.h
|
119
|
-
- ext/bindex/ruby_193/timev.h
|
120
|
-
- ext/bindex/ruby_193/transcode_data.h
|
121
|
-
- ext/bindex/ruby_193/transdb.h
|
122
|
-
- ext/bindex/ruby_193/verconf.h
|
123
|
-
- ext/bindex/ruby_193/version.h
|
124
|
-
- ext/bindex/ruby_193/vm_core.h
|
125
|
-
- ext/bindex/ruby_193/vm_exec.h
|
126
|
-
- ext/bindex/ruby_193/vm_insnhelper.h
|
127
|
-
- ext/bindex/ruby_193/vm_opts.h
|
128
|
-
- ext/bindex/ruby_20.h
|
129
|
-
- ext/bindex/ruby_20/addr2line.h
|
130
|
-
- ext/bindex/ruby_20/constant.h
|
131
|
-
- ext/bindex/ruby_20/dln.h
|
132
|
-
- ext/bindex/ruby_20/encdb.h
|
133
|
-
- ext/bindex/ruby_20/eval_intern.h
|
134
|
-
- ext/bindex/ruby_20/gc.h
|
135
|
-
- ext/bindex/ruby_20/id.h
|
136
|
-
- ext/bindex/ruby_20/internal.h
|
137
|
-
- ext/bindex/ruby_20/iseq.h
|
138
|
-
- ext/bindex/ruby_20/method.h
|
139
|
-
- ext/bindex/ruby_20/node.h
|
140
|
-
- ext/bindex/ruby_20/parse.h
|
141
|
-
- ext/bindex/ruby_20/probes.h
|
142
|
-
- ext/bindex/ruby_20/probes_helper.h
|
143
|
-
- ext/bindex/ruby_20/regenc.h
|
144
|
-
- ext/bindex/ruby_20/regint.h
|
145
|
-
- ext/bindex/ruby_20/regparse.h
|
146
|
-
- ext/bindex/ruby_20/revision.h
|
147
|
-
- ext/bindex/ruby_20/ruby_atomic.h
|
148
|
-
- ext/bindex/ruby_20/siphash.h
|
149
|
-
- ext/bindex/ruby_20/thread_pthread.h
|
150
|
-
- ext/bindex/ruby_20/thread_win32.h
|
151
|
-
- ext/bindex/ruby_20/timev.h
|
152
|
-
- ext/bindex/ruby_20/transcode_data.h
|
153
|
-
- ext/bindex/ruby_20/transdb.h
|
154
|
-
- ext/bindex/ruby_20/verconf.h
|
155
|
-
- ext/bindex/ruby_20/version.h
|
156
|
-
- ext/bindex/ruby_20/vm_core.h
|
157
|
-
- ext/bindex/ruby_20/vm_debug.h
|
158
|
-
- ext/bindex/ruby_20/vm_exec.h
|
159
|
-
- ext/bindex/ruby_20/vm_insnhelper.h
|
160
|
-
- ext/bindex/ruby_20/vm_opts.h
|
161
|
-
- ext/bindex/ruby_21.h
|
162
|
-
- ext/bindex/ruby_21/addr2line.h
|
163
|
-
- ext/bindex/ruby_21/constant.h
|
164
|
-
- ext/bindex/ruby_21/dln.h
|
165
|
-
- ext/bindex/ruby_21/encdb.h
|
166
|
-
- ext/bindex/ruby_21/eval_intern.h
|
167
|
-
- ext/bindex/ruby_21/gc.h
|
168
|
-
- ext/bindex/ruby_21/id.h
|
169
|
-
- ext/bindex/ruby_21/internal.h
|
170
|
-
- ext/bindex/ruby_21/iseq.h
|
171
|
-
- ext/bindex/ruby_21/method.h
|
172
|
-
- ext/bindex/ruby_21/node.h
|
173
|
-
- ext/bindex/ruby_21/parse.h
|
174
|
-
- ext/bindex/ruby_21/probes.h
|
175
|
-
- ext/bindex/ruby_21/probes_helper.h
|
176
|
-
- ext/bindex/ruby_21/regenc.h
|
177
|
-
- ext/bindex/ruby_21/regint.h
|
178
|
-
- ext/bindex/ruby_21/regparse.h
|
179
|
-
- ext/bindex/ruby_21/revision.h
|
180
|
-
- ext/bindex/ruby_21/ruby_atomic.h
|
181
|
-
- ext/bindex/ruby_21/siphash.h
|
182
|
-
- ext/bindex/ruby_21/thread_native.h
|
183
|
-
- ext/bindex/ruby_21/thread_pthread.h
|
184
|
-
- ext/bindex/ruby_21/thread_win32.h
|
185
|
-
- ext/bindex/ruby_21/timev.h
|
186
|
-
- ext/bindex/ruby_21/transcode_data.h
|
187
|
-
- ext/bindex/ruby_21/transdb.h
|
188
|
-
- ext/bindex/ruby_21/verconf.h
|
189
|
-
- ext/bindex/ruby_21/version.h
|
190
|
-
- ext/bindex/ruby_21/vm_core.h
|
191
|
-
- ext/bindex/ruby_21/vm_debug.h
|
192
|
-
- ext/bindex/ruby_21/vm_exec.h
|
193
|
-
- ext/bindex/ruby_21/vm_insnhelper.h
|
194
|
-
- ext/bindex/ruby_21/vm_opts.h
|
195
|
-
- ext/bindex/ruby_21preview.h
|
196
|
-
- ext/bindex/ruby_21preview/addr2line.h
|
197
|
-
- ext/bindex/ruby_21preview/constant.h
|
198
|
-
- ext/bindex/ruby_21preview/dln.h
|
199
|
-
- ext/bindex/ruby_21preview/encdb.h
|
200
|
-
- ext/bindex/ruby_21preview/eval_intern.h
|
201
|
-
- ext/bindex/ruby_21preview/gc.h
|
202
|
-
- ext/bindex/ruby_21preview/id.h
|
203
|
-
- ext/bindex/ruby_21preview/internal.h
|
204
|
-
- ext/bindex/ruby_21preview/iseq.h
|
205
|
-
- ext/bindex/ruby_21preview/method.h
|
206
|
-
- ext/bindex/ruby_21preview/node.h
|
207
|
-
- ext/bindex/ruby_21preview/parse.h
|
208
|
-
- ext/bindex/ruby_21preview/probes.h
|
209
|
-
- ext/bindex/ruby_21preview/probes_helper.h
|
210
|
-
- ext/bindex/ruby_21preview/regenc.h
|
211
|
-
- ext/bindex/ruby_21preview/regint.h
|
212
|
-
- ext/bindex/ruby_21preview/regparse.h
|
213
|
-
- ext/bindex/ruby_21preview/revision.h
|
214
|
-
- ext/bindex/ruby_21preview/ruby_atomic.h
|
215
|
-
- ext/bindex/ruby_21preview/siphash.h
|
216
|
-
- ext/bindex/ruby_21preview/thread_native.h
|
217
|
-
- ext/bindex/ruby_21preview/thread_pthread.h
|
218
|
-
- ext/bindex/ruby_21preview/thread_win32.h
|
219
|
-
- ext/bindex/ruby_21preview/timev.h
|
220
|
-
- ext/bindex/ruby_21preview/transcode_data.h
|
221
|
-
- ext/bindex/ruby_21preview/transdb.h
|
222
|
-
- ext/bindex/ruby_21preview/verconf.h
|
223
|
-
- ext/bindex/ruby_21preview/version.h
|
224
|
-
- ext/bindex/ruby_21preview/vm_core.h
|
225
|
-
- ext/bindex/ruby_21preview/vm_debug.h
|
226
|
-
- ext/bindex/ruby_21preview/vm_exec.h
|
227
|
-
- ext/bindex/ruby_21preview/vm_insnhelper.h
|
228
|
-
- ext/bindex/ruby_21preview/vm_opts.h
|
229
94
|
- lib/bindex.rb
|
230
95
|
- lib/bindex/jruby.rb
|
231
96
|
- lib/bindex/jruby_internals.jar
|
@@ -252,7 +117,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
252
117
|
requirements:
|
253
118
|
- - ">="
|
254
119
|
- !ruby/object:Gem::Version
|
255
|
-
version:
|
120
|
+
version: 2.0.0
|
256
121
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
257
122
|
requirements:
|
258
123
|
- - ">="
|
@@ -260,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
260
125
|
version: '0'
|
261
126
|
requirements: []
|
262
127
|
rubyforge_project:
|
263
|
-
rubygems_version: 2.
|
128
|
+
rubygems_version: 2.6.8
|
264
129
|
signing_key:
|
265
130
|
specification_version: 4
|
266
131
|
summary: Bindings for your Ruby exceptions
|
data/ext/bindex/bindex.h
DELETED
data/ext/bindex/bindings.c
DELETED
@@ -1,106 +0,0 @@
|
|
1
|
-
#include "bindex.h"
|
2
|
-
|
3
|
-
#ifdef RUBY_193
|
4
|
-
|
5
|
-
#include "ruby_193.h"
|
6
|
-
|
7
|
-
static rb_thread_t *current_thread;
|
8
|
-
|
9
|
-
#define GetCoreDataFromValueAsExpr(obj, type, ptr) \
|
10
|
-
((ptr) = (type*)DATA_PTR(obj))
|
11
|
-
|
12
|
-
#define ruby_current_thread \
|
13
|
-
GetCoreDataFromValueAsExpr(rb_thread_current(), rb_thread_t, current_thread)
|
14
|
-
|
15
|
-
/*
|
16
|
-
* Create a binding from a thread and control frame.
|
17
|
-
*
|
18
|
-
* Based on rb_binding new, defined in proc.c. A major difference from
|
19
|
-
* rb_binding_new is that it doesn't raises an exception, when we try to create
|
20
|
-
* Binding on top of a Fiber.
|
21
|
-
*
|
22
|
-
* The reason for this is that binding_new is to be used in exception handling
|
23
|
-
* code. If we raise, it may lead to an infinite recursion.
|
24
|
-
*
|
25
|
-
* Also, we'll assume a bit more hostile environment and check if cfp->iseq is
|
26
|
-
* NULL.
|
27
|
-
*
|
28
|
-
* Ruby nil is returned when the control frame pointer isn't suitable.
|
29
|
-
*/
|
30
|
-
|
31
|
-
static VALUE
|
32
|
-
binding_new(rb_thread_t *th, rb_control_frame_t *cfp)
|
33
|
-
{
|
34
|
-
VALUE bindval;
|
35
|
-
rb_binding_t *bind;
|
36
|
-
|
37
|
-
if (cfp == NULL || cfp->iseq == NULL) {
|
38
|
-
return Qnil;
|
39
|
-
}
|
40
|
-
|
41
|
-
bindval = binding_alloc(rb_cBinding);
|
42
|
-
|
43
|
-
GetBindingPtr(bindval, bind);
|
44
|
-
bind->env = rb_vm_make_env_object(th, cfp);
|
45
|
-
bind->filename = cfp->iseq->filename;
|
46
|
-
bind->line_no = rb_vm_get_sourceline(cfp);
|
47
|
-
return bindval;
|
48
|
-
}
|
49
|
-
|
50
|
-
VALUE
|
51
|
-
current_bindings(void)
|
52
|
-
{
|
53
|
-
rb_thread_t *th = GET_THREAD();
|
54
|
-
rb_control_frame_t *cfp = th->cfp;
|
55
|
-
rb_control_frame_t *cfp_limit = RUBY_VM_END_CONTROL_FRAME(th);
|
56
|
-
VALUE binding, bindings = rb_ary_new();
|
57
|
-
|
58
|
-
while (cfp_limit > cfp) {
|
59
|
-
cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
|
60
|
-
binding = binding_new(th, cfp);
|
61
|
-
|
62
|
-
if (!NIL_P(binding)) {
|
63
|
-
rb_ary_push(bindings, binding);
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
|
-
return bindings;
|
68
|
-
}
|
69
|
-
|
70
|
-
#else
|
71
|
-
|
72
|
-
#include <ruby/debug.h>
|
73
|
-
|
74
|
-
#ifdef RUBY_20
|
75
|
-
#include "ruby_20.h"
|
76
|
-
#elif RUBY_21
|
77
|
-
#include "ruby_21.h"
|
78
|
-
#elif RUBY_21PREVIEW
|
79
|
-
#include "ruby_21preview.h"
|
80
|
-
#endif
|
81
|
-
|
82
|
-
static VALUE
|
83
|
-
current_bindings_callback(const rb_debug_inspector_t *context, void *data)
|
84
|
-
{
|
85
|
-
VALUE locations = rb_debug_inspector_backtrace_locations(context);
|
86
|
-
VALUE binding, bindings = rb_ary_new();
|
87
|
-
long i, length = RARRAY_LEN(locations);
|
88
|
-
|
89
|
-
for (i = 0; i < length; i++) {
|
90
|
-
binding = rb_debug_inspector_frame_binding_get(context, i);
|
91
|
-
|
92
|
-
if (!NIL_P(binding)) {
|
93
|
-
rb_ary_push(bindings, binding);
|
94
|
-
}
|
95
|
-
}
|
96
|
-
|
97
|
-
return bindings;
|
98
|
-
}
|
99
|
-
|
100
|
-
VALUE
|
101
|
-
current_bindings(void)
|
102
|
-
{
|
103
|
-
return rb_debug_inspector_open(current_bindings_callback, NULL);
|
104
|
-
}
|
105
|
-
|
106
|
-
#endif
|