summaryrefslogtreecommitdiff
path: root/src/etc
diff options
context:
space:
mode:
authorAndy Russell <arussell123@gmail.com>2019-02-21 20:21:50 -0500
committerAndy Russell <arussell123@gmail.com>2019-03-06 12:28:38 -0500
commit9e5def9616aba274a6c3138d9f66e778d50c35e0 (patch)
treeea75e44389d8de50225c940509d7b4f592013d14 /src/etc
parent7f19f161f24c9a02ff8c3f73122d0b015039221f (diff)
downloadrust-9e5def9616aba274a6c3138d9f66e778d50c35e0.tar.gz
rust-lldb: fix crash when printing empty string
Diffstat (limited to 'src/etc')
-rw-r--r--src/etc/lldb_rust_formatters.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/etc/lldb_rust_formatters.py b/src/etc/lldb_rust_formatters.py
index 2c651c90f82..fdc1c4fa0cc 100644
--- a/src/etc/lldb_rust_formatters.py
+++ b/src/etc/lldb_rust_formatters.py
@@ -290,6 +290,8 @@ def print_array_of_values(array_name, data_ptr_val, length, internal_dict):
def read_utf8_string(ptr_val, byte_count):
+ if byte_count == 0:
+ return '""'
error = lldb.SBError()
process = ptr_val.get_wrapped_value().GetProcess()
data = process.ReadMemory(ptr_val.as_integer(), byte_count, error)