From e842f33e63a54efc131745522e6466084c327de2 Mon Sep 17 00:00:00 2001 From: Andreas Ziegler <andreas.ziegler@fau.de> Date: Fri, 4 Feb 2022 11:17:02 +0100 Subject: [PATCH] library, store: add path to external debug file to Library and JSON output --- librarytrader/library.py | 7 +++++-- librarytrader/librarystore.py | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/librarytrader/library.py b/librarytrader/library.py index 4723316..ff66a2a 100644 --- a/librarytrader/library.py +++ b/librarytrader/library.py @@ -152,6 +152,8 @@ class Library: self.parse_time = 0 self.total_disas_time = 0 + self.external_debug_file = None + if parse: self.parse_functions() @@ -912,7 +914,7 @@ class Library: if fd > 0: external_elf = ELFFile(os.fdopen(fd, 'rb')) symtab = external_elf.get_section_by_name('.symtab') - external_path = path + external_path = path.decode('utf-8') except (ELFError, OSError, FileNotFoundError) as e: logging.debug('debuginfod query failed: %s', e) @@ -920,7 +922,8 @@ class Library: return False elif external_path: logging.debug('Found external symtab for %s at %s', self.fullname, - external_path) + os.path.abspath(external_path)) + self.external_debug_file = os.path.abspath(external_path) sorted_ranges = sorted(self.ranges.items()) for _, symbol in self._get_function_symbols(symtab, prefix_local=True): diff --git a/librarytrader/librarystore.py b/librarytrader/librarystore.py index 95bb249..f02805d 100644 --- a/librarytrader/librarystore.py +++ b/librarytrader/librarystore.py @@ -795,6 +795,7 @@ class LibraryStore(BaseStore): lib_dict["version_descriptions"] = content.version_descriptions lib_dict["parse_time"] = content.parse_time lib_dict["total_disas_time"] = content.total_disas_time + lib_dict["external_debug_file"] = content.external_debug_file output[path] = lib_dict @@ -872,6 +873,7 @@ class LibraryStore(BaseStore): library.version_descriptions = content.get("version_descriptions", {}) library.parse_time = float(content.get("parse_time", 0)) library.total_disas_time = float(content.get("total_disas_time", 0)) + library.external_debug_file = content.get("external_debug_file", None) self._add_library(path, library) logging.debug('... done with %s entries', len(self)) -- GitLab