debase 0.2.4 → 0.2.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/debase_internals.c +31 -1
- data/lib/debase/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 107e62228760d4c312c185830e9b6c152814c02b2f85d94a094c44e6687402b8
|
4
|
+
data.tar.gz: 740ccb46f3bb6e97d60afd38e90c6d9cb3be58f0a29c66efc44f0e06d18acec8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ade635981299fee6a15e4e353c66db86f6afe14ae5c1a3e6f364a7936cec11f21f32ce4527d249d89738a573106a80be861b63ff334d591ef29adf6bdbcc5f0
|
7
|
+
data.tar.gz: a9c840b6868a842f94f4402a4161115b703522c9a29ff5bb3b09ab2025fcff451b3bb912858d413bfb673eb2a994c989498fe08cef062cd04db44c68f4d5ad54
|
data/ext/debase_internals.c
CHANGED
@@ -313,6 +313,35 @@ call_at_line(debug_context_t *context, char *file, int line, VALUE context_objec
|
|
313
313
|
rb_funcall(context_object, idAtLine, 2, rb_str_new2(file), INT2FIX(line));
|
314
314
|
}
|
315
315
|
|
316
|
+
int count_stack_size() {
|
317
|
+
rb_thread_t *thread = ruby_current_thread;
|
318
|
+
rb_control_frame_t *last_cfp = TH_CFP(thread);
|
319
|
+
rb_control_frame_t *start_cfp = RUBY_VM_END_CONTROL_FRAME(TH_INFO(thread));
|
320
|
+
rb_control_frame_t *cfp;
|
321
|
+
|
322
|
+
ptrdiff_t size, i;
|
323
|
+
|
324
|
+
start_cfp =
|
325
|
+
RUBY_VM_NEXT_CONTROL_FRAME(
|
326
|
+
RUBY_VM_NEXT_CONTROL_FRAME(start_cfp)); /* skip top frames */
|
327
|
+
|
328
|
+
if (start_cfp < last_cfp) {
|
329
|
+
size = 0;
|
330
|
+
}
|
331
|
+
else {
|
332
|
+
size = start_cfp - last_cfp + 1;
|
333
|
+
}
|
334
|
+
|
335
|
+
int stack_size = 0;
|
336
|
+
for (i=0, cfp = start_cfp; i<size; i++, cfp = RUBY_VM_NEXT_CONTROL_FRAME(cfp)) {
|
337
|
+
if (cfp->iseq && cfp->pc) {
|
338
|
+
stack_size++;
|
339
|
+
}
|
340
|
+
}
|
341
|
+
|
342
|
+
return stack_size;
|
343
|
+
}
|
344
|
+
|
316
345
|
static void
|
317
346
|
process_line_event(VALUE trace_point, void *data)
|
318
347
|
{
|
@@ -343,7 +372,8 @@ process_line_event(VALUE trace_point, void *data)
|
|
343
372
|
print_event(tp, context);
|
344
373
|
|
345
374
|
if(context->init_stack_size == -1) {
|
346
|
-
|
375
|
+
context->stack_size = count_stack_size();
|
376
|
+
context->init_stack_size = context->stack_size;
|
347
377
|
}
|
348
378
|
|
349
379
|
if (context->thread_pause) {
|
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.4
|
4
|
+
version: 0.2.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dennis Ushakov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debase-ruby_core_source
|