Change seems fine to me.  Note that I am not maintainer on this PKG.

Reviewed-by: Jaben Carsey <jaben.car...@intel.com>

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Anbazhagan, Baraneedharan
> Sent: Tuesday, December 01, 2015 3:26 PM
> To: edk2-devel@lists.01.org; Carsey, Jaben <jaben.car...@intel.com>; Gao,
> Liming <liming....@intel.com>; Kinney, Michael D
> <michael.d.kin...@intel.com>
> Subject: Re: [edk2] MdePkg: DebugAssert enhancement
> Importance: High
> 
> MdePkg: DebugAssert enhancement
> 
> If the assert happens in a library, then it's hard to determine which
> module using that library is generating that assert.  Use gEfiCallerBaseName
> in DebugAssert to display the module name.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Baraneedharan Anbazhagan <anbazha...@hp.com>
> 
> 
>  MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c        | 2 +-
>  MdePkg/Library/UefiDebugLibConOut/DebugLib.c            | 3 ++-
>  MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c | 3 ++-
>  MdePkg/Library/UefiDebugLibStdErr/DebugLib.c            | 3 ++-
>  4 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
> b/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
> index 6fa235c..8ab0847 100644
> --- a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
> +++ b/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
> @@ -133,7 +133,7 @@ DebugAssert (
>    //
>    // Generate the ASSERT() message in Ascii format
>    //
> -  AsciiSPrint (Buffer, sizeof (Buffer), "ASSERT %a(%d): %a\n", FileName,
> LineNumber, Description);
> +  AsciiSPrint (Buffer, sizeof (Buffer), "ASSERT [%a] %a(%d): %a\n",
> gEfiCallerBaseName, FileName, LineNumber, Description);
> 
>    //
>    // Send the print string to the Console Output device
> diff --git a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
> b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
> index 2ac2204..0bc112f 100644
> --- a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
> +++ b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
> @@ -121,7 +121,8 @@ DebugAssert (
>    UnicodeSPrintAsciiFormat (
>      Buffer,
>      sizeof (Buffer),
> -    "ASSERT %a(%d): %a\n",
> +    "ASSERT [%a] %a(%d): %a\n",
> +    gEfiCallerBaseName,
>      FileName,
>      LineNumber,
>      Description
> diff --git a/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c
> b/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c
> index 10d3e34..0e95046 100644
> --- a/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c
> +++ b/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c
> @@ -175,7 +175,8 @@ DebugAssert (
>    AsciiSPrint (
>      Buffer,
>      sizeof (Buffer),
> -    "ASSERT %a(%d): %a\n",
> +    "ASSERT [%a] %a(%d): %a\n",
> +    gEfiCallerBaseName,
>      FileName,
>      LineNumber,
>      Description
> diff --git a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
> b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
> index bbd6d94..cacb90a 100644
> --- a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
> +++ b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
> @@ -122,7 +122,8 @@ DebugAssert (
>    UnicodeSPrintAsciiFormat (
>      Buffer,
>      sizeof (Buffer),
> -    "ASSERT %a(%d): %a\n",
> +    "ASSERT [%a] %a(%d): %a\n",
> +    gEfiCallerBaseName,
>      FileName,
>      LineNumber,
>      Description
> 
> > -----Original Message-----
> > From: Carsey, Jaben [mailto:jaben.car...@intel.com]
> > Sent: Tuesday, December 01, 2015 3:05 PM
> > To: Anbazhagan, Baraneedharan
> > Cc: Carsey, Jaben
> > Subject: RE: MdePkg: DebugAssert enhancement
> >
> > You need to send this with your attestation and signed off by lines.  Please
> resubmit
> > with those things.
> >
> > > -----Original Message-----
> > > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > > Anbazhagan, Baraneedharan
> > > Sent: Tuesday, December 01, 2015 1:02 PM
> > > To: edk2-devel@lists.01.org; Gao, Liming <liming....@intel.com>;
> > > Kinney, Michael D <michael.d.kin...@intel.com>
> > > Subject: [edk2] MdePkg: DebugAssert enhancement
> > >
> > > Hi,
> > > Current DebugAssert function prints the file name and line number. If
> > > the assert happens in a library, then it's hard to determine which
> > > module using that library is generating that assert.  Can we add
> > > gEfiCallerBaseName to display the module name as well?
> > >
> > > -Baranee
> > >
> > > diff --git a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
> > > b/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
> > > index 6fa235c..8ab0847 100644
> > > --- a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
> > > +++ b/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
> > > @@ -133,7 +133,7 @@ DebugAssert (
> > >    //
> > >    // Generate the ASSERT() message in Ascii format
> > >    //
> > > -  AsciiSPrint (Buffer, sizeof (Buffer), "ASSERT %a(%d): %a\n",
> > > FileName, LineNumber, Description);
> > > +  AsciiSPrint (Buffer, sizeof (Buffer), "ASSERT [%a] %a(%d): %a\n",
> > > gEfiCallerBaseName, FileName, LineNumber, Description);
> > >    //
> > >    // Send the print string to the Console Output device diff --git
> > > a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
> > > b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
> > > index 2ac2204..0bc112f 100644
> > > --- a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
> > > +++ b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
> > > @@ -121,7 +121,8 @@ DebugAssert (
> > >    UnicodeSPrintAsciiFormat (
> > >      Buffer,
> > >      sizeof (Buffer),
> > > -    "ASSERT %a(%d): %a\n",
> > > +    "ASSERT [%a] %a(%d): %a\n",
> > > +    gEfiCallerBaseName,
> > >      FileName,
> > >      LineNumber,
> > >      Description
> > > diff --git a/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c
> > > b/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c
> > > index 10d3e34..0e95046 100644
> > > --- a/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c
> > > +++ b/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c
> > > @@ -175,7 +175,8 @@ DebugAssert (
> > >    AsciiSPrint (
> > >      Buffer,
> > >      sizeof (Buffer),
> > > -    "ASSERT %a(%d): %a\n",
> > > +    "ASSERT [%a] %a(%d): %a\n",
> > > +    gEfiCallerBaseName,
> > >      FileName,
> > >      LineNumber,
> > >      Description
> > > diff --git a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
> > > b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
> > > index bbd6d94..cacb90a 100644
> > > --- a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
> > > +++ b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
> > > @@ -122,7 +122,8 @@ DebugAssert (
> > >    UnicodeSPrintAsciiFormat (
> > >      Buffer,
> > >      sizeof (Buffer),
> > > -    "ASSERT %a(%d): %a\n",
> > > +    "ASSERT [%a] %a(%d): %a\n",
> > > +    gEfiCallerBaseName,
> > >      FileName,
> > >      LineNumber,
> > >      Description
> > > _______________________________________________
> > > edk2-devel mailing list
> > > edk2-devel@lists.01.org
> > > https://lists.01.org/mailman/listinfo/edk2-devel
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to