From e7dad6b7e067d0cbffc3d7c238885448aa0e87bc Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Mon, 13 Jun 2022 05:49:02 -0700 Subject: [PATCH] Whitespace cleanups --- elftools/dwarf/descriptions.py | 2 +- elftools/dwarf/dwarfinfo.py | 4 ++-- elftools/dwarf/structs.py | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/elftools/dwarf/descriptions.py b/elftools/dwarf/descriptions.py index f51f69b..059c22c 100644 --- a/elftools/dwarf/descriptions.py +++ b/elftools/dwarf/descriptions.py @@ -208,7 +208,7 @@ def _describe_attr_strp(attr, die, section_offset): def _describe_attr_line_strp(attr, die, section_offset): return '(indirect line string, offset: 0x%x): %s' % ( - attr.raw_value, bytes2str(attr.value)) + attr.raw_value, bytes2str(attr.value)) def _describe_attr_string(attr, die, section_offset): return bytes2str(attr.value) diff --git a/elftools/dwarf/dwarfinfo.py b/elftools/dwarf/dwarfinfo.py index 69d7b91..9642cc8 100644 --- a/elftools/dwarf/dwarfinfo.py +++ b/elftools/dwarf/dwarfinfo.py @@ -243,7 +243,7 @@ class DWARFInfo(object): """ Given a CU object, fetch the line program it points to from the .debug_line section. If the CU doesn't point to a line program, return None. - + Note about directory and file names. They are returned as two collections in the lineprogram object's header - include_directory and file_entry. @@ -491,7 +491,7 @@ class DWARFInfo(object): lineprog_header.file_entry = tuple( translate(e.get('DW_LNCT_path'), e.get('DW_LNCT_directory_index'), e.get('DW_LNCT_timestamp'), e.get('DW_LNCT_size')) for e in lineprog_header.file_names) - + # Calculate the offset to the next line program (see DWARF 6.2.4) end_offset = ( debug_line_offset + lineprog_header['unit_length'] + structs.initial_length_field_size()) diff --git a/elftools/dwarf/structs.py b/elftools/dwarf/structs.py index 46cd817..fb9b0b7 100644 --- a/elftools/dwarf/structs.py +++ b/elftools/dwarf/structs.py @@ -305,9 +305,9 @@ class DWARFStructs(object): parser = Struct('formatted_entry', *fields) context[self.format_field + "_parser"] = parser return parser._parse(stream, context) - + ver5 = lambda ctx: ctx.version >= 5 - + self.Dwarf_lineprog_header = Struct('Dwarf_lineprog_header', self.Dwarf_initial_length('unit_length'), self.Dwarf_uint16('version'), @@ -353,10 +353,10 @@ class DWARFStructs(object): RepeatUntilExcluding( lambda obj, ctx: obj == b'', CString('include_directory'))), - If(lambda ctx: ctx.version < 5, + If(lambda ctx: ctx.version < 5, RepeatUntilExcluding( lambda obj, ctx: len(obj.name) == 0, - self.Dwarf_lineprog_file_entry)) # array name is file_entry + self.Dwarf_lineprog_file_entry)) # array name is file_entry ) def _create_callframe_entry_headers(self): -- 2.30.2