mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-26 23:24:03 +02:00
MdePkg: Defined DEBUG_RAISE() to facilitate fuzzing.
This commit is contained in:
parent
84c6f4ae1a
commit
d172035ede
@ -23,6 +23,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||||||
#ifndef __DEBUG_LIB_H__
|
#ifndef __DEBUG_LIB_H__
|
||||||
#define __DEBUG_LIB_H__
|
#define __DEBUG_LIB_H__
|
||||||
|
|
||||||
|
#include <Library/BaseLib.h>
|
||||||
|
#include <Library/PcdLib.h>
|
||||||
|
|
||||||
//
|
//
|
||||||
// Declare bits for PcdDebugPropertyMask
|
// Declare bits for PcdDebugPropertyMask
|
||||||
//
|
//
|
||||||
@ -609,6 +612,21 @@ UnitTestDebugAssert (
|
|||||||
} \
|
} \
|
||||||
} while (FALSE)
|
} while (FALSE)
|
||||||
|
|
||||||
|
#define DEBUG_RAISE() \
|
||||||
|
do { \
|
||||||
|
if ((PcdGet8 (PcdDebugRaisePropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0) { \
|
||||||
|
DEBUG ((DEBUG_WARN, "DEBUG RAISE: Constraint violation in %a:%a:%u\n", __FILE__, __func__, __LINE__));\
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
if ((PcdGet8 (PcdDebugRaisePropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0) { \
|
||||||
|
ASSERT (FALSE); \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
if ((PcdGet8 (PcdDebugRaisePropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) { \
|
||||||
|
CpuBreakpoint (); \
|
||||||
|
} \
|
||||||
|
} while (FALSE)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Macro that calls DebugAssert() if the containing record does not have a
|
Macro that calls DebugAssert() if the containing record does not have a
|
||||||
matching signature. If the signatures matches, then a pointer to the data
|
matching signature. If the signatures matches, then a pointer to the data
|
||||||
|
@ -45,3 +45,4 @@
|
|||||||
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderDebugSupport
|
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderDebugSupport
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderProhibitTe
|
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderProhibitTe
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderAllowMisalignedOffset
|
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderAllowMisalignedOffset
|
||||||
|
gEfiMdePkgTokenSpaceGuid.PcdDebugRaisePropertyMask
|
||||||
|
@ -38,3 +38,4 @@
|
|||||||
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderAlignmentPolicy
|
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderAlignmentPolicy
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderLoadHeader
|
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderLoadHeader
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderProhibitTe
|
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderProhibitTe
|
||||||
|
gEfiMdePkgTokenSpaceGuid.PcdDebugRaisePropertyMask
|
||||||
|
@ -2411,6 +2411,13 @@
|
|||||||
# @Expression 0x80000002 | (gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask & 0xC0) == 0
|
# @Expression 0x80000002 | (gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask & 0xC0) == 0
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0|UINT8|0x00000005
|
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0|UINT8|0x00000005
|
||||||
|
|
||||||
|
## The mask is used to control DEBUG_RAISE() behavior.<BR><BR>
|
||||||
|
# BIT0 - Enable Debug Assert.<BR>
|
||||||
|
# BIT1 - Enable Debug Print.<BR>
|
||||||
|
# BIT4 - Enable BreakPoint as ASSERT.<BR>
|
||||||
|
# @Prompt DEBUG_RAISE() Property.
|
||||||
|
gEfiMdePkgTokenSpaceGuid.PcdDebugRaisePropertyMask|0|UINT8|0x0000001b
|
||||||
|
|
||||||
## This flag is used to filter the output of the DEBUG_PRINT macro and DebugPrint functions.<BR><BR>
|
## This flag is used to filter the output of the DEBUG_PRINT macro and DebugPrint functions.<BR><BR>
|
||||||
# The default value is 0x80000000, meaning that DebugPrint returns immediately for anything
|
# The default value is 0x80000000, meaning that DebugPrint returns immediately for anything
|
||||||
# except errors. You might set this to a value like 0x80000002 to also enable warnings.<BR><BR>
|
# except errors. You might set this to a value like 0x80000002 to also enable warnings.<BR><BR>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user