Skip to content
Commits on Source (4)
diffoscope (121) UNRELEASED; urgency=medium
* WIP\n\nGbp-Dch: ignore
* WIP
-- Chris Lamb <lamby@debian.org> Mon, 29 Jul 2019 17:20:27 -0300
......
......@@ -147,23 +147,16 @@ class RedaelfVersionInfo(Readelf):
class ReadelfDebugDump(Readelf):
def __new__(cls, *args, **kwargs):
# Find the section group from the class name
debug_section_group = cls.__name__[len('ReadelfDebugDump_') :]
if debug_section_group:
return ReadelfDebugDump(debug_section_group, *args, **kwargs)
return super(Readelf, cls).__new__(cls)
def __init__(self, debug_section_group, *args, **kwargs):
self._debug_section_group = debug_section_group
super().__init__(*args, **kwargs)
def readelf_options(self):
return ['--debug-dump=%s' % self._debug_section_group]
READELF_DEBUG_DUMP_COMMANDS = [
type('ReadelfDebugDump_{}'.format(x), (ReadelfDebugDump,), {})
type(
'ReadelfDebugDump_{}'.format(x),
(ReadelfDebugDump,),
{'_debug_section_group': x},
)
for x in DEBUG_SECTION_GROUPS
]
......@@ -350,8 +343,8 @@ class ElfCodeSection(ElfSection):
other.path,
command_args=[self._name],
)
# eg. When failing to disassemble a different architecture.
except subprocess.CalledProcessError as e:
# eg. When failing to disassemble a different architecture.
logger.error(e)
if diff and not excluded:
......
......@@ -330,7 +330,7 @@ class File(object, metaclass=abc.ABCMeta):
@classmethod
def _mangle_file_type(self, val):
# Strip off trailing "original size modulo 2^32 671" from
# Strip off trailing (eg.) "original size modulo 2^32 671" from
# gzip compressed data as this is just a symptom of the contents itself
# changing that will be reflected elsewhere.
if val.startswith("gzip compressed data"):
......