[edk2-devel] [PATCH v2 1/1] MdeModulePkg: Print which PCD was unable to be found

Wu, Hao A hao.a.wu at intel.com
Mon Jul 19 05:55:13 UTC 2021


> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Daniel
> Schaefer
> Sent: Wednesday, July 14, 2021 12:43 PM
> To: devel at edk2.groups.io
> Cc: Daniel Schaefer <daniel.schaefer at hpe.com>; Wang, Jian J
> <jian.j.wang at intel.com>; Wu, Hao A <hao.a.wu at intel.com>; Bi, Dandan
> <dandan.bi at intel.com>; Liming Gao <gaoliming at byosoft.com.cn>
> Subject: [edk2-devel] [PATCH v2 1/1] MdeModulePkg: Print which PCD was
> unable to be found
> 
> When reaching the assert, it can't be debugged because the PCD is unknown.
> Therefore the PCD's GUID and token number should be printed.
> 
> Signed-off-by: Daniel Schaefer <daniel.schaefer at hpe.com>
> Cc: Jian J Wang <jian.j.wang at intel.com>
> Cc: Hao A Wu <hao.a.wu at intel.com>
> Cc: Dandan Bi <dandan.bi at intel.com>
> Cc: Liming Gao <gaoliming at byosoft.com.cn>
> ---
>  MdeModulePkg/Universal/PCD/Dxe/Service.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c
> b/MdeModulePkg/Universal/PCD/Dxe/Service.c
> index ea7edc3cbb1c..badeec8c97f0 100644
> --- a/MdeModulePkg/Universal/PCD/Dxe/Service.c
> +++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c
> @@ -3,7 +3,7 @@
> 
>  Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
> Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> -(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
> +(C) Copyright 2016-2021 Hewlett Packard Enterprise Development LP<BR>
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -1610,6 +1610,7 @@ GetExPcdTokenNumber (
>      }
>    }
> 
> +  DEBUG ((DEBUG_ERROR, "%a: Failed to find PCD with GUID: %g and token
> + number: %d\n", __FUNCTION__, Guid, ExTokenNumber));


The change looks good to me.
Reviewed-by: Hao A Wu <hao.a.wu at intel.com>

I will wait a couple days before merging to see if there are comments from the
Core services modules reviewers.

Best Regards,
Hao Wu


>    ASSERT (FALSE);
> 
>    return 0;
> --
> 2.31.1
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77868): https://edk2.groups.io/g/devel/message/77868
Mute This Topic: https://groups.io/mt/84195540/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list