debase 0.2.2.beta1 → 0.2.2.beta2
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 +4 -4
- data/ext/breakpoint.c +3 -3
- data/ext/context.c +3 -3
- data/ext/debase_internals.c +1 -1
- data/lib/debase/context.rb +3 -22
- data/lib/debase/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa9243251fe06c4d8edb12a8d66ef5a156846577
|
4
|
+
data.tar.gz: 590470f369f6f81a1740bf9e99e8aa4667227696
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 933431d52c9e29ed084926f2c48fd6a7be6b44f3f801f3e73c0c3a9558743fc3e4ed7d9552b07d84591a1f045d26baf4aeeade4a81fd95b2733987c61a0a9c70
|
7
|
+
data.tar.gz: 52e8bd5c6bd39553feb8e3f9fcb720a6f3b4743cf80333311c7ad660ec44c9b3152a08155ac9bbe75e9fa675720d8b852a34feeed6f185a2e50be4e05bf45203
|
data/ext/breakpoint.c
CHANGED
@@ -26,7 +26,7 @@ catchpoint_hit_count(VALUE catchpoints, VALUE exception, VALUE *exception_name)
|
|
26
26
|
return Qnil;
|
27
27
|
expn_class = rb_obj_class(exception);
|
28
28
|
ancestors = rb_mod_ancestors(expn_class);
|
29
|
-
for(i = 0; i <
|
29
|
+
for(i = 0; i < RARRAY_LENINT(ancestors); i++)
|
30
30
|
{
|
31
31
|
aclass = rb_ary_entry(ancestors, i);
|
32
32
|
mod_name = rb_mod_name(aclass);
|
@@ -83,7 +83,7 @@ Breakpoint_remove(VALUE self, VALUE breakpoints, VALUE id_value)
|
|
83
83
|
|
84
84
|
id = FIX2INT(id_value);
|
85
85
|
|
86
|
-
for(i = 0; i <
|
86
|
+
for(i = 0; i < RARRAY_LENINT(breakpoints); i++)
|
87
87
|
{
|
88
88
|
breakpoint_object = rb_ary_entry(breakpoints, i);
|
89
89
|
Data_Get_Struct(breakpoint_object, breakpoint_t, breakpoint);
|
@@ -207,7 +207,7 @@ breakpoint_find(VALUE breakpoints, VALUE source, VALUE pos)
|
|
207
207
|
|
208
208
|
file = RSTRING_PTR(source);
|
209
209
|
line = FIX2INT(pos);
|
210
|
-
for(i = 0; i <
|
210
|
+
for(i = 0; i < RARRAY_LENINT(breakpoints); i++)
|
211
211
|
{
|
212
212
|
breakpoint_object = rb_ary_entry(breakpoints, i);
|
213
213
|
if (check_breakpoint_by_pos(breakpoint_object, file, line))
|
data/ext/context.c
CHANGED
@@ -29,7 +29,7 @@ fill_frame(debug_frame_t *frame, const char* file, int line, VALUE binding, VALU
|
|
29
29
|
frame->file = file;
|
30
30
|
frame->line = line;
|
31
31
|
frame->binding = binding;
|
32
|
-
frame->self = self;
|
32
|
+
frame->self = self;
|
33
33
|
}
|
34
34
|
|
35
35
|
extern void
|
@@ -45,7 +45,7 @@ fill_stack(debug_context_t *context, const rb_debug_inspector_t *inspector) {
|
|
45
45
|
int i;
|
46
46
|
|
47
47
|
locations = rb_debug_inspector_backtrace_locations(inspector);
|
48
|
-
stack_size = locations == Qnil ? 0 : (
|
48
|
+
stack_size = locations == Qnil ? 0 : RARRAY_LENINT(locations);
|
49
49
|
context->stack_size = stack_size;
|
50
50
|
|
51
51
|
for (i = 0; i < stack_size; i++) {
|
@@ -138,7 +138,7 @@ context_create(VALUE thread, VALUE cDebugThread) {
|
|
138
138
|
context = ALLOC(debug_context_t);
|
139
139
|
context->stack_size = 0;
|
140
140
|
locations = rb_funcall(thread, rb_intern("backtrace_locations"), 1, INT2FIX(1));
|
141
|
-
context->calced_stack_size = locations != Qnil ? (
|
141
|
+
context->calced_stack_size = locations != Qnil ? RARRAY_LENINT(locations) : 0;
|
142
142
|
context->stack = NULL;
|
143
143
|
context->thnum = ++thnum_current;
|
144
144
|
context->thread = thread;
|
data/ext/debase_internals.c
CHANGED
@@ -162,7 +162,7 @@ print_event(rb_trace_point_t *tp, debug_context_t *context)
|
|
162
162
|
locations = rb_funcall(context->thread, rb_intern("backtrace_locations"), 1, INT2FIX(1));
|
163
163
|
fprintf(stderr, " calced_stack_size=%d, stack_size=%d, real_stack_size=%d\n",
|
164
164
|
context->calced_stack_size, context->stack_size,
|
165
|
-
locations != Qnil ? (
|
165
|
+
locations != Qnil ? RARRAY_LENINT(locations) : 0);
|
166
166
|
}
|
167
167
|
}
|
168
168
|
|
data/lib/debase/context.rb
CHANGED
@@ -1,17 +1,9 @@
|
|
1
1
|
module Debase
|
2
2
|
class Context
|
3
3
|
def frame_locals(frame_no=0)
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
if locals.respond_to?(:each)
|
8
|
-
locals.each do |local|
|
9
|
-
result[local.to_s] = safe_eval(local.to_s, binding)
|
10
|
-
end
|
11
|
-
else
|
12
|
-
result[locals.to_s] = safe_eval(locals.to_s, binding)
|
13
|
-
end
|
14
|
-
result
|
4
|
+
frame_binding(frame_no).eval('local_variables.inject({}){|h, v| h[v.to_s] = eval(v.to_s); h}')
|
5
|
+
rescue => e
|
6
|
+
{'debase-debug' => "*Evaluation error: '#{e}'" }
|
15
7
|
end
|
16
8
|
|
17
9
|
def frame_class(frame_no=0)
|
@@ -46,16 +38,5 @@ module Debase
|
|
46
38
|
def at_return(file, line)
|
47
39
|
handler.at_return(self, file, line)
|
48
40
|
end
|
49
|
-
|
50
|
-
private
|
51
|
-
|
52
|
-
def safe_eval(expr, binding)
|
53
|
-
begin
|
54
|
-
eval(expr, binding)
|
55
|
-
rescue => e
|
56
|
-
"*Evaluation error: '#{e}'"
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
41
|
end
|
61
42
|
end
|
data/lib/debase/version.rb
CHANGED
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.2.
|
4
|
+
version: 0.2.2.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dennis Ushakov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debase-ruby_core_source
|