Skip to content
This repository
Browse code

Added gdb rph to print object given its subtend handle.

  • Loading branch information...
commit f51ae8a38507f5c3d49e7a33a6ea5cd634e5236f 1 parent 0a16322
Brian Shirai authored
4  .gdbinit
@@ -10,6 +10,10 @@ define rps
10 10
 p __show_simple__($arg0)
11 11
 end
12 12
 
  13
+define rph
  14
+p __show_subtend__($arg0)
  15
+end
  16
+
13 17
 define validate
14 18
 p rubinius::VM::current_state()->om->validate_object($arg0)
15 19
 end
11  vm/subtend/ruby.cpp
@@ -1388,4 +1388,15 @@ extern "C" {
1388 1388
 
1389 1389
     return rb_funcall(block_handle, rb_intern("call"), 1, argument_handle);
1390 1390
   }
  1391
+
  1392
+  /* For debugging. */
  1393
+  void __show_subtend__(VALUE obj_handle) {
  1394
+    NativeMethodEnvironment* env = NativeMethodEnvironment::get();
  1395
+
  1396
+    Object* object = env->get_object(obj_handle);
  1397
+    if(!object) {
  1398
+      std::cout << "the object is NULL, check if an exception was raised." << std::endl;
  1399
+    }
  1400
+    object->show(env->state());
  1401
+  }
1391 1402
 }

0 notes on commit f51ae8a

Please sign in to comment.
Something went wrong with that request. Please try again.