]> git.lizzy.rs Git - rust.git/blobdiff - src/etc/lldb_rust_formatters.py
Rollup merge of #68504 - tmiasko:check-pass, r=alexcrichton
[rust.git] / src / etc / lldb_rust_formatters.py
index 2bbd4372721cbc2f724dada47454f68f02573bba..fdc1c4fa0cc38d95d0f74e324b596dbcec729347 100644 (file)
@@ -1,13 +1,3 @@
-# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-# file at the top-level directory of this distribution and at
-# http://rust-lang.org/COPYRIGHT.
-#
-# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-# option. This file may not be copied, modified, or distributed
-# except according to those terms.
-
 import lldb
 import re
 import debugger_pretty_printers_common as rustpp
@@ -300,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)