mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-26 23:24:03 +02:00
SourceLevelDebugPkg/PeCoffExtraActionLibDebug: Support IA32 processors without debug extensions
Use CPUID Leaf 01 to detect support for debug extensions. Force use of software breakpoints if debug extensions are not supported. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17219 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
d5203c10e8
commit
ef530fe71f
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
PE/Coff Extra Action library instances.
|
PE/Coff Extra Action library instances.
|
||||||
|
|
||||||
Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -65,6 +65,7 @@ PeCoffLoaderExtraActionCommon (
|
|||||||
IA32_DESCRIPTOR IdtDescriptor;
|
IA32_DESCRIPTOR IdtDescriptor;
|
||||||
IA32_IDT_GATE_DESCRIPTOR OriginalIdtEntry;
|
IA32_IDT_GATE_DESCRIPTOR OriginalIdtEntry;
|
||||||
BOOLEAN IdtEntryHooked;
|
BOOLEAN IdtEntryHooked;
|
||||||
|
UINT32 RegEdx;
|
||||||
|
|
||||||
ASSERT (ImageContext != NULL);
|
ASSERT (ImageContext != NULL);
|
||||||
|
|
||||||
@ -79,6 +80,16 @@ PeCoffLoaderExtraActionCommon (
|
|||||||
|
|
||||||
IdtEntryHooked = FALSE;
|
IdtEntryHooked = FALSE;
|
||||||
LoadImageMethod = PcdGet8 (PcdDebugLoadImageMethod);
|
LoadImageMethod = PcdGet8 (PcdDebugLoadImageMethod);
|
||||||
|
if (LoadImageMethod == DEBUG_LOAD_IMAGE_METHOD_IO_HW_BREAKPOINT) {
|
||||||
|
//
|
||||||
|
// If the CPU does not support Debug Extensions(CPUID:01 EDX:BIT2)
|
||||||
|
// then force use of DEBUG_LOAD_IMAGE_METHOD_SOFT_INT3
|
||||||
|
//
|
||||||
|
AsmCpuid (1, NULL, NULL, NULL, &RegEdx);
|
||||||
|
if ((RegEdx & BIT2) == 0) {
|
||||||
|
LoadImageMethod = DEBUG_LOAD_IMAGE_METHOD_SOFT_INT3;
|
||||||
|
}
|
||||||
|
}
|
||||||
AsmReadIdtr (&IdtDescriptor);
|
AsmReadIdtr (&IdtDescriptor);
|
||||||
if (LoadImageMethod == DEBUG_LOAD_IMAGE_METHOD_SOFT_INT3) {
|
if (LoadImageMethod == DEBUG_LOAD_IMAGE_METHOD_SOFT_INT3) {
|
||||||
if (!CheckDebugAgentHandler (&IdtDescriptor, SOFT_INT_VECTOR_NUM)) {
|
if (!CheckDebugAgentHandler (&IdtDescriptor, SOFT_INT_VECTOR_NUM)) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
## @file
|
## @file
|
||||||
# PeCoffExtraAction Library to support source level debug.
|
# PeCoffExtraAction Library to support source level debug.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -19,7 +19,7 @@
|
|||||||
MODULE_UNI_FILE = PeCoffExtraActionLib.uni
|
MODULE_UNI_FILE = PeCoffExtraActionLib.uni
|
||||||
FILE_GUID = 8F01CBD5-E069-44d7-90C9-35F0318603AD
|
FILE_GUID = 8F01CBD5-E069-44d7-90C9-35F0318603AD
|
||||||
MODULE_TYPE = BASE
|
MODULE_TYPE = BASE
|
||||||
VERSION_STRING = 0.7
|
VERSION_STRING = 0.8
|
||||||
LIBRARY_CLASS = PeCoffExtraActionLib
|
LIBRARY_CLASS = PeCoffExtraActionLib
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user