Skip to content

Commit 638ef24

Browse files
committed
Clean up whitespace
1 parent 0d51efa commit 638ef24

23 files changed

+52
-52
lines changed

elftools/common/construct_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def __init__(self, name):
110110
def _parse(self, stream, context):
111111
(h, l) = _UBInt24_packer.unpack(StaticField._parse(self, stream, context))
112112
return l | (h << 16)
113-
113+
114114
def _build(self, obj, stream, context):
115115
StaticField._build(self, _UBInt24_packer.pack(obj >> 16, obj & 0xFFFF), stream, context)
116116

@@ -122,6 +122,6 @@ def __init__(self, name):
122122
def _parse(self, stream, context):
123123
(l, h) = _ULInt24_packer.unpack(StaticField._parse(self, stream, context))
124124
return l | (h << 16)
125-
125+
126126
def _build(self, obj, stream, context):
127127
StaticField._build(self, _ULInt24_packer.pack(obj & 0xFFFF, obj >> 16), stream, context)

elftools/dwarf/aranges.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def _get_entries(self, need_empty=False):
6161
Terminating null entries of CU blocks are not returned, unless
6262
need_empty is set to True and the CU block contains nothing but
6363
a null entry. The null entry will have both address and length
64-
set to 0.
64+
set to 0.
6565
"""
6666
self.stream.seek(0)
6767
entries = []
@@ -103,7 +103,7 @@ def _get_entries(self, need_empty=False):
103103
if addr != 0 or length != 0:
104104
addr = struct_parse(addr_size('addr'), self.stream)
105105
length = struct_parse(addr_size('length'), self.stream)
106-
106+
107107
# Segmentation exists in executable
108108
elif aranges_header["segment_size"] != 0:
109109
raise NotImplementedError("Segmentation not implemented")

elftools/dwarf/callframe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def _parse_instructions(self, structs, offset, end_offset):
235235
struct_parse(structs.the_Dwarf_sleb128, self.stream)]
236236
elif opcode == DW_CFA_GNU_args_size:
237237
args = [struct_parse(structs.the_Dwarf_uleb128, self.stream)]
238-
238+
239239
else:
240240
dwarf_assert(False, 'Unknown CFI opcode: 0x%x' % opcode)
241241

elftools/dwarf/datatype_cpp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def DIE_is_ptr_to_member_struct(type_die):
224224

225225
def _strip_type_tag(die):
226226
"""Given a DIE with DW_TAG_foo_type, returns foo"""
227-
if isinstance(die.tag, int): # User-defined tag
227+
if isinstance(die.tag, int): # User-defined tag
228228
return ""
229229
return die.tag[7:-5]
230230

elftools/dwarf/die.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ def _resolve_indirect(self):
287287
real_form = DW_FORM_raw2name[real_form_code] # Form name or exception if bogus code
288288
except KeyError:
289289
raise DWARFError('Found DW_FORM_indirect with unknown real form 0x%x' % real_form_code)
290-
290+
291291
raw_value = struct_parse(structs.Dwarf_dw_form[real_form], self.stream)
292-
292+
293293
if real_form != 'DW_FORM_indirect': # Happy path: one level of indirection
294294
return (real_form, raw_value, length)
295295
else: # Indirection cascade
@@ -333,7 +333,7 @@ def _translate_attr_value(self, form, raw_value):
333333

334334
def _translate_indirect_attributes(self):
335335
""" This is a hook to translate the DW_FORM_...x values in the top DIE
336-
once the top DIE is parsed to the end. They can't be translated
336+
once the top DIE is parsed to the end. They can't be translated
337337
while the top DIE is being parsed, because they implicitly make a
338338
reference to the DW_AT_xxx_base attribute in the same DIE that may
339339
not have been parsed yet.

elftools/dwarf/dwarf_expr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def parse_blob():
202202
# ULEB128 with datatype DIE offset, then byte, then a blob of that size
203203
def parse_typedblob():
204204
return lambda stream: [struct_parse(structs.the_Dwarf_uleb128, stream), read_blob(stream, struct_parse(structs.the_Dwarf_uint8, stream))]
205-
205+
206206
# https://yurydelendik.github.io/webassembly-dwarf/
207207
# Byte, then variant: 0, 1, 2 => uleb128, 3 => uint32
208208
def parse_wasmloc():

elftools/dwarf/dwarf_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _iter_CUs_in_section(stream, structs, parser):
5959
else:
6060
header['offsets'] = False
6161
yield header
62-
offset = header.offset_after_length + header.unit_length
62+
offset = header.offset_after_length + header.unit_length
6363

6464
def _file_crc32(file):
6565
""" Provided a readable binary stream, reads the stream to the end

elftools/dwarf/dwarfinfo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def __init__(self,
130130
self._abbrevtable_cache = {}
131131
# Cache for program lines tables: a dict keyed by offset
132132
self._linetable_cache = {}
133-
133+
134134
# Cache of compile units and map of their offsets for bisect lookup.
135135
# Access with .iter_CUs(), .get_CU_containing(), and/or .get_CU_at().
136136
self._cu_cache = []
@@ -176,7 +176,7 @@ def get_DIE_from_refaddr(self, refaddr, cu=None):
176176
if cu is None:
177177
cu = self.get_CU_containing(refaddr)
178178
return cu.get_DIE_from_refaddr(refaddr)
179-
179+
180180
def get_DIE_by_sig8(self, sig8):
181181
""" Find and return a DIE referenced by its type signature.
182182
sig8:
@@ -201,7 +201,7 @@ def get_DIE_by_sig8(self, sig8):
201201
tu = self._type_units_by_sig.get(sig8)
202202
if tu is None:
203203
raise KeyError("Signature %016x not found in .debug_types" % sig8)
204-
return tu._get_cached_DIE(tu.tu_offset + tu['type_offset'])
204+
return tu._get_cached_DIE(tu.tu_offset + tu['type_offset'])
205205

206206
def get_CU_containing(self, refaddr):
207207
""" Find the CU that includes the given reference address in the
@@ -450,7 +450,7 @@ def get_addr(self, cu, addr_index):
450450
raise DWARFError('The file does not contain a debug_addr section for indirect address access')
451451
# Selectors are not supported, but no assert on that. TODO?
452452
cu_addr_base = _get_base_offset(cu, 'DW_AT_addr_base')
453-
return struct_parse(cu.structs.the_Dwarf_target_addr, self.debug_addr_sec.stream, cu_addr_base + addr_index*cu.header.address_size)
453+
return struct_parse(cu.structs.the_Dwarf_target_addr, self.debug_addr_sec.stream, cu_addr_base + addr_index*cu.header.address_size)
454454

455455
#------ PRIVATE ------#
456456

elftools/dwarf/enums.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
DW_TAG_template_alias = 0x43,
8484
DW_TAG_coarray_type = 0x44,
8585
DW_TAG_generic_subrange = 0x45,
86-
DW_TAG_dynamic_type = 0x46,
86+
DW_TAG_dynamic_type = 0x46,
8787
DW_TAG_atomic_type = 0x47,
8888
DW_TAG_call_site = 0x48,
8989
DW_TAG_call_site_parameter = 0x49,

elftools/dwarf/locationlists.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def get_location_list_at_offset(self, offset, die=None):
9393
location entry encodings that contain references to other sections.
9494
"""
9595
if self.version >= 5 and die is None:
96-
raise DWARFError("For this binary, \"die\" needs to be provided")
96+
raise DWARFError("For this binary, \"die\" needs to be provided")
9797
self.stream.seek(offset, os.SEEK_SET)
9898
return self._parse_location_list_from_stream_v5(die.cu) if self.version >= 5 else self._parse_location_list_from_stream()
9999

@@ -330,7 +330,7 @@ def _attribute_has_loc_list(attr, dwarf_version):
330330
not attr.name == 'DW_AT_const_value') or
331331
attr.form in ('DW_FORM_sec_offset', 'DW_FORM_loclistx')) and
332332
not LocationParser._attribute_is_constant(attr, dwarf_version))
333-
333+
334334
# Starting with DWARF3, DW_AT_data_member_location may contain an integer offset
335335
# instead of a location expression. Need to prevent false positives on attribute_has_location().
336336
# As for DW_AT_upper_bound/DW_AT_count, we've seen it in form DW_FORM_locexpr in a V5 binary. usually it's a constant,

0 commit comments

Comments
 (0)