aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-10-09 09:01:11 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-10-09 09:08:09 +0900
commit98131f148f057b1364ae080f99b1efb2dc72002a (patch)
tree072bf76629fe765df43d94c58c53804ebf2565ea /misc
parent7909f06212ae8df6ba7203f8152292a190b2b33a (diff)
downloadruby-98131f148f057b1364ae080f99b1efb2dc72002a.tar.gz
lldb_cruby.py: fixed embedded string ptr [ci skip]
Use GetLocation to get the address of embedded array.
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/lldb_cruby.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/misc/lldb_cruby.py b/misc/lldb_cruby.py
index 3b46dcb4f0..45ba6e3828 100755
--- a/misc/lldb_cruby.py
+++ b/misc/lldb_cruby.py
@@ -33,6 +33,8 @@ def lldb_init(debugger):
def string2cstr(rstring):
"""Returns the pointer to the C-string in the given String object"""
+ if rstring.TypeIsPointerType():
+ rstring = rstring.Dereference()
flags = rstring.GetValueForExpressionPath(".basic->flags").unsigned
if flags & RUBY_T_MASK != RUBY_T_STRING:
raise TypeError("not a string")
@@ -40,7 +42,7 @@ def string2cstr(rstring):
cptr = int(rstring.GetValueForExpressionPath(".as.heap.ptr").value, 0)
clen = int(rstring.GetValueForExpressionPath(".as.heap.len").value, 0)
else:
- cptr = int(rstring.GetValueForExpressionPath(".as.ary").value, 0)
+ cptr = int(rstring.GetValueForExpressionPath(".as.ary").location, 0)
clen = (flags & RSTRING_EMBED_LEN_MASK) >> RSTRING_EMBED_LEN_SHIFT
return cptr, clen