summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-28 19:55:07 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-28 20:03:54 +0900
commit545e01645f7350c255f79b90f184a1317d3d55fb (patch)
tree8017516dc1c49383eda67f7c7616913da46efa69 /misc
parent8bdaaeb99a7e737f9cde38889b94b2bd83d9d2dc (diff)
lldb: Show encoding of String [ci skip]
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/lldb_cruby.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/misc/lldb_cruby.py b/misc/lldb_cruby.py
index 8461eea8b3..c7a25984ae 100755
--- a/misc/lldb_cruby.py
+++ b/misc/lldb_cruby.py
@@ -287,6 +287,8 @@ def lldb_inspect(debugger, target, result, val):
append_command_output(debugger, "print *(struct RClass*)%0#x" % val.GetValueAsUnsigned(), result)
elif flType == RUBY_T_STRING:
result.write('T_STRING: %s' % flaginfo)
+ encidx = ((flags & RUBY_ENCODING_MASK)>>RUBY_ENCODING_SHIFT)
+ result.write('[%s] ' % target.FindFirstType("enum ruby_preserved_encindex").GetEnumMembers().GetTypeEnumMemberAtIndex(encidx).GetName()[14:])
tRString = target.FindFirstType("struct RString").GetPointerType()
ptr, len = string2cstr(val.Cast(tRString))
if len == 0: