From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by mx.groups.io with SMTP id smtpd.web11.4144.1610642195739078564 for ; Thu, 14 Jan 2021 08:36:35 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=cLlFc93Y; spf=pass (domain: nuviainc.com, ip: 209.85.166.41, mailfrom: rebecca@nuviainc.com) Received: by mail-io1-f41.google.com with SMTP id y19so12416903iov.2 for ; Thu, 14 Jan 2021 08:36:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4Olv7sjxL4P5hG6E5inqSx4bXaX39+7YW2qWqB3yFNw=; b=cLlFc93YjDWwfva1AFUvuZ6/iqoxpMz46sF4qjxESVnKr8mMERsQqbDKV8OUqip46s SfCyM+W4P/t4dyZAohISFrHKKhnSMpVM9D2kc8w8+C160gk7eNvR7jZrbUcUJKwxaCJR JjpgcrpjLZl6ojPT6U5MMmTkru8eAouoIY0Rn+gRwUt9qX0nf7z+SKNXrKbTjsx7v99B d0B3d5yoWVm0xdkibtdkDeSrFTQwFBjVdJ3/Natb98G1sh2Ov5W+kMnyzN3/KomsRVEs uMdBfemQm+etvkT1Pa4kO0QObuP9u0Nnp3GIvgRaPwWVXuBUvowosHw8kCG4DuI4R9H/ QK7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4Olv7sjxL4P5hG6E5inqSx4bXaX39+7YW2qWqB3yFNw=; b=o4LqWCzneJ8L1isJ9eMJGzGEZ4WgwfbS1OztW4JkkRa2/HdcJG7UumNhXnQsyu5f6/ DPRHdA8+ktqEYriB10885u+FLN6QwOQBwGcRXfMepQ3dVckV2PxDc4m7/DAOd67KVkEk qXVFUhYb4KCJ1evYxhMblb5O3C3IgwVqvgdwy83qTN2jxRonpjwpQLhb2nXA2SmYCFIs 9mbQJmJwuN8Kz/GkXkutRt12ekag2J2TTQ9QhEylAkUe33FWQDnML1Yy/SCdkhQv7QO1 iN+5ivW6KDfiVfBSbdqbPT0Ab5hpVrZQaEXEkEme8D5W3bnUWwPq+10KT1lgkjTEwY23 PqpQ== X-Gm-Message-State: AOAM5322NTHSC9PnestBaeQMGsiehxlOhrz6Ldu4rX8S564inD4gVs4a TgU2GRsnnHrfpNu5QWFm7fuAYNhBmjlfAbpwlZGvLci2XBM8AhBicrlhp+mdFZWnGlwWzv1IBgR ekDRsPFrngPirK/k92YlVJKfwjC+JQsZwk+o1UQ7wrejeXE6V5m1mIuyRitcW4KSJFJqsaDSa X-Google-Smtp-Source: ABdhPJwRVOmTwDOX0Mxan+5x4eaoGrZKFDmGRmZS+3s/mVJ//HEHT/oANixLtcjCEgLRPkPZUPH1tw== X-Received: by 2002:a5e:d717:: with SMTP id v23mr5833146iom.60.1610642194934; Thu, 14 Jan 2021 08:36:34 -0800 (PST) Return-Path: Received: from cube.nuviainc.com (c-174-52-16-57.hsd1.ut.comcast.net. [174.52.16.57]) by smtp.gmail.com with ESMTPSA id y5sm3711920ilj.35.2021.01.14.08.36.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jan 2021 08:36:34 -0800 (PST) From: "Rebecca Cran" To: devel@edk2.groups.io Cc: Bob Feng , Leif Lindholm , Ard Biesheuvel , nd@arm.com, Sami Mujawar , Liming Gao , Michael D Kinney , Zhiguang Liu , Yuwei Chen Subject: [PATCH v6 01/22] BaseTools: Fix the build report crash issue Date: Thu, 14 Jan 2021 09:36:07 -0700 Message-Id: <20210114163628.31952-2-rebecca@nuviainc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210114163628.31952-1-rebecca@nuviainc.com> References: <20210114163628.31952-1-rebecca@nuviainc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Bob Feng In the following corner case, the build report will crash. This patch is to fix this problem. Case: Multiple SKU are used and 2 more DynamicHii structure Pcds are set in dsc file under different SKU. And 1 more of those Pcds are not used in any INF file. Signed-off-by: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Reviewed-by: Liming Gao Reviewed-by: Yuwei Chen --- BaseTools/Source/Python/build/BuildReport.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py index 3b1add9999d2..468772930ca1 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -1125,10 +1125,11 @@ class PcdReport(object): if SkuInfo.DefaultStoreDict: DefaultStoreList = sorted(SkuInfo.DefaultStoreDict.keys()) for DefaultStore in DefaultStoreList: - OverrideValues = Pcd.SkuOverrideValues[Sku] - DscOverride = self.ParseStruct(OverrideValues[DefaultStore]) - if DscOverride: - break + OverrideValues = Pcd.SkuOverrideValues.get(Sku) + if OverrideValues: + DscOverride = self.ParseStruct(OverrideValues[DefaultStore]) + if DscOverride: + break if DscOverride: break if DscOverride: @@ -1388,9 +1389,10 @@ class PcdReport(object): FileWrite(File, ' %-*s : %6s %10s %10s %10s = %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', '(' + DefaultStore + ')', Value)) FileWrite(File, '%*s: %s: %s' % (self.MaxLen + 4, SkuInfo.VariableGuid, SkuInfo.VariableName, SkuInfo.VariableOffset)) if IsStructure: - OverrideValues = Pcd.SkuOverrideValues[Sku] - OverrideFieldStruct = self.OverrideFieldValue(Pcd, OverrideValues[DefaultStore]) - self.PrintStructureInfo(File, OverrideFieldStruct) + OverrideValues = Pcd.SkuOverrideValues.get(Sku) + if OverrideValues: + OverrideFieldStruct = self.OverrideFieldValue(Pcd, OverrideValues[DefaultStore]) + self.PrintStructureInfo(File, OverrideFieldStruct) self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch, DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue) else: Value = SkuInfo.DefaultValue -- 2.26.2