Export uppercased driver name in sizedata report on Windows

This commit is contained in:
valeros
2019-11-06 12:34:43 +02:00
parent 2cce47a13d
commit 17ff3250c9

View File

@ -18,13 +18,14 @@ from __future__ import absolute_import
import sys import sys
from os import environ, makedirs, remove from os import environ, makedirs, remove
from os.path import isdir, join from os.path import isdir, join, splitdrive
from elftools.elf.descriptions import describe_sh_flags from elftools.elf.descriptions import describe_sh_flags
from elftools.elf.elffile import ELFFile from elftools.elf.elffile import ELFFile
from platformio.compat import dump_json_to_unicode from platformio.compat import dump_json_to_unicode
from platformio.proc import exec_command from platformio.proc import exec_command
from platformio.util import get_systype
def _run_tool(cmd, env, tool_args): def _run_tool(cmd, env, tool_args):
@ -54,7 +55,7 @@ def _get_symbol_locations(env, elf_path, addrs):
locations = [line for line in result["out"].split("\n") if line] locations = [line for line in result["out"].split("\n") if line]
assert len(addrs) == len(locations) assert len(addrs) == len(locations)
return dict(zip(addrs, [l.strip().replace("\\", "/") for l in locations])) return dict(zip(addrs, [l.strip() for l in locations]))
def _get_demangled_names(env, mangled_names): def _get_demangled_names(env, mangled_names):
@ -163,6 +164,9 @@ def _collect_symbols_info(env, elffile, elf_path, sections):
location = symbol_locations.get(hex(symbol["addr"])) location = symbol_locations.get(hex(symbol["addr"]))
if not location or "?" in location: if not location or "?" in location:
continue continue
if "windows" in get_systype():
drive, tail = splitdrive(location)
location = join(drive.upper(), tail)
symbol["file"] = location symbol["file"] = location
symbol["line"] = 0 symbol["line"] = 0
if ":" in location: if ":" in location: