diff options
| author | Alexis Beingessner <a.beingessner@gmail.com> | 2015-07-17 10:41:32 -0700 |
|---|---|---|
| committer | Alexis Beingessner <a.beingessner@gmail.com> | 2015-07-17 10:43:58 -0700 |
| commit | b0ee1ebef4d2b2f0e396438a3db259c981dc2754 (patch) | |
| tree | ea90d807bc719d33c39d41962a329c97688a787a | |
| parent | bfa0e1f58acf1c28d500c34ed258f09ae021893e (diff) | |
| download | rust-b0ee1ebef4d2b2f0e396438a3db259c981dc2754.tar.gz rust-b0ee1ebef4d2b2f0e396438a3db259c981dc2754.zip | |
fix pretty printers to handle new Vec
| -rw-r--r-- | src/etc/debugger_pretty_printers_common.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/etc/debugger_pretty_printers_common.py b/src/etc/debugger_pretty_printers_common.py index 6e667b37a9c..06a83c75936 100644 --- a/src/etc/debugger_pretty_printers_common.py +++ b/src/etc/debugger_pretty_printers_common.py @@ -55,12 +55,10 @@ SLICE_FIELD_NAME_LENGTH = "length" SLICE_FIELD_NAMES = [SLICE_FIELD_NAME_DATA_PTR, SLICE_FIELD_NAME_LENGTH] # std::Vec<> related constants -STD_VEC_FIELD_NAME_DATA_PTR = "ptr" STD_VEC_FIELD_NAME_LENGTH = "len" -STD_VEC_FIELD_NAME_CAPACITY = "cap" -STD_VEC_FIELD_NAMES = [STD_VEC_FIELD_NAME_DATA_PTR, - STD_VEC_FIELD_NAME_LENGTH, - STD_VEC_FIELD_NAME_CAPACITY] +STD_VEC_FIELD_NAME_BUF = "buf" +STD_VEC_FIELD_NAMES = [STD_VEC_FIELD_NAME_BUF, + STD_VEC_FIELD_NAME_LENGTH] # std::String related constants STD_STRING_FIELD_NAMES = ["vec"] @@ -302,13 +300,13 @@ def get_discriminant_value_as_integer(enum_val): def extract_length_ptr_and_cap_from_std_vec(vec_val): assert vec_val.type.get_type_kind() == TYPE_KIND_STD_VEC length_field_index = STD_VEC_FIELD_NAMES.index(STD_VEC_FIELD_NAME_LENGTH) - ptr_field_index = STD_VEC_FIELD_NAMES.index(STD_VEC_FIELD_NAME_DATA_PTR) - cap_field_index = STD_VEC_FIELD_NAMES.index(STD_VEC_FIELD_NAME_CAPACITY) + buf_field_index = STD_VEC_FIELD_NAMES.index(STD_VEC_FIELD_NAME_BUF) length = vec_val.get_child_at_index(length_field_index).as_integer() - vec_ptr_val = vec_val.get_child_at_index(ptr_field_index) - capacity = vec_val.get_child_at_index(cap_field_index).as_integer() + buf = vec_val.get_child_at_index(buf_field_index) + vec_ptr_val = buf.get_child_at_index(0) + capacity = buf.get_child_at_index(1).as_integer() unique_ptr_val = vec_ptr_val.get_child_at_index(0) data_ptr = unique_ptr_val.get_child_at_index(0) assert data_ptr.type.get_dwarf_type_kind() == DWARF_TYPE_CODE_PTR |
