size_report: Don't assume all paths start with ZEPHYR_BASE
Instead of crashing when a source file outside of ZEPHYR_BASE is detected we accept it as-is to include it in the report. This fixes #5866 Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
parent
b23d599682
commit
d5216a5299
1 changed files with 7 additions and 1 deletions
|
@ -35,7 +35,13 @@ def load_symbols_and_paths(bin_nm, elf_file, path_to_strip=""):
|
||||||
symbol, path = parse_symbol_path_pair(line)
|
symbol, path = parse_symbol_path_pair(line)
|
||||||
|
|
||||||
if path:
|
if path:
|
||||||
processed_path = Path(path).relative_to(Path(path_to_strip))
|
p_path = Path(path)
|
||||||
|
p_path_to_strip = Path(path_to_strip)
|
||||||
|
try:
|
||||||
|
processed_path = p_path.relative_to(p_path_to_strip)
|
||||||
|
except ValueError as e:
|
||||||
|
# path is valid, but is not prefixed by path_to_strip
|
||||||
|
processed_path = p_path
|
||||||
else:
|
else:
|
||||||
processed_path = Path(":")
|
processed_path = Path(":")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue