Skip to content

Commit

Permalink
scripts/symbolize.py: accept -d <ELF_file> in addition to -d <dir>
Browse files Browse the repository at this point in the history
The -d option of symbolize.py normally expects one or more directories,
where the script will look for ELF files (TEE or TA, depending on the
input dump). For convenience, let's also accept paths to the actual ELF
files. Previously, the script would just ignore file arguments and
silently fail to resolve stack traces.

Reported-by: Lijianhui <[email protected]>
Signed-off-by: Jerome Forissier <[email protected]>
Reviewed-by: Igor Opaniuk <[email protected]>
  • Loading branch information
jforissier committed Sep 5, 2017
1 parent 417567c commit 157e621
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/symbolize.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import argparse
import glob
import os
import re
import subprocess
import sys
Expand Down Expand Up @@ -76,7 +77,8 @@ def get_args():
parser.add_argument('-d', '--dir', action='append', nargs='+',
help='Search for ELF file in DIR. tee.elf is needed to decode '
'a TEE Core or pseudo-TA abort, while <TA_uuid>.elf is required '
'if a user-mode TA has crashed.')
'if a user-mode TA has crashed. For convenience, ELF files '
'may also be given.')
parser.add_argument('-s', '--strip_path',
help='Strip STRIP_PATH from file paths')

Expand All @@ -95,6 +97,8 @@ def get_elf(self, elf_or_uuid):
if not elf_or_uuid.endswith('.elf'):
elf_or_uuid += '.elf'
for d in self._dirs:
if d.endswith(elf_or_uuid) and os.path.isfile(d):
return d
elf = glob.glob(d + '/' + elf_or_uuid)
if elf:
return elf[0]
Expand Down

0 comments on commit 157e621

Please sign in to comment.