heap_dump 0.0.26 → 0.0.27

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
1
+ source 'http://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in heap_dump.gemspec
4
4
  gemspec
@@ -68,6 +68,7 @@ static ID classid;
68
68
  #define yg_rstring(str) yg_string(RSTRING_PTR(str), (unsigned int)RSTRING_LEN(str))
69
69
  #define yg_int(i) yajl_gen_integer(ctx->yajl, i)
70
70
  #define yg_double(d) (yajl_gen_double(ctx->yajl, d)==yajl_gen_invalid_number? yg_cstring("inf|NaN") : true)
71
+ #define yg_null() yajl_gen_null(ctx->yajl)
71
72
 
72
73
  //#define yg_id(obj) yg_int(NUM2LONG(rb_obj_id(obj)))
73
74
  #define yg_id(obj) yg_id1(obj,ctx)
@@ -507,7 +508,14 @@ static int dump_method_entry_i(ID key, const rb_method_entry_t *me, st_data_t da
507
508
  }
508
509
 
509
510
  static int dump_iv_entry(ID key, VALUE value, walk_ctx_t *ctx){
510
- yg_cstring(rb_id2name(key));
511
+ const char* key_str = rb_id2name(key);
512
+ if(key_str)
513
+ yg_cstring(key_str);
514
+ else{
515
+ printf("Null key! %d\n", key);
516
+ yg_cstring("___null_key___");
517
+ //yg_null();
518
+ }
511
519
  yg_id(value);
512
520
  return ST_CONTINUE;
513
521
  }
@@ -1361,11 +1369,11 @@ static void dump_thread(const rb_thread_t* th, walk_ctx_t *ctx){
1361
1369
  }
1362
1370
 
1363
1371
  yg_cstring("local_storage");
1364
- yajl_gen_array_open(ctx->yajl);
1372
+ yajl_gen_map_open(ctx->yajl);
1365
1373
  if(th->local_storage){
1366
1374
  st_foreach(th->local_storage, dump_iv_entry, (st_data_t)ctx); //?
1367
1375
  }
1368
- yajl_gen_array_close(ctx->yajl);
1376
+ yajl_gen_map_close(ctx->yajl);
1369
1377
 
1370
1378
  // mark_event_hooks(th->event_hooks);
1371
1379
  rb_event_hook_t *hook = th->event_hooks;
@@ -1389,9 +1397,6 @@ static void dump_machine_context(walk_ctx_t *ctx){
1389
1397
  VALUE *stack_start, *stack_end;
1390
1398
 
1391
1399
 
1392
- yg_cstring("registers");
1393
- yajl_gen_array_open(ctx->yajl);
1394
-
1395
1400
  FLUSH_REGISTER_WINDOWS;
1396
1401
  /* This assumes that all registers are saved into the jmp_buf (and stack) */
1397
1402
  rb_setjmp(save_regs_gc_mark.j);
@@ -1399,6 +1404,8 @@ static void dump_machine_context(walk_ctx_t *ctx){
1399
1404
  SET_STACK_END;
1400
1405
  GET_STACK_BOUNDS(stack_start, stack_end, 1);
1401
1406
 
1407
+ yg_cstring("registers");
1408
+ yajl_gen_array_open(ctx->yajl);
1402
1409
  //mark_locations_array(objspace, save_regs_gc_mark.v, numberof(save_regs_gc_mark.v));
1403
1410
  VALUE* x = save_regs_gc_mark.v;
1404
1411
  unsigned long n = numberof(save_regs_gc_mark.v);
@@ -1,3 +1,3 @@
1
1
  module HeapDump
2
- VERSION = "0.0.26"
2
+ VERSION = "0.0.27"
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.26
4
+ version: 0.0.27
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-02 00:00:00.000000000 Z
12
+ date: 2012-11-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: debugger-ruby_core_source
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  segments:
107
107
  - 0
108
- hash: -4211610270399320096
108
+ hash: -130654953779884601
109
109
  requirements: []
110
110
  rubyforge_project:
111
111
  rubygems_version: 1.8.24