scripts: size_report: Fix reporting on Windows
Certain symbols do not contain a valid path, instead showing `<built-in>` in the filename attribute. This leads to the resolve() call failing on Windows, since the `<>` characters are not allowed in filenames there. Fix this by catching the exception and skipping the call in that case. Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
parent
e7eb428b01
commit
cf2b3596f7
1 changed files with 7 additions and 1 deletions
|
@ -221,7 +221,13 @@ def get_die_filename(die, lineprog):
|
|||
path = output.joinpath(path)
|
||||
|
||||
# Change path to relative to Zephyr base
|
||||
path = path.resolve()
|
||||
try:
|
||||
path = path.resolve()
|
||||
except OSError as e:
|
||||
if '<built-in>' in str(path):
|
||||
# This is expected, built-ins can't be resolved
|
||||
return path
|
||||
raise e
|
||||
try:
|
||||
new_path = path.relative_to(zephyrbase)
|
||||
path = new_path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue