[前][次][番号順一覧][スレッド一覧]

ruby-changes:38017

From: nobu <ko1@a...>
Date: Thu, 26 Mar 2015 15:51:15 +0900 (JST)
Subject: [ruby-changes:38017] nobu:r50098 (trunk): .gdbinit: T_IMEMO

nobu	2015-03-26 15:50:57 +0900 (Thu, 26 Mar 2015)

  New Revision: 50098

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50098

  Log:
    .gdbinit: T_IMEMO
    
    * .gdbinit (rp_imemo): print the content support of each T_IMEMO.

  Modified files:
    trunk/.gdbinit
Index: .gdbinit
===================================================================
--- .gdbinit	(revision 50097)
+++ .gdbinit	(revision 50098)
@@ -249,7 +249,7 @@ define rp https://github.com/ruby/ruby/blob/trunk/.gdbinit#L249
     printf "%sT_IMEMO%s(", $color_type, $color_end
     output (enum imemo_type)(($flags>>RUBY_FL_USHIFT)&imemo_mask)
     printf "): "
-    print *((VALUE (*)[4])($arg0))
+    rp_imemo $arg0
   else
   if ($flags & RUBY_T_MASK) == RUBY_T_NODE
     printf "%sT_NODE%s(", $color_type, $color_end
@@ -467,6 +467,40 @@ document rp_class https://github.com/ruby/ruby/blob/trunk/.gdbinit#L467
   Print the content of a Class/Module.
 end
 
+define rp_imemo
+  set $flags = (((struct RBasic *)($arg0))->flags >> RUBY_FL_USHIFT) & imemo_mask
+  if $flags == imemo_cref
+    printf "(rb_cref_t *) %p\n", (void*)$arg0
+    print *(rb_cref_t *)$arg0
+  else
+  if $flags == imemo_svar
+    printf "(struct vm_svar *) %p\n", (void*)$arg0
+    print *(struct vm_svar *)$arg0
+  else
+  if $flags == imemo_throw_data
+    printf "(struct vm_throw_data *) %p\n", (void*)$arg0
+    print *(struct vm_throw_data *)$arg0
+  else
+  if $flags == imemo_ifunc
+    printf "(struct vm_ifunc *) %p\n", (void*)$arg0
+    print *(struct vm_ifunc *)$arg0
+  else
+  if $flags == imemo_memo
+    printf "(struct MEMO *) %p\n", (void*)$arg0
+    print *(struct MEMO *)$arg0
+  else
+    printf "(struct RIMemo *) %p\n", (void*)$arg0
+    print *(struct RIMemo *)$arg0
+  end
+  end
+  end
+  end
+  end
+end
+document rp_imemo
+  Print the content of a memo
+end
+
 define nd_type
   print (enum node_type)((((NODE*)($arg0))->flags&RUBY_NODE_TYPEMASK)>>RUBY_NODE_TYPESHIFT)
 end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]