Commit 1d768300 authored by Christopher Grant's avatar Christopher Grant Committed by Commit Bot

stack.py: Fix script execution in fallback .so code path

The last change to this script had issues in cases where an APK can't be
found or isn't specified.

TBR'ing Andrew to get this in quickly, as it's trivial fixes but
potentially disruptive to bots.

TBR=agrieve@chromium.org

Bug: 1015159
Change-Id: Iddd45829abdd11478cd3c9aacb4176ea72e49258
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1914826Reviewed-by: default avatarChristopher Grant <cjgrant@chromium.org>
Commit-Queue: Christopher Grant <cjgrant@chromium.org>
Auto-Submit: Christopher Grant <cjgrant@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715130}
parent f011f43c
...@@ -325,7 +325,7 @@ class PreProcessLog: ...@@ -325,7 +325,7 @@ class PreProcessLog:
soname = self._DetectSharedLibrary(lib, symbol_present) soname = self._DetectSharedLibrary(lib, symbol_present)
if soname: if soname:
line = line.replace('/' + os.path.basename(lib), '/' + soname) line = line.replace('/' + os.path.basename(lib), '/' + soname)
elif not apks_directory: elif not self._apks_directory:
# If the trace line suggests a direct load from APK, replace the # If the trace line suggests a direct load from APK, replace the
# APK name with _FALLBACK_SO, unless an APKs directory was # APK name with _FALLBACK_SO, unless an APKs directory was
# explicitly specified (in which case, the correct .so should always # explicitly specified (in which case, the correct .so should always
...@@ -562,7 +562,7 @@ def _FindSharedLibraryFromAPKs(output_directory, apks_directory, offset): ...@@ -562,7 +562,7 @@ def _FindSharedLibraryFromAPKs(output_directory, apks_directory, offset):
raise Exception('Explicit APKs directory does not exist: %s', raise Exception('Explicit APKs directory does not exist: %s',
repr(apks_directory)) repr(apks_directory))
else: else:
apks_directory = os.path.join(out_dir, 'apks') apks_directory = os.path.join(output_directory, 'apks')
if not os.path.isdir(apks_directory): if not os.path.isdir(apks_directory):
return (None, None) return (None, None)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment