aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-26 12:28:56 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-26 12:53:11 +0900
commitb5174beae6e02b109ed2c5d5ad9c4653596236e4 (patch)
tree3424bb7a817e316cb9d156dca9db9aa5de0f6497 /misc
parent034b8472ba369b3f044c3735b0cab8e5e76e38f7 (diff)
downloadruby-b5174beae6e02b109ed2c5d5ad9c4653596236e4.tar.gz
lldb_cruby.py: fixed empty string dump [ci skip]
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/lldb_cruby.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/misc/lldb_cruby.py b/misc/lldb_cruby.py
index a582b7dde0..88765813e4 100755
--- a/misc/lldb_cruby.py
+++ b/misc/lldb_cruby.py
@@ -132,7 +132,10 @@ def lldb_inspect(debugger, target, result, val):
result.write('T_STRING: %s' % flaginfo)
tRString = target.FindFirstType("struct RString").GetPointerType()
ptr, len = string2cstr(val.Cast(tRString))
- append_command_output(debugger, "print *(const char (*)[%d])%0#x" % (len, ptr), result)
+ if len == 0:
+ result.write("(empty)\n")
+ else:
+ append_command_output(debugger, "print *(const char (*)[%d])%0#x" % (len, ptr), result)
elif flType == RUBY_T_SYMBOL:
result.write('T_SYMBOL: %s' % flaginfo)
tRSymbol = target.FindFirstType("struct RSymbol").GetPointerType()