From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.10349.1593396243896388773 for ; Sun, 28 Jun 2020 19:04:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=XWjIzql6; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: eric.dong@intel.com) IronPort-SDR: OClaKjzW2C+cE9PBqxbdU0VnTn5Sj+BClIvAbDrSFQT7VIOpWkdAS3TbONPqcLc8dm65aZ9kJ+ M9K1RykR2+Bg== X-IronPort-AV: E=McAfee;i="6000,8403,9666"; a="230704715" X-IronPort-AV: E=Sophos;i="5.75,293,1589266800"; d="scan'208";a="230704715" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2020 19:03:58 -0700 IronPort-SDR: wRT4tYkh8mkcWz+cOCLd55CFJaAwkqwV5aDP7cT7cvuf6Q+1kM/eZZBI4XxqLjcBXfqUFnl2Ms vmtVTJMZ4avQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,293,1589266800"; d="scan'208";a="480621997" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by fmsmga005.fm.intel.com with ESMTP; 28 Jun 2020 19:03:57 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 28 Jun 2020 19:03:57 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 28 Jun 2020 19:03:56 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Sun, 28 Jun 2020 19:03:56 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.101) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 28 Jun 2020 19:03:56 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C3smrIiUw477y6CKs/22vNrLqR7LMtyBjMyRqs2sZkGBV3qu2P4znFQ87bvp3yGr48ZA5jcADzrGJV9Ye2N5ZXTlReSY2VM4x+dLDRoZrTGi0FJsoRUR9GkKg6cGht44FFbFaIe/rfNdiql6imXlmMtG7exMc35jkdtycGT+8dmPR2Q6JLoI9puYcOdWkRF1dxXRovbu3x1cVLK2ouUUz/CC21jZkK42g1uFEUGU8zogoLhVKdlIG7vNJfXh7ksB8ttoTTeiSZh982GbLH7MDbFYofvAfpSLwNxByJ4tyQiV4NfuZtMye4aTsen+HR9gK5bNQGWpZvN5i72PKpcX4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m0LBo2ccGxNqjL425O56Go8HQi40NvS6O1mNNUCo5Pg=; b=FthJu/APNgHc0kV5jbjBEB+Qy74wkPFysgmLl8IURht4E++lkV6tbBN5lom1ZSmE1HARH6JdoIxNHALXzTDyevI9ZlcBr2DvgAH8gLb/kqcb0FIs0m4zbgwjx5NtcEZIMXLIj/Xyg3utbqAXO6Y3gz+IQyPIuNHUu5sKf26uvnJXjvwXEyBwehDvpFBraEaHIat2PKy8kx1b800uh/ottOl/pL1NjyRp914yHnPhNb8iy7PnenX5eJ8LwHnhC8anWVZ39mK1ttvhkoRyPUQQyMbZWGwPeSC18WM71tUGGjkTII76k/DDG7p6k0wMNu9Ke5fNyEWUdhgV1An8+AVROQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m0LBo2ccGxNqjL425O56Go8HQi40NvS6O1mNNUCo5Pg=; b=XWjIzql6oYIRiEqn4v6yL2ECgiU4BVc6FJXtGt86ly7P0dYIkXrTsc2+2vOSTUCHSX9lmX+VS7NsBp1ZJg2h4F593cAY4W0b/dtZKIg7yRA1rMEsrHkJ4yxASiZBqonx01XZPme7/eZA765QMiz/EYrVn4DU366fPTHfnX+27WQ= Received: from DM6PR11MB3274.namprd11.prod.outlook.com (2603:10b6:5:b::26) by DM6PR11MB3132.namprd11.prod.outlook.com (2603:10b6:5:69::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.21; Mon, 29 Jun 2020 02:03:55 +0000 Received: from DM6PR11MB3274.namprd11.prod.outlook.com ([fe80::cc01:6f05:1402:e7d7]) by DM6PR11MB3274.namprd11.prod.outlook.com ([fe80::cc01:6f05:1402:e7d7%6]) with mapi id 15.20.3131.026; Mon, 29 Jun 2020 02:03:55 +0000 From: "Dong, Eric" To: "Bi, Dandan" , "devel@edk2.groups.io" CC: "Gao, Liming" , Laszlo Ersek Subject: Re: [patch V2] MdeModulePkg/DisplayEngine: Add Debug message to show mismatch menu info Thread-Topic: [patch V2] MdeModulePkg/DisplayEngine: Add Debug message to show mismatch menu info Thread-Index: AQHWTPI1hYqB3r/sgUSyS3cW2898aaju2Lvg Date: Mon, 29 Jun 2020 02:03:55 +0000 Message-ID: References: <20200628021639.13828-1-dandan.bi@intel.com> In-Reply-To: <20200628021639.13828-1-dandan.bi@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.210] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e9cd5990-d875-487e-b68b-08d81bd0ad95 x-ms-traffictypediagnostic: DM6PR11MB3132: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:221; x-forefront-prvs: 044968D9E1 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0xZRg4iH9yYT6pHExX6PmrC8yrevUcqUz6yit5JoNgSJ2m30gJ4vwL8yXRQ9k+VQBWXldrCg+ftHshjgj/pRGkWtoEeMjUeBrrXl9vad6BTRdXL7mOBNEdKR5gjMoVoJE+oCNNOfenIoe7+xqQl5UaESQ5lWZd2awJj8SQFdZgnNAOtVk2InxWTBdG+nTo38CcY6Sj+YY0hYZqIi9yNSP+Q4hm+rhTrP7kXzoDYfWRdP/Yhnm4sGf4Kxcao9hddWYTIguERPjO4/7wIGXRb8ol1s9rBzSX1x8vWBDuTaEjRD7JDGgRYW8cbCMkwxXZViObLkH31PjoPfWK0DMCJQRxAHzMk+viXI9As1TLozghgxiQjcjrE63XlOh6314oa4CzQY6F6pt7bfGyYoweG6DQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB3274.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(136003)(376002)(346002)(366004)(39860400002)(64756008)(33656002)(15650500001)(86362001)(52536014)(19627235002)(966005)(478600001)(66446008)(5660300002)(2906002)(66476007)(66946007)(8676002)(4326008)(71200400001)(76116006)(53546011)(8936002)(7696005)(55016002)(9686003)(26005)(83380400001)(186003)(54906003)(110136005)(6506007)(316002)(66556008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: pSc+zFkslUMPDJGmXuv5vWWa2/JYsHIKUQrLO/QPqlykcdgfMVOJQQAV2ZCE4EF8LuP4L4M/0hawasFgUC+AWgnFtse7QDKfx7X7EAfH/xS/tMB/3cedvWg1rUUMLqBQ8kv0bRJsXRHbDXsdpdWgQlDO3QNgLGcieUsEC+WArbqBTU0M0F6r47TksPe8nImM3JdI8Kq7nVBX94ObY+n7aLuFhsRQ/nLicEBPa7fyLtlRorswHCfGLDOSEsamuJ3qlvPj6L0RSXVHw4mYseI8t+o1HGWCO780/abfiY3JRxLoSao9hTS+SofQZCA+Jrf1ef/I/9URGQ34SbW3hXcCDTIFv7ausXB71Ftxo9i8mnBsScNWunyx1BPs3M17rzokmyrYyZ24YZlUmiXcB8ghKA+8iRm533wL2Tm/qpXNgb6neUh+1DOL5QEXYXPj0w6Gm2LDyIk40Ysv7ruqQ+fUBvT6FOnqXNyy1cajQxaki6Jl+fDEcuiQEPkFtRmLIapX MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3274.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e9cd5990-d875-487e-b68b-08d81bd0ad95 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jun 2020 02:03:55.0633 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Wdaf9+PtcXsYLJ8AgnVQWUuR4vgegk2BEqqToAGLhlz+nqdT0SLQp+uq5BBCXjODZ2/FcvsQ8PyKl5G0lKFErw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3132 Return-Path: eric.dong@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Eric Dong > -----Original Message----- > From: Bi, Dandan > Sent: Sunday, June 28, 2020 10:17 AM > To: devel@edk2.groups.io > Cc: Gao, Liming ; Dong, Eric ; > Laszlo Ersek > Subject: [patch V2] MdeModulePkg/DisplayEngine: Add Debug message to > show mismatch menu info >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2326 >=20 > Currently when meet mismatch case for one-of and ordered-list menu, just > show a popup window to indicate mismatch, no more info for debugging. > This patch is to add more debug message about mismatch menu info which is > helpful to debug. >=20 > Cc: Liming Gao > Cc: Eric Dong > Cc: Laszlo Ersek > Signed-off-by: Dandan Bi > --- > v2: > 1) Refine debug message info. > 2) Use gEfiCallerBaseName.to replace hard code "DisplayEngine" > 3) Handle question and option value based on value type. >=20 > .../DisplayEngineDxe/ProcessOptions.c | 125 ++++++++++++++++++ > 1 file changed, 125 insertions(+) >=20 > diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c > b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c > index e7306f6d04..c02e36a63a 100644 > --- a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c > +++ b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c > @@ -911,10 +911,120 @@ PasswordProcess ( > FreePool (StringPtr); >=20 > return Status; > } >=20 > +/** > + Print some debug message about mismatched menu info. > + > + @param MenuOption The MenuOption for this Question. > + > +**/ > +VOID > +PrintMismatchMenuInfo ( > + IN UI_MENU_OPTION *MenuOption > +) > +{ > + CHAR16 *FormTitleStr; > + CHAR16 *FormSetTitleStr; > + CHAR16 *OneOfOptionStr; > + CHAR16 *QuestionName; > + LIST_ENTRY *Link; > + FORM_DISPLAY_ENGINE_STATEMENT *Question; > + EFI_IFR_ORDERED_LIST *OrderList; > + UINT8 Index; > + EFI_HII_VALUE HiiValue; > + EFI_HII_VALUE *QuestionValue; > + DISPLAY_QUESTION_OPTION *Option; > + UINT8 *ValueArray; > + UINT8 ValueType; > + EFI_IFR_FORM_SET *FormsetBuffer; > + UINTN FormsetBufferSize; > + > + Question =3D MenuOption->ThisTag; > + HiiGetFormSetFromHiiHandle (gFormData->HiiHandle, &FormsetBuffer, > + &FormsetBufferSize); > + > + FormSetTitleStr =3D GetToken (FormsetBuffer->FormSetTitle, > + gFormData->HiiHandle); FormTitleStr =3D GetToken (gFormData->FormTitle= , > + gFormData->HiiHandle); > + > + DEBUG ((DEBUG_ERROR, "\n[%a]: Mismatch Formset : Formset Guid > =3D %g, FormSet title =3D %s\n", gEfiCallerBaseName, &gFormData- > >FormSetGuid, FormSetTitleStr)); > + DEBUG ((DEBUG_ERROR, "[%a]: Mismatch Form : FormId =3D %d, Form > title =3D %s.\n", gEfiCallerBaseName, gFormData->FormId, FormTitleStr)); > + > + if (Question->OpCode->OpCode =3D=3D EFI_IFR_ORDERED_LIST_OP) { > + QuestionName =3D GetToken (((EFI_IFR_ORDERED_LIST*)MenuOption- > >ThisTag->OpCode)->Question.Header.Prompt, gFormData->HiiHandle); > + Link =3D GetFirstNode (&Question->OptionListHead); > + Option =3D DISPLAY_QUESTION_OPTION_FROM_LINK (Link); > + ValueType =3D Option->OptionOpCode->Type; > + DEBUG ((DEBUG_ERROR, "[%a]: Mismatch Error : OrderedList value = in > the array doesn't match with option value.\n", gEfiCallerBaseName)); > + DEBUG ((DEBUG_ERROR, "[%a]: Mismatch OrderedList: Name =3D %s.\n", > gEfiCallerBaseName, QuestionName)); > + DEBUG ((DEBUG_ERROR, "[%a]: Mismatch OrderedList: OrderedList array > + value :\n", gEfiCallerBaseName)); > + > + OrderList =3D (EFI_IFR_ORDERED_LIST *) Question->OpCode; > + for (Index =3D 0; Index < OrderList->MaxContainers; Index++) { > + ValueArray =3D Question->CurrentValue.Buffer; > + HiiValue.Value.u64 =3D GetArrayData (ValueArray, ValueType, Index)= ; > + DEBUG ((DEBUG_ERROR, " Value= [%d] =3D%ld.\n", Index, > HiiValue.Value.u64)); > + } > + } else if (Question->OpCode->OpCode =3D=3D EFI_IFR_ONE_OF_OP) { > + QuestionName =3D GetToken (((EFI_IFR_ONE_OF*)MenuOption->ThisTag- > >OpCode)->Question.Header.Prompt, gFormData->HiiHandle); > + QuestionValue =3D &Question->CurrentValue; > + DEBUG ((DEBUG_ERROR, "[%a]: Mismatch Error : OneOf value doesn'= t > match with option value.\n", gEfiCallerBaseName)); > + DEBUG ((DEBUG_ERROR, "[%a]: Mismatch OneOf : Name =3D %s.\n", > gEfiCallerBaseName, QuestionName)); > + switch (QuestionValue->Type) { > + case EFI_IFR_TYPE_NUM_SIZE_64: > + DEBUG ((DEBUG_ERROR, "[%a]: Mismatch OneOf : OneOf value > =3D %ld.\n",gEfiCallerBaseName, QuestionValue->Value.u64)); > + break; > + > + case EFI_IFR_TYPE_NUM_SIZE_32: > + DEBUG ((DEBUG_ERROR, "[%a]: Mismatch OneOf : OneOf value > =3D %d.\n",gEfiCallerBaseName, QuestionValue->Value.u32)); > + break; > + > + case EFI_IFR_TYPE_NUM_SIZE_16: > + DEBUG ((DEBUG_ERROR, "[%a]: Mismatch OneOf : OneOf value > =3D %d.\n",gEfiCallerBaseName, QuestionValue->Value.u16)); > + break; > + > + case EFI_IFR_TYPE_NUM_SIZE_8: > + DEBUG ((DEBUG_ERROR, "[%a]: Mismatch OneOf : OneOf value > =3D %d.\n",gEfiCallerBaseName, QuestionValue->Value.u8)); > + break; > + > + default: > + ASSERT (FALSE); > + break; > + } > + } > + > + Index =3D 0; > + Link =3D GetFirstNode (&Question->OptionListHead); while (!IsNull > + (&Question->OptionListHead, Link)) { > + Option =3D DISPLAY_QUESTION_OPTION_FROM_LINK (Link); > + OneOfOptionStr =3D GetToken (Option->OptionOpCode->Option, > gFormData->HiiHandle); > + switch (Option->OptionOpCode->Type) { > + case EFI_IFR_TYPE_NUM_SIZE_64: > + DEBUG ((DEBUG_ERROR, "[%a]: Option %d : Option Value = =3D %ld, > Option Name =3D %s.\n",gEfiCallerBaseName, Index, Option->OptionOpCode- > >Value.u64, OneOfOptionStr)); > + break; > + > + case EFI_IFR_TYPE_NUM_SIZE_32: > + DEBUG ((DEBUG_ERROR, "[%a]: Option %d : Option Value = =3D %d, > Option Name =3D %s.\n",gEfiCallerBaseName, Index, Option->OptionOpCode- > >Value.u32, OneOfOptionStr)); > + break; > + > + case EFI_IFR_TYPE_NUM_SIZE_16: > + DEBUG ((DEBUG_ERROR, "[%a]: Option %d : Option Value = =3D %d, > Option Name =3D %s.\n",gEfiCallerBaseName, Index, Option->OptionOpCode- > >Value.u16, OneOfOptionStr)); > + break; > + > + case EFI_IFR_TYPE_NUM_SIZE_8: > + DEBUG ((DEBUG_ERROR, "[%a]: Option %d : Option Value = =3D %d, > Option Name =3D %s.\n",gEfiCallerBaseName, Index, Option->OptionOpCode- > >Value.u8, OneOfOptionStr)); > + break; > + > + default: > + ASSERT (FALSE); > + break; > + } > + Link =3D GetNextNode (&Question->OptionListHead, Link); > + Index++; > + } > +} > + > /** > Process a Question's Option (whether selected or un-selected). >=20 > @param MenuOption The MenuOption for this Question. > @param Selected TRUE: if Question is selected. > @@ -1010,10 +1120,15 @@ ProcessOptions ( > break; > } >=20 > OneOfOption =3D ValueToOption (Question, &HiiValue); > if (OneOfOption =3D=3D NULL) { > + // > + // Print debug msg for the mistach menu. > + // > + PrintMismatchMenuInfo (MenuOption); > + > if (SkipErrorValue) { > // > // Just try to get the option string, skip the value which n= ot has option. > // > continue; > @@ -1082,10 +1197,15 @@ ProcessOptions ( >=20 > if (FindArrayData (ValueArray, ValueType, OneOfOption- > >OptionOpCode->Value.u64, NULL)) { > continue; > } >=20 > + // > + // Print debug msg for the mistach menu. > + // > + PrintMismatchMenuInfo (MenuOption); > + > if (SkipErrorValue) { > // > // Not report error, just get the correct option string info. > // > Character[0] =3D LEFT_ONEOF_DELIMITER; @@ -1152,10 +1272,15 @@ > ProcessOptions ( > *OptionString =3D AllocateZeroPool (BufferSize); > ASSERT (*OptionString); >=20 > OneOfOption =3D ValueToOption (Question, QuestionValue); > if (OneOfOption =3D=3D NULL) { > + // > + // Print debug msg for the mistach menu. > + // > + PrintMismatchMenuInfo (MenuOption); > + > if (SkipErrorValue) { > // > // Not report error, just get the correct option string info. > // > Link =3D GetFirstNode (&Question->OptionListHead); > -- > 2.18.0.windows.1