debase 0.1.4 → 0.1.5
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/context.c +2 -2
- data/ext/debase_internals.c +18 -4
- 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: 352d91f43143f540d4574637d8947567878edd3b
|
|
4
|
+
data.tar.gz: be678b9761b4652414433eb43848eaf807542e5b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2da8fa606defb081abae519eda7d36c016a33eb01435b4c0c0a64b5add87d548d12cec3ba3d52923b464a13477464027a245c85aa8ddbb4110ed7b310366da19
|
|
7
|
+
data.tar.gz: 5c90a828b055619460d88f991c80f6c2d46f52608066ad03251b39c2e472ddd65c71feb4b4fd7bdddb74a69b8ebc760d5000b3c545fe0362cb1112109f4b837e
|
data/ext/context.c
CHANGED
|
@@ -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 = (int)RARRAY_LEN(locations);
|
|
48
|
+
stack_size = locations == Qnil ? 0 : (int)RARRAY_LEN(locations);
|
|
49
49
|
context->stack_size = stack_size;
|
|
50
50
|
|
|
51
51
|
for (i = 0; i < stack_size; i++) {
|
|
@@ -53,7 +53,7 @@ fill_stack(debug_context_t *context, const rb_debug_inspector_t *inspector) {
|
|
|
53
53
|
location = rb_ary_entry(locations, i);
|
|
54
54
|
path = rb_funcall(location, rb_intern("path"), 0);
|
|
55
55
|
lineno = rb_funcall(location, rb_intern("lineno"), 0);
|
|
56
|
-
file = RSTRING_PTR(path);
|
|
56
|
+
file = path != Qnil ? RSTRING_PTR(path) : "";
|
|
57
57
|
line = FIX2INT(lineno);
|
|
58
58
|
fill_frame(frame, file, line, rb_debug_inspector_frame_binding_get(inspector, i), rb_debug_inspector_frame_self_get(inspector, i));
|
|
59
59
|
frame->prev = context->stack;
|
data/ext/debase_internals.c
CHANGED
|
@@ -129,16 +129,30 @@ print_event(rb_trace_point_t *tp, debug_context_t *context)
|
|
|
129
129
|
VALUE line;
|
|
130
130
|
VALUE event;
|
|
131
131
|
VALUE mid;
|
|
132
|
+
VALUE rb_cl;
|
|
133
|
+
VALUE rb_cl_name;
|
|
134
|
+
const char *defined_class;
|
|
132
135
|
|
|
133
136
|
if (debug == Qtrue) {
|
|
134
137
|
path = rb_tracearg_path(tp);
|
|
135
138
|
line = rb_tracearg_lineno(tp);
|
|
136
139
|
event = rb_tracearg_event(tp);
|
|
137
140
|
mid = rb_tracearg_method_id(tp);
|
|
138
|
-
|
|
141
|
+
rb_cl = rb_tracearg_defined_class(tp);
|
|
142
|
+
rb_cl_name = NIL_P(rb_cl) ? rb_cl : rb_mod_name(rb_cl);
|
|
143
|
+
defined_class = NIL_P(rb_cl_name) ? "" : RSTRING_PTR(rb_cl_name);
|
|
144
|
+
|
|
145
|
+
fprintf(stderr, "[#%d] %s@%s:%d %s#%s\n",
|
|
146
|
+
context->thnum,
|
|
147
|
+
symbol2str(event),
|
|
148
|
+
path == Qnil ? "" : RSTRING_PTR(path),
|
|
149
|
+
FIX2INT(line),
|
|
150
|
+
defined_class,
|
|
151
|
+
mid == Qnil ? "(top level)" : symbol2str(mid)
|
|
152
|
+
);
|
|
139
153
|
locations = rb_funcall(context->thread, rb_intern("backtrace_locations"), 1, INT2FIX(1));
|
|
140
|
-
fprintf(stderr, " calced_stack_size=%d, stack_size=%d,
|
|
141
|
-
context->calced_stack_size, context->stack_size,
|
|
154
|
+
fprintf(stderr, " calced_stack_size=%d, stack_size=%d, real_stack_size=%d\n",
|
|
155
|
+
context->calced_stack_size, context->stack_size,
|
|
142
156
|
locations != Qnil ? (int)RARRAY_LEN(locations) : 0);
|
|
143
157
|
}
|
|
144
158
|
}
|
|
@@ -294,7 +308,7 @@ process_call_event(VALUE trace_point, void *data)
|
|
|
294
308
|
|
|
295
309
|
++context->calced_stack_size;
|
|
296
310
|
update_stack_size(context);
|
|
297
|
-
print_event(TRACE_POINT, context);
|
|
311
|
+
print_event(TRACE_POINT, context);
|
|
298
312
|
cleanup(context);
|
|
299
313
|
}
|
|
300
314
|
|
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.1.
|
|
4
|
+
version: 0.1.5
|
|
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-
|
|
11
|
+
date: 2015-07-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: debase-ruby_core_source
|