heap_dump 0.0.22 → 0.0.23

Sign up to get free protection for your applications and to get access to all the features.
@@ -642,6 +642,19 @@ static void dump_locations(VALUE* p, int n, walk_ctx_t *ctx){
642
642
  static void dump_thread(rb_thread_t* th, walk_ctx_t *ctx);
643
643
 
644
644
 
645
+ vm_dump_each_thread_func(st_data_t key, VALUE obj, walk_ctx_t *ctx){
646
+ //here stored 'self' from thread
647
+ // yg_map();
648
+ ygh_id("id", obj);
649
+ // const rb_thread_t *th = obj; //RTYPEDDATA_DATA(obj);
650
+
651
+ //or direct pointer?
652
+ // dump_thread(th, ctx);
653
+ //yg_id(obj);
654
+ // yg_map_end();
655
+ return ST_CONTINUE;
656
+ }
657
+
645
658
 
646
659
  static void dump_data_if_known(VALUE obj, walk_ctx_t *ctx){
647
660
 
@@ -801,9 +814,12 @@ static void dump_data_if_known(VALUE obj, walk_ctx_t *ctx){
801
814
  ygh_id("coverages", vm->coverages);
802
815
 
803
816
  //TODO:
804
- // if (vm->living_threads) {
805
- // st_foreach(vm->living_threads, vm_mark_each_thread_func, 0);
806
- // }
817
+ if (vm->living_threads) {
818
+ yg_cstring("threads");
819
+ yg_array();
820
+ st_foreach(vm->living_threads, vm_dump_each_thread_func, ctx);
821
+ yg_array_end();
822
+ }
807
823
  // rb_gc_mark_locations(vm->special_exceptions, vm->special_exceptions + ruby_special_error_count);
808
824
 
809
825
  // if (vm->loading_table) {
@@ -843,18 +859,14 @@ static void dump_data_if_known(VALUE obj, walk_ctx_t *ctx){
843
859
  yg_map_end();
844
860
 
845
861
  //stacks:
846
- VALUE *vm_stack = fib->cont.vm_stack;
847
- int i = 0;
848
- for(; vm_stack && i < fib->cont.vm_stack_slen + fib->cont.vm_stack_clen; i++){
849
- yg_id(*(vm_stack++));
850
- }
851
- vm_stack = fib->cont.vm_stack;
852
- for(i = 0;vm_stack && i<fib->cont.machine_stack_size; i++){
853
- yg_id(*(vm_stack++));
854
- }
855
862
  yg_cstring("stack");
856
863
  yg_array();
857
-
864
+ if(fib->cont.vm_stack) {
865
+ dump_locations(fib->cont.vm_stack, fib->cont.vm_stack_slen + fib->cont.vm_stack_clen, ctx);
866
+ }
867
+ if (fib->cont.machine_stack) {
868
+ dump_locations(fib->cont.machine_stack, fib->cont.machine_stack_size, ctx);
869
+ }
858
870
  yg_array_end();
859
871
  yg_map_end();
860
872
  return;
@@ -1,3 +1,3 @@
1
1
  module HeapDump
2
- VERSION = "0.0.22"
2
+ VERSION = "0.0.23"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heap_dump
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-06-13 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby-internal
16
- requirement: &70094219359320 !ruby/object:Gem::Requirement
16
+ requirement: &70260712620720 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.8.5
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70094219359320
24
+ version_requirements: *70260712620720
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: yajl-ruby
27
- requirement: &70094219358420 !ruby/object:Gem::Requirement
27
+ requirement: &70260712619500 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '1.1'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70094219358420
35
+ version_requirements: *70260712619500
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake-compiler
38
- requirement: &70094219358020 !ruby/object:Gem::Requirement
38
+ requirement: &70260712618740 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70094219358020
46
+ version_requirements: *70260712618740
47
47
  description: Ruby 1.9 heap contents dumper
48
48
  email:
49
49
  - vasilyfedoseyev@gmail.com