mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Fix string2cstr in lldb_cruby.py [ci skip]
This commit is contained in:
parent
3151d7876f
commit
27024004fa
1 changed files with 1 additions and 2 deletions
|
@ -197,12 +197,11 @@ def string2cstr(rstring):
|
||||||
flags = rstring.GetValueForExpressionPath(".basic->flags").unsigned
|
flags = rstring.GetValueForExpressionPath(".basic->flags").unsigned
|
||||||
if flags & RUBY_T_MASK != RUBY_T_STRING:
|
if flags & RUBY_T_MASK != RUBY_T_STRING:
|
||||||
raise TypeError("not a string")
|
raise TypeError("not a string")
|
||||||
|
clen = int(rstring.GetValueForExpressionPath(".len").value, 0)
|
||||||
if flags & RUBY_FL_USER1:
|
if flags & RUBY_FL_USER1:
|
||||||
cptr = int(rstring.GetValueForExpressionPath(".as.heap.ptr").value, 0)
|
cptr = int(rstring.GetValueForExpressionPath(".as.heap.ptr").value, 0)
|
||||||
clen = int(rstring.GetValueForExpressionPath(".as.heap.len").value, 0)
|
|
||||||
else:
|
else:
|
||||||
cptr = int(rstring.GetValueForExpressionPath(".as.embed.ary").location, 0)
|
cptr = int(rstring.GetValueForExpressionPath(".as.embed.ary").location, 0)
|
||||||
clen = int(rstring.GetValueForExpressionPath(".as.embed.len").value, 0)
|
|
||||||
return cptr, clen
|
return cptr, clen
|
||||||
|
|
||||||
def output_string(debugger, result, rstring):
|
def output_string(debugger, result, rstring):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue