Commit 5b12e62b authored by Jakob Kummerow's avatar Jakob Kummerow Committed by V8 LUCI CQ

[tools] grokdump: Fix objdump detection for Python3

Follow-up to 032dfb82.

No-Try: true
Change-Id: Ia12343a7ce9e1b865da4fbf562bdd9169892932c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3721816
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81332}
parent da12b9ac
...@@ -724,29 +724,25 @@ class MinidumpReader(object): ...@@ -724,29 +724,25 @@ class MinidumpReader(object):
disasm.OBJDUMP_BIN = objdump_bin disasm.OBJDUMP_BIN = objdump_bin
def _FindThirdPartyObjdump(self): def _FindThirdPartyObjdump(self):
# Try to find the platform specific objdump # Try to find the platform specific objdump.
third_party_dir = os.path.join(
os.path.dirname(os.path.dirname(__file__)), 'third_party')
objdumps = []
for root, dirs, files in os.walk(third_party_dir):
for file in files:
if file.endswith("objdump"):
objdumps.append(os.path.join(root, file))
if self.arch == MD_CPU_ARCHITECTURE_ARM: if self.arch == MD_CPU_ARCHITECTURE_ARM:
platform_filter = 'arm-linux' platform_filter = 'arm-linux'
elif self.arch == MD_CPU_ARCHITECTURE_ARM64: elif self.arch == MD_CPU_ARCHITECTURE_ARM64:
platform_filter = 'aarch64' platform_filter = 'aarch64'
else: else:
# use default otherwise # Use default otherwise.
return None return None
print(("# Looking for platform specific (%s) objdump in " print(("# Looking for platform specific (%s) objdump in "
"third_party directory.") % platform_filter) "third_party directory.") % platform_filter)
objdumps = list(filter(lambda file: platform_filter in file >= 0, objdumps)) third_party_dir = os.path.join(
if len(objdumps) == 0: os.path.dirname(os.path.dirname(__file__)), 'third_party')
for root, dirs, files in os.walk(third_party_dir):
for file in files:
if file.endswith("objdump") and platform_filter in file:
return os.path.join(root, file)
print("# Could not find platform specific objdump in third_party.") print("# Could not find platform specific objdump in third_party.")
print("# Make sure you installed the correct SDK.") print("# Make sure you installed the correct SDK.")
return None return None
return objdumps[0]
def ContextDescriptor(self): def ContextDescriptor(self):
if self.arch == MD_CPU_ARCHITECTURE_X86: if self.arch == MD_CPU_ARCHITECTURE_X86:
......
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