Added a pretty printer for &mut slices

This commit is contained in:
Nikhil Shagrithaya 2016-06-29 20:04:06 +05:30
parent 7e07e31600
commit 036b08917d
2 changed files with 8 additions and 1 deletions

View File

@ -139,7 +139,7 @@ class Type(object):
return TYPE_KIND_STR_SLICE
# REGULAR SLICE
if (unqualified_type_name.startswith("&[") and
if (unqualified_type_name.startswith(("&[", "&mut [")) and
unqualified_type_name.endswith("]") and
self.__conforms_to_field_layout(SLICE_FIELD_NAMES)):
return TYPE_KIND_SLICE

View File

@ -53,6 +53,11 @@
// gdb-command:print *((int64_t[2]*)('vec_slices::MUT_VECT_SLICE'.data_ptr))
// gdb-check:$15 = {64, 65}
//gdb-command:print mut_slice.length
//gdb-check:$16 = 5
//gdb-command:print *((int64_t[5]*)(mut_slice.data_ptr))
//gdb-check:$17 = {1, 2, 3, 4, 5}
// === LLDB TESTS ==================================================================================
@ -106,6 +111,8 @@ fn main() {
MUT_VECT_SLICE = VECT_SLICE;
}
let mut_slice: &mut [i64] = &mut [1, 2, 3, 4, 5];
zzz(); // #break
}