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

ruby-changes:52702

From: nobu <ko1@a...>
Date: Thu, 4 Oct 2018 23:00:46 +0900 (JST)
Subject: [ruby-changes:52702] nobu:r64914 (trunk): lldb_rp: support Symbol [ci skip]

nobu	2018-10-04 23:00:39 +0900 (Thu, 04 Oct 2018)

  New Revision: 64914

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

  Log:
    lldb_rp: support Symbol [ci skip]

  Modified files:
    trunk/misc/lldb_cruby.py
Index: misc/lldb_cruby.py
===================================================================
--- misc/lldb_cruby.py	(revision 64913)
+++ misc/lldb_cruby.py	(revision 64914)
@@ -55,6 +55,9 @@ def fixnum_p(x): https://github.com/ruby/ruby/blob/trunk/misc/lldb_cruby.py#L55
 def flonum_p(x):
     return (x&RUBY_FLONUM_MASK) == RUBY_FLONUM_FLAG
 
+def static_sym_p(x):
+    return (x&~(~0<<RUBY_SPECIAL_SHIFT)) == RUBY_SYMBOL_FLAG
+
 def append_command_output(debugger, command, result):
     output1 = result.GetOutput()
     debugger.GetCommandInterpreter().HandleCommand(command, result)
@@ -92,6 +95,11 @@ def lldb_rp(debugger, command, result, i https://github.com/ruby/ruby/blob/trunk/misc/lldb_cruby.py#L95
         print >> result, num >> 1
     elif flonum_p(num):
         append_command_output(debugger, "print rb_float_value(%0#x)" % val.GetValueAsUnsigned(), result)
+    elif static_sym_p(num):
+        if num < 128:
+            print >> result, "T_SYMBOL: %c" % num
+        else:
+            print >> result, "T_SYMBOL: (%x)" % num
     elif num & RUBY_IMMEDIATE_MASK:
         print >> result, 'immediate(%x)' % num
     else:
@@ -120,6 +128,9 @@ def lldb_rp(debugger, command, result, i https://github.com/ruby/ruby/blob/trunk/misc/lldb_cruby.py#L128
                 print >> result, val.GetValueForExpressionPath("->as.heap")
             else:
                 print >> result, val.GetValueForExpressionPath("->as.ary")
+        elif flType == RUBY_T_SYMBOL:
+            tRSymbol = target.FindFirstType("struct RSymbol").GetPointerType()
+            print >> result, val.Cast(tRSymbol).Dereference()
         elif flType == RUBY_T_ARRAY:
             tRArray = target.FindFirstType("struct RArray").GetPointerType()
             val = val.Cast(tRArray)

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

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