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

ruby-changes:48014

From: nobu <ko1@a...>
Date: Fri, 6 Oct 2017 15:11:30 +0900 (JST)
Subject: [ruby-changes:48014] nobu:r60128 (trunk): .gdbinit: print_id in rp_id [ci skip]

nobu	2017-10-06 15:11:25 +0900 (Fri, 06 Oct 2017)

  New Revision: 60128

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

  Log:
    .gdbinit: print_id in rp_id [ci skip]
    
    * .gdbinit (rp_id): use print_id instead of calling
      lookup_id_str() in a debugger context.
    
    * symbol.c (ID_ENTRY_UNIT): made visible to debuggers.

  Modified files:
    trunk/.gdbinit
    trunk/symbol.c
Index: symbol.c
===================================================================
--- symbol.c	(revision 60127)
+++ symbol.c	(revision 60128)
@@ -51,7 +51,7 @@ Init_op_tbl(void) https://github.com/ruby/ruby/blob/trunk/symbol.c#L51
     }
 }
 
-enum {ID_ENTRY_UNIT = 512};
+static const int ID_ENTRY_UNIT = 512;
 
 enum id_entry_type {
     ID_ENTRY_STR,
Index: .gdbinit
===================================================================
--- .gdbinit	(revision 60127)
+++ .gdbinit	(revision 60128)
@@ -398,12 +398,7 @@ define rp_id https://github.com/ruby/ruby/blob/trunk/.gdbinit#L398
       end
     end
     printf "(%ld): ", $id
-    set $str = lookup_id_str($id)
-    if $str
-      rp_string $str
-    else
-      echo undef\n
-    end
+    print_id $id
   end
   end
   end
@@ -1093,7 +1088,11 @@ define print_id https://github.com/ruby/ruby/blob/trunk/.gdbinit#L1088
           set $arylen = $ary->as.heap.len
         end
         set $result = $aryptr[($serial % ID_ENTRY_UNIT) * ID_ENTRY_SIZE + $t]
-        print_string $result
+	if $result != RUBY_Qnil
+          print_string $result
+	else
+	  echo undef\n
+	end
       end
     end
   end

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

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