X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FCommon%2FMisc.py;h=2a5125d72da8c08f943bb0ac4fbdc113f49ba043;hp=dbb711e96cefa02ea50d4f981c3d46beda31d0d1;hb=14239ee0770fdbb1d69f1e3f5f70b8df30de1895;hpb=631ffb70ebbe78b6e3f342b7ad9ab9b75f8796ae diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py index dbb711e96c..2a5125d72d 100644 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -67,8 +67,26 @@ def GetVariableOffset(mapfilepath, efifilepath, varnames): if (firstline.startswith("Archive member included ") and firstline.endswith(" file (symbol)")): return _parseForGCC(lines, efifilepath, varnames) + if firstline.startswith("# Path:"): + return _parseForXcode(lines, efifilepath, varnames) return _parseGeneral(lines, efifilepath, varnames) +def _parseForXcode(lines, efifilepath, varnames): + status = 0 + ret = [] + for index, line in enumerate(lines): + line = line.strip() + if status == 0 and line == "# Symbols:": + status = 1 + continue + if status == 1 and len(line) != 0: + for varname in varnames: + if varname in line: + m = re.match('^([\da-fA-FxX]+)([\s\S]*)([_]*%s)$' % varname, line) + if m != None: + ret.append((varname, m.group(1))) + return ret + def _parseForGCC(lines, efifilepath, varnames): """ Parse map file generated by GCC linker """ status = 0