diff options
author | Peter Zhu <[email protected]> | 2023-08-29 19:31:53 -0400 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2023-08-29 19:31:53 -0400 |
commit | 27024004fa9804631c6f21e2022bb2dd690e8c5c (patch) | |
tree | 9c8a82c0565cdc420e329c7d5d2595629b1d3745 /misc | |
parent | 3151d7876fac408ad7060b317ae7798263870daa (diff) |
Fix string2cstr in lldb_cruby.py [ci skip]
Diffstat (limited to 'misc')
-rwxr-xr-x | misc/lldb_cruby.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/misc/lldb_cruby.py b/misc/lldb_cruby.py index 95e03c6209..e667a46628 100755 --- a/misc/lldb_cruby.py +++ b/misc/lldb_cruby.py @@ -197,12 +197,11 @@ def string2cstr(rstring): flags = rstring.GetValueForExpressionPath(".basic->flags").unsigned if flags & RUBY_T_MASK != RUBY_T_STRING: raise TypeError("not a string") + clen = int(rstring.GetValueForExpressionPath(".len").value, 0) if flags & RUBY_FL_USER1: cptr = int(rstring.GetValueForExpressionPath(".as.heap.ptr").value, 0) - clen = int(rstring.GetValueForExpressionPath(".as.heap.len").value, 0) else: cptr = int(rstring.GetValueForExpressionPath(".as.embed.ary").location, 0) - clen = int(rstring.GetValueForExpressionPath(".as.embed.len").value, 0) return cptr, clen def output_string(debugger, result, rstring): |