Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions AdvLoggerPkg/AdvLoggerPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@
#
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerHdwPortDebugPrintErrorLevel|0xFFFFFFFF|UINT32|0x00010180

## Always Print Assert Message to Serial Port
#
# Enable AssertLib to print ASSERT message to serial port in addition of AdvLogger
#
gAdvLoggerPkgTokenSpaceGuid.PcdAlwaysPrintAssertMsgToSerialPort|FALSE|BOOLEAN|0x00010199


[UserExtensions.TianoCore."ExtraFiles"]
AdvLoggerPkgExtra.uni
5 changes: 5 additions & 0 deletions AdvLoggerPkg/Library/AssertLib/AssertLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <Library/DebugLib.h>
#include <Library/PcdLib.h>
#include <Library/PrintLib.h>
#include <Library/SerialPortLib.h>

//
// Define the maximum debug and assert message length that this library supports
Expand Down Expand Up @@ -65,6 +66,10 @@ DebugAssert (
//
AdvancedLoggerWrite (DEBUG_ERROR, Buffer, AsciiStrnLenS (Buffer, sizeof (Buffer)));

if (PcdGetBool(PcdAlwaysPrintAssertMsgToSerialPort)) {
SerialPortWrite(Buffer, AsciiStrnLenS (Buffer, sizeof (Buffer)));
}

if ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) {
CpuBreakpoint ();
}
Expand Down
4 changes: 3 additions & 1 deletion AdvLoggerPkg/Library/AssertLib/AssertLib.inf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
BaseLib
PcdLib
PrintLib
SerialPortLib

[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES
gAdvLoggerPkgTokenSpaceGuid.PcdAlwaysPrintAssertMsgToSerialPort ## CONSUMES
Loading