MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / DebugAssert

Function DebugAssert

Library/OcDebugLogLib/OcDebugLogLib.c:96–124  ·  view source on GitHub ↗

Prints an assert message containing a filename, line number, and description. This may be followed by a breakpoint or a dead loop. Print a message of the form "ASSERT ( ): \n" to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if DEBUG_PROPERTY_ASSERT_DEAD

Source from the content-addressed store, hash-verified

94
95**/
96VOID
97EFIAPI
98DebugAssert (
99 IN CONST CHAR8 *FileName,
100 IN UINTN LineNumber,
101 IN CONST CHAR8 *Description
102 )
103{
104 //
105 // Generate the ASSERT() message and log it
106 //
107 DebugPrint (
108 DEBUG_ERROR,
109 "ASSERT [%a] %a(%d): %a\n",
110 gEfiCallerBaseName,
111 FileName,
112 LineNumber,
113 Description
114 );
115
116 //
117 // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings
118 //
119 if ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) {
120 CpuBreakpoint ();
121 } else if ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) {
122 CpuDeadLoop ();
123 }
124}
125
126
127/**

Callers

nothing calls this directly

Calls 3

DebugPrintFunction · 0.70
CpuBreakpointFunction · 0.50
CpuDeadLoopFunction · 0.50

Tested by

no test coverage detected