9
9
if sys .version_info [0 ] >= 3 :
10
10
xrange = range
11
11
12
- rust_enabled = 'set language rust' in gdb .execute ('complete set language ru' , to_string = True )
12
+ rust_enabled = 'set language rust' in gdb .execute ('complete set language ru' , to_string = True )
13
13
14
14
# The btree pretty-printers fail in a confusing way unless
15
15
# https://sourceware.org/bugzilla/show_bug.cgi?id=21763 is fixed.
21
21
if int (_match .group (1 )) > 8 or (int (_match .group (1 )) == 8 and int (_match .group (2 )) >= 1 ):
22
22
gdb_81 = True
23
23
24
- #===============================================================================
24
+ # ===============================================================================
25
25
# GDB Pretty Printing Module for Rust
26
- #===============================================================================
26
+ # ===============================================================================
27
+
27
28
28
29
class GdbType (rustpp .Type ):
29
30
@@ -133,39 +134,39 @@ def rust_pretty_printer_lookup_function(gdb_val):
133
134
134
135
if type_kind == rustpp .TYPE_KIND_REGULAR_STRUCT :
135
136
return RustStructPrinter (val ,
136
- omit_first_field = False ,
137
- omit_type_name = False ,
138
- is_tuple_like = False )
137
+ omit_first_field = False ,
138
+ omit_type_name = False ,
139
+ is_tuple_like = False )
139
140
140
141
if type_kind == rustpp .TYPE_KIND_STRUCT_VARIANT :
141
142
return RustStructPrinter (val ,
142
- omit_first_field = True ,
143
- omit_type_name = False ,
144
- is_tuple_like = False )
143
+ omit_first_field = True ,
144
+ omit_type_name = False ,
145
+ is_tuple_like = False )
145
146
146
147
if type_kind == rustpp .TYPE_KIND_STR_SLICE :
147
148
return RustStringSlicePrinter (val )
148
149
149
150
if type_kind == rustpp .TYPE_KIND_TUPLE :
150
151
return RustStructPrinter (val ,
151
- omit_first_field = False ,
152
- omit_type_name = True ,
153
- is_tuple_like = True )
152
+ omit_first_field = False ,
153
+ omit_type_name = True ,
154
+ is_tuple_like = True )
154
155
155
156
if type_kind == rustpp .TYPE_KIND_TUPLE_STRUCT :
156
157
return RustStructPrinter (val ,
157
- omit_first_field = False ,
158
- omit_type_name = False ,
159
- is_tuple_like = True )
158
+ omit_first_field = False ,
159
+ omit_type_name = False ,
160
+ is_tuple_like = True )
160
161
161
162
if type_kind == rustpp .TYPE_KIND_CSTYLE_VARIANT :
162
163
return RustCStyleVariantPrinter (val .get_child_at_index (0 ))
163
164
164
165
if type_kind == rustpp .TYPE_KIND_TUPLE_VARIANT :
165
166
return RustStructPrinter (val ,
166
- omit_first_field = True ,
167
- omit_type_name = False ,
168
- is_tuple_like = True )
167
+ omit_first_field = True ,
168
+ omit_type_name = False ,
169
+ is_tuple_like = True )
169
170
170
171
if type_kind == rustpp .TYPE_KIND_SINGLETON_ENUM :
171
172
variant = get_field_at_index (gdb_val , 0 )
@@ -189,9 +190,9 @@ def rust_pretty_printer_lookup_function(gdb_val):
189
190
return None
190
191
191
192
192
- #=------------------------------------------------------------------------------
193
+ # =------------------------------------------------------------------------------
193
194
# Pretty Printer Classes
194
- #=------------------------------------------------------------------------------
195
+ # =------------------------------------------------------------------------------
195
196
class RustEmptyPrinter (object ):
196
197
def __init__ (self , val ):
197
198
self .__val = val
@@ -355,6 +356,7 @@ def children_of_node(boxed_node, height, want_values):
355
356
else :
356
357
yield keys [i ]['value' ]['value' ]
357
358
359
+
358
360
class RustStdBTreeSetPrinter (object ):
359
361
def __init__ (self , val ):
360
362
self .__val = val
@@ -429,6 +431,7 @@ def to_string(self):
429
431
def display_hint (self ):
430
432
return "string"
431
433
434
+
432
435
class RustCStyleVariantPrinter (object ):
433
436
def __init__ (self , val ):
434
437
assert val .type .get_dwarf_type_kind () == rustpp .DWARF_TYPE_CODE_ENUM
0 commit comments