]> git.lizzy.rs Git - rust.git/blobdiff - src/etc/debugger_pretty_printers_common.py
Rollup merge of #69050 - nnethercote:micro-optimize-leb128, r=michaelwoerister
[rust.git] / src / etc / debugger_pretty_printers_common.py
index b99e401929e62f643ea33b281af2dc5253ccb4d3..b3f8f50636bee754b81d0280b505ece3bb9f1a51 100644 (file)
@@ -1,13 +1,3 @@
-# Copyright 2015 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.
-
 """
 This module provides an abstraction layer over common Rust pretty printing
 functionality needed by both GDB and LLDB.
 """
 This module provides an abstraction layer over common Rust pretty printing
 functionality needed by both GDB and LLDB.
@@ -222,7 +212,6 @@ class Type(object):
         # REGULAR STRUCT
         return TYPE_KIND_REGULAR_STRUCT
 
         # REGULAR STRUCT
         return TYPE_KIND_REGULAR_STRUCT
 
-
     def __classify_union(self):
         assert self.get_dwarf_type_kind() == DWARF_TYPE_CODE_UNION
 
     def __classify_union(self):
         assert self.get_dwarf_type_kind() == DWARF_TYPE_CODE_UNION
 
@@ -243,7 +232,6 @@ class Type(object):
         else:
             return TYPE_KIND_REGULAR_UNION
 
         else:
             return TYPE_KIND_REGULAR_UNION
 
-
     def __conforms_to_field_layout(self, expected_fields):
         actual_fields = self.get_fields()
         actual_field_count = len(actual_fields)
     def __conforms_to_field_layout(self, expected_fields):
         actual_fields = self.get_fields()
         actual_field_count = len(actual_fields)
@@ -352,8 +340,7 @@ def extract_length_ptr_and_cap_from_std_vec(vec_val):
 
     vec_ptr_val = buf.get_child_at_index(0)
     capacity = buf.get_child_at_index(1).as_integer()
 
     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)
+    data_ptr = vec_ptr_val.get_child_at_index(0)
     assert data_ptr.type.get_dwarf_type_kind() == DWARF_TYPE_CODE_PTR
     return (length, data_ptr, capacity)
 
     assert data_ptr.type.get_dwarf_type_kind() == DWARF_TYPE_CODE_PTR
     return (length, data_ptr, capacity)
 
@@ -370,11 +357,11 @@ def extract_tail_head_ptr_and_cap_from_std_vecdeque(vec_val):
 
     vec_ptr_val = buf.get_child_at_index(0)
     capacity = buf.get_child_at_index(1).as_integer()
 
     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)
+    data_ptr = vec_ptr_val.get_child_at_index(0)
     assert data_ptr.type.get_dwarf_type_kind() == DWARF_TYPE_CODE_PTR
     return (tail, head, data_ptr, capacity)
 
     assert data_ptr.type.get_dwarf_type_kind() == DWARF_TYPE_CODE_PTR
     return (tail, head, data_ptr, capacity)
 
+
 def extract_length_and_ptr_from_slice(slice_val):
     assert (slice_val.type.get_type_kind() == TYPE_KIND_SLICE or
             slice_val.type.get_type_kind() == TYPE_KIND_STR_SLICE)
 def extract_length_and_ptr_from_slice(slice_val):
     assert (slice_val.type.get_type_kind() == TYPE_KIND_SLICE or
             slice_val.type.get_type_kind() == TYPE_KIND_STR_SLICE)
@@ -388,8 +375,10 @@ def extract_length_and_ptr_from_slice(slice_val):
     assert data_ptr.type.get_dwarf_type_kind() == DWARF_TYPE_CODE_PTR
     return (length, data_ptr)
 
     assert data_ptr.type.get_dwarf_type_kind() == DWARF_TYPE_CODE_PTR
     return (length, data_ptr)
 
+
 UNQUALIFIED_TYPE_MARKERS = frozenset(["(", "[", "&", "*"])
 
 UNQUALIFIED_TYPE_MARKERS = frozenset(["(", "[", "&", "*"])
 
+
 def extract_type_name(qualified_type_name):
     """Extracts the type name from a fully qualified path"""
     if qualified_type_name[0] in UNQUALIFIED_TYPE_MARKERS:
 def extract_type_name(qualified_type_name):
     """Extracts the type name from a fully qualified path"""
     if qualified_type_name[0] in UNQUALIFIED_TYPE_MARKERS:
@@ -405,6 +394,7 @@ def extract_type_name(qualified_type_name):
     else:
         return qualified_type_name[index + 2:]
 
     else:
         return qualified_type_name[index + 2:]
 
+
 try:
     compat_str = unicode  # Python 2
 except NameError:
 try:
     compat_str = unicode  # Python 2
 except NameError: