From e6e02b0e2298fd064f6790597c82d919cf087fd9 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Tue, 8 Nov 2022 17:47:37 -0800 Subject: [PATCH] Only add files in GlobSymbolsDir. I previously skipped directories, but that can still lead to problems. So instead, only add paths that are files. Test: Ran over a stack that failed when trying to run llvm-readelf Test: on a directory. After this fix, everything get line numbers. Change-Id: Ide39c5a118d78a822057cc3977d0f532595f798b --- scripts/stack_core.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/stack_core.py b/scripts/stack_core.py index 18a343f7e..831eb7dc4 100755 --- a/scripts/stack_core.py +++ b/scripts/stack_core.py @@ -319,9 +319,8 @@ class TraceConverter: def GlobSymbolsDir(self, symbols_dir): files_by_basename = {} for path in sorted(pathlib.Path(symbols_dir).glob("**/*")): - if os.path.isdir(path): - next - files_by_basename.setdefault(path.name, []).append(path) + if os.path.isfile(path): + files_by_basename.setdefault(path.name, []).append(path) return files_by_basename # Use the "file" command line tool to find the bitness and build_id of given ELF file.