Skip to content

Commit

Permalink
Auto merge of #34550 - cynicaldevil:master, r=Manishearth
Browse files Browse the repository at this point in the history
Added a pretty printer for &mut slices

Fixes #30232
I have added a test which checks for correctness in gdb, but I need some help to do the same for lldb.

r? @Manishearth
  • Loading branch information
bors authored Jul 4, 2016
2 parents bbdbe99 + 036b089 commit d98da85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/etc/debugger_pretty_printers_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def __classify_struct(self):
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
Expand Down
7 changes: 7 additions & 0 deletions src/test/debuginfo/vec-slices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ==================================================================================

Expand Down Expand Up @@ -106,6 +111,8 @@ fn main() {
MUT_VECT_SLICE = VECT_SLICE;
}

let mut_slice: &mut [i64] = &mut [1, 2, 3, 4, 5];

zzz(); // #break
}

Expand Down

0 comments on commit d98da85

Please sign in to comment.