summaryrefslogtreecommitdiffstats
path: root/MdePkg/Include/Library/DebugLib.h
Commit message (Collapse)AuthorAgeFilesLines
* MdePkg/Include: Hook DebugLib _ASSERT() for unit testsMichael D Kinney2020-07-151-1/+27
| | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2801 Update DebugLib.h _ASSERT() macro to check if unit testing is enabled and call UnitTestDebugAssert() instead of DebugAssert() so the an ASSERT() condition that is triggered by a function under test can be handled by the Unit Test Framework. If EDKII_UNIT_TEST_FRAMEWORK_ENABLED is not defined, then the existing DebugLib behavior is preserved. Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for CLANGZhiguang Liu2020-04-131-1/+5
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1548 For clang compiler, This change will make the generated image not include the absolute file path. If so, the generated debug image can be reproduced in the different root directory. Also, it will reduce the size of debug image size. To do so, use __FILE_NAME__ macro to replace __FILE__. __FILE_NAME__ is Clang-specific extension that functions similar to __FILE__ but only renders the last path component (the filename) instead of an invocation dependent full path to that file, and __FILE_NAME__ is introduced since clang 9. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* MdePkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-091-7/+1
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/DebugLib.h: Add new APIs for DebugLibBret Barkelew2019-04-021-1/+51
| | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1395 Add new APIs DebugVPrint and DebugBPrint prototype definition in the DebugLib header file. These APIs would expose a print routine with VaList parameter and BaseList parameter. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg: Clean up source filesLiming Gao2018-06-281-85/+85
| | | | | | | | | 1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com>
* MdePkg/DebugLib.h: add ASSERT_RETURN_ERROR()Laszlo Ersek2016-10-251-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ASSERT_EFI_ERROR() cannot be used in BASE type modules because - the replacement text calls EFI_ERROR(), - EFI_ERROR() is defined in "MdePkg/Include/Uefi/UefiBaseType.h", - the inclusion of "UefiBaseType.h" is not required for BASE type modules. While ASSERT (!RETURN_ERROR (StatusParameter)) would be a functional statement in BASE type modules, it would be less convenient and less informative: ASSERT_EFI_ERROR() prints the actual StatusParameter. Hence add ASSERT_RETURN_ERROR(), paralleling ASSERT_EFI_ERROR(). Copy the original macro definition and update it as follows: - replace EFI with RETURN, - wrap overlong lines in the comment block and in the code, - EFI_D_ERROR is deprecated, so employ DEBUG_ERROR instead. Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=166 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> # RVCT Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* MdePkg:Correct the comment for the DEBUG_NET.Zhang Lubo2016-10-091-2/+2
| | | | | | | | | | | | | | Generalize the comment for the DEBUG_NET #define DEBUG_NET 0x00004000 // SNP Driver to Network IO Driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Cc: Subramanian Sriram <sriram-s@hpe.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
* MdePkg/DebugLib: Flag post-_ASSERT() as unreachable for analyzers.Marvin H?user2016-06-221-0/+1
| | | | | | | | | | | | | | | | | When a variable is compared to NULL as part of an ASSERT() call, the code implies that the variable may be NULL. Certain Static Analyzers, such as the Clang Static Analyzer, then issue false warnings for any untested access of that pointer, even though that defeats the intention behind ASSERT(). This patch flags the position after _ASSERT() as unreachable for Static Analyzers to indicate that if the variable is NULL, execution cannot pass. As the ANALYZER-prefixed version is used, the executables will not have any code stripped during compilation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg: DebugLib: more cleanup for log level comments in lib class headerLaszlo Ersek2016-03-021-4/+5
| | | | | | | | | | | | | | The DEBUG_POOL and DEBUG_PAGE clarifications were suggested by Leif Lindholm. Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* MdePkg: fix comment typo in DebugLib.hLeif Lindholm2016-03-011-1/+1
| | | | | | | | | | The definition of DEBUG_LOADFILE was incorrectly described as "UNDI Driver". Correct this to align with MdePkg.dec. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
* MdePkg: Correct comment typo from ECB to EBC in DebugLib.hLiming Gao2015-07-161-1/+1
| | | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18019 6f19259b-4bc3-4df7-8a09-765794883524
* MdePkg: Fix build fail when DDK3790 tool chain is usedScott Duplichan2015-04-101-1/+1
| | | | | | | | | | | | | | | | | | | Modify the preprocessor check for variadic macro support. The existing check assumes all Microsoft compilers with major version of 14 and greater support variadic macros. This is almost correct. An exception is the X64 compiler from DDK3790. This compiler has version 14.00.40310.41, yet does not support variadic macros. Both VS2005 compilers have version number 14.00.50727.762 and do support variadic macros. For simplicity, this change suppresses the use of variadic macros for all Microsoft compilers with version 14 or smaller. If the variadic macro support needs to be restored for VS2005, that could be done using new logic invloving _MSC_FULL_VER. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Scott Duplichan <scott@notabs.org> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17155 6f19259b-4bc3-4df7-8a09-765794883524
* MdePkg: Fix WINDDK3790 build failureLiming Gao2015-02-101-1/+3
| | | | | | | | | | WINDDK3790 doesn't support __VA_ARGS__ macro. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16820 6f19259b-4bc3-4df7-8a09-765794883524
* MdePkg: Add new API DebugPrintLevelEnabled() in DebugLibLiming Gao2015-02-061-2/+26
| | | | | | | | | | | | | This API is applied in _DEBUG_PRINT() macro for build time size optimization. DebugLib library instance should implement this API to return the constant value. DEBUG_PRINT() will base on __VA_ARGS__ for build time size optimization. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16787 6f19259b-4bc3-4df7-8a09-765794883524
* Add new DEBUG_VERBOSE print error level.lgao42012-01-161-2/+4
| | | | | | | Signed-off-by: lgao4 Reviewed-by: hhtian git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12933 6f19259b-4bc3-4df7-8a09-765794883524
* Update DebugLib to provide support for "err" command in the EFI Shell to ↵mdkinney2011-03-101-3/+3
| | | | | | | | | | | | | | | | adjust the filter mask for DEBUG() messages. The "err" command provide the ability to adjust this filter mask at a global level through an EFI Variable and at the module level through a the Debug Mask Protocol. In order to support the degree of flexibility, the DebugLib needs to use library to abstract the get/set operations to the filter mask. 1) Define new DebugPrintErrorLevelLib that produces an API that DebugPrint() APIs in DebugLib implementations can use to retrieve the current mask for filtering DebugPrint() statements. 2) Add a BASE type implementation of the DebugPrintErrorLevelLib that directly accessed PcdDebugPrintErrorLevel to provide backward compatibility with the current EDK II DebugLib behavior. 3) Update description of the DebugPrint() API in the DebugLib to describe the new dependency on the DebugPrintErrorLevelLib that replaces the prior dependency in the PcdDebugPrintErrorLevel PCD. 4) Update the comments in BaseDebugLibNull to match (3). 5) Update BaseDebugLibSerialPort to use DebugPrintErrorLevelLib instead of the PcdDebugPrintErrorLevel PCD. 6) Update UefiDebugLinConOut to use DebugPrintErrorLevelLib instead of the PcdDebugPrintErrorLevel PCD. 7) Update UefiDebugLibStdErr to use DebugPrintErrorLevelLib instead of the PcdDebugPrintErrorLevel PCD. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11365 6f19259b-4bc3-4df7-8a09-765794883524
* Fix Copyright year to 2011mdkinney2011-01-061-1/+1
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11229 6f19259b-4bc3-4df7-8a09-765794883524
* Define bits for PcdDebugPrintErrorLevel to monitor Global Coherency ↵mdkinney2011-01-061-0/+2
| | | | | | Domain(GCD) and memory cache setting changes. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11228 6f19259b-4bc3-4df7-8a09-765794883524
* Update comments for PI 1.2 SMM support.mdkinney2010-12-011-1/+1
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11110 6f19259b-4bc3-4df7-8a09-765794883524
* Update the copyright notice formathhtian2010-04-231-1/+1
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10403 6f19259b-4bc3-4df7-8a09-765794883524
* Grammatical and disclaimer changes (does not follow internal C coding stds.)myronporter2010-03-121-25/+25
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10235 6f19259b-4bc3-4df7-8a09-765794883524
* wrap ASSERT_LOCKED macro with MDEPKG_NDEBUG.erictian2010-02-021-4/+4
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9907 6f19259b-4bc3-4df7-8a09-765794883524
* Introduce a MDEPKG_NDEBUG macro to provide a method which can be used to ↵eric_tian2009-12-141-75/+99
| | | | | | reduce code size when compiler optimization is disabled. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9560 6f19259b-4bc3-4df7-8a09-765794883524
* Second set of changes based on a review of the code comments in the Include ↵pkandel2009-06-041-4/+4
| | | | | | directory for typos, grammar issues, and language clarity. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8467 6f19259b-4bc3-4df7-8a09-765794883524
* Synchronize the h files with c files.gikidy2008-12-101-1/+1
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6967 6f19259b-4bc3-4df7-8a09-765794883524
* Change _CR() to BASE_CR() to follow naming conventionmdkinney2008-12-061-4/+4
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6886 6f19259b-4bc3-4df7-8a09-765794883524
* Synchronize function comment in gikidy2008-11-261-35/+16
| | | | | | | MdePkg\Library\CpuLib.h, DebugLib.h,DevicePathLib.h, DxeServicesLib.h, DxeServicesTableLib.h, ExtractGuidedSectionLib.h, HobLib.h with the c file instance of this functions in MdePkg. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6727 6f19259b-4bc3-4df7-8a09-765794883524
* Synchronize the MdePkg\Include\Library\BaseMemoryLib.h,gikidy2008-11-191-1/+4
| | | | | | CacheMaintenance.h,CpuLib.h,DebugLib.h,DevicePathLib.h with the MDE_Library_Spec. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6629 6f19259b-4bc3-4df7-8a09-765794883524
* Update doxygen comment for VarArg list parameter. "..."'s description is added.qwang122008-11-191-1/+2
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6623 6f19259b-4bc3-4df7-8a09-765794883524
* Synchronization of MDE Library Spec., Mde.dec, and corresponding head files ↵jji42008-11-141-8/+8
| | | | | | in MdePkg\Include\Library. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6544 6f19259b-4bc3-4df7-8a09-765794883524
* At bit mask for PEI/DXE dispatchqhuang82008-11-061-0/+2
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6414 6f19259b-4bc3-4df7-8a09-765794883524
* remove DEBUG_DEPEX as it does not pass design review yet.qwang122008-11-041-2/+0
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6375 6f19259b-4bc3-4df7-8a09-765794883524
* Add in a new debug mask bit EFI_D_DEPEX. It is used to enable the debug ↵qwang122008-11-031-1/+3
| | | | | | message related to Dependency evaluation. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6362 6f19259b-4bc3-4df7-8a09-765794883524
* code review's result.eric_tian2008-08-121-4/+4
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5633 6f19259b-4bc3-4df7-8a09-765794883524
* Code scrub for the Debug library, PostCode library, Print library, and ↵lgao42008-07-151-5/+6
| | | | | | ExtractGuidedSection library. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5478 6f19259b-4bc3-4df7-8a09-765794883524
* Import Library Class from original MDE package. Also I added the ↵yshang12007-06-191-0/+458
| | | | | | EFI_PEI_CORE_ENTRY_POINT definition in PiPeiCis.h. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2677 6f19259b-4bc3-4df7-8a09-765794883524
* Moved the MdePkg to OldMdePkg so that new code in MdePkg does not break ↵lhauch2007-06-011-458/+0
| | | | | | existing builds. Also updated the SPD and FPD files UiNames git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2616 6f19259b-4bc3-4df7-8a09-765794883524
* Add alias EFI_D_XXX to provide backward compatibilities.qhuang82007-02-131-15/+34
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2386 6f19259b-4bc3-4df7-8a09-765794883524
* Make MDE package pass intel IPF compiler with /W4 /WX switched on.xli242007-01-251-1/+1
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2312 6f19259b-4bc3-4df7-8a09-765794883524
* 1. PostCodeLib.qhuang82006-06-191-16/+16
| | | | | | | | | | | | | | | | Rename BasePostCodeLib80 to BasePostCodeLibPort80. Fix typos in macro POST_CODE() and POST_CODE_WITH_DESCRIPTION() 2. DebugLib Change the parameter type of LineNumber of DebugAssert() from “INTN” to “UINTN” to follow MWG. Add type cast “(EFI_GUID *)” in macro ASSERT_PROTCOL_ALREADY_INSTALLED () to follow MWG. 3. BasePeCoffLib/ Add library function header for all the interfaces in MWG. Add missing ASSERT()s. 4. PciLib Add ASSERT()s in PciRead/WriteBuffer() to check cross PCI function access. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@557 6f19259b-4bc3-4df7-8a09-765794883524
* BaseMemoryLib (BaseMemoryLibRepStr):qhuang82006-06-131-2/+2
| | | | | | | | | | | | | | | | | | | | | Fix a logic error in SetMem64 (); The correct stride should be 8 instead of 4. BasePrintLib: Fix Printf(“%\n”) passer error. Fix BufferSize = 0, 1 issue Fix some missing ASSERT ()s Move MAXIMUM_VALUE_CHARACTERS from PrintLibInternal.h to PrintLib.h ReportStatusCodeLib: Add CONST modifier to some interfaces Modify DebugLib: Replace some Unicode in comments. PeiServicesTablePointerLib Add ASSERT()s PciLib: Remove unnecessary ASSERT()s in PciRead/WriteBuffer() git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@496 6f19259b-4bc3-4df7-8a09-765794883524
* MemoryAllocationLib: For boundary case: “AllocationSize + ↵qhuang82006-05-251-6/+6
| | | | | | | | | | | | | | | | | | | OverAllocationSize >= 4G” DxeMemoryAllocationLib: Change the behavior from returning NULL to ASSERT () PeiMemoryAllocationLib: Add ASSERT () I also add ASSERT () in Pei Service AllocatePool () to catch if allocation size > 64K DebugLib: Header file (DebugLib.h): Fix an issue in ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid). In contrast with LocateProtocol (), the first & second parameter type of HandleProtocol () is EFI_HANDLE & EFI_GUID respectively. UefiLib: For UnicodeStringDisplayLength (CONST CHAR8 *String), return 0 if String is NULL. BasePrintLib: Add missing “EFIAPI” to UnicodeValueToString() and AsciiValueToString() and move their definitions from PrintLibInternal.c to PrintLib.c. Fix the comments error(Maximum Length TIME”) git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@275 6f19259b-4bc3-4df7-8a09-765794883524
* git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@202 ↵lgao42006-05-191-1/+1
| | | | 6f19259b-4bc3-4df7-8a09-765794883524
* Finish bug at line 324:vanjeff2006-05-191-1/+1
| | | | | | gBS->LocateProtocol (Handle, Guid, &Instance) error git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@201 6f19259b-4bc3-4df7-8a09-765794883524
* Added CONST for some sting type to follow MWG-0.51. Tracker 26 and 28vanjeff2006-04-271-5/+5
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@62 6f19259b-4bc3-4df7-8a09-765794883524
* Initial import.bbahnsen2006-04-211-0/+439
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3 6f19259b-4bc3-4df7-8a09-765794883524