summaryrefslogtreecommitdiff
path: root/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2013-11-22 06:30:01 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2013-11-22 06:30:01 +0000
commit8cc26df4a60ec3a3b7f9d58ccefc12a1a5b6e199 (patch)
treebb7472ee01a60f805b09d718d952f601b82516d2 /SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c
parente41aad152135f27ae1da142454af85a6597719ee (diff)
downloadedk2-platforms-8cc26df4a60ec3a3b7f9d58ccefc12a1a5b6e199.tar.xz
1. DebugAgentLib will install reserved vector table to persist vectors.
2. Update PeCoffExtraActionLib to detect if debug agent initialized or not by checking each IDT entry instead of whole IDT table. Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14886 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c')
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c108
1 files changed, 108 insertions, 0 deletions
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c
index 01711ff085..239cf63f6b 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c
+++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c
@@ -24,6 +24,114 @@ CHAR8 mErrorMsgConnectOK[] = "HOST connection is successful!\r\n";
CHAR8 mErrorMsgConnectFail[] = "HOST connection is failed!\r\n";
CHAR8 mWarningMsgIngoreBreakpoint[] = "Ignore break point in SMM for SMI issued during DXE debugging!\r\n";
+//
+// Vector Handoff Info list used by Debug Agent for persist
+//
+EFI_VECTOR_HANDOFF_INFO mVectorHandoffInfoDebugAgent[] = {
+ {
+ DEBUG_EXCEPT_DIVIDE_ERROR, // Vector 0
+ EFI_VECTOR_HANDOFF_HOOK_BEFORE,
+ EFI_DEBUG_AGENT_GUID
+ },
+ {
+ DEBUG_EXCEPT_DEBUG, // Vector 1
+ EFI_VECTOR_HANDOFF_DO_NOT_HOOK,
+ EFI_DEBUG_AGENT_GUID
+ },
+ {
+ DEBUG_EXCEPT_NMI, // Vector 2
+ EFI_VECTOR_HANDOFF_HOOK_BEFORE,
+ EFI_DEBUG_AGENT_GUID
+ },
+ {
+ DEBUG_EXCEPT_BREAKPOINT, // Vector 3
+ EFI_VECTOR_HANDOFF_DO_NOT_HOOK,
+ EFI_DEBUG_AGENT_GUID
+ },
+ {
+ DEBUG_EXCEPT_OVERFLOW, // Vector 4
+ EFI_VECTOR_HANDOFF_HOOK_BEFORE,
+ EFI_DEBUG_AGENT_GUID
+ },
+ {
+ DEBUG_EXCEPT_BOUND, // Vector 5
+ EFI_VECTOR_HANDOFF_HOOK_BEFORE,
+ EFI_DEBUG_AGENT_GUID
+ },
+ {
+ DEBUG_EXCEPT_INVALID_OPCODE, // Vector 6
+ EFI_VECTOR_HANDOFF_HOOK_BEFORE,
+ EFI_DEBUG_AGENT_GUID
+ },
+ {
+ DEBUG_EXCEPT_DOUBLE_FAULT, // Vector 8
+ EFI_VECTOR_HANDOFF_HOOK_BEFORE,
+ EFI_DEBUG_AGENT_GUID
+ },
+ {
+ DEBUG_EXCEPT_INVALID_TSS, // Vector 10
+ EFI_VECTOR_HANDOFF_HOOK_BEFORE,
+ EFI_DEBUG_AGENT_GUID
+ },
+ {
+ DEBUG_EXCEPT_SEG_NOT_PRESENT, // Vector 11
+ EFI_VECTOR_HANDOFF_HOOK_BEFORE,
+ EFI_DEBUG_AGENT_GUID
+ },
+ {
+ DEBUG_EXCEPT_STACK_FAULT, // Vector 12
+ EFI_VECTOR_HANDOFF_HOOK_BEFORE,
+ EFI_DEBUG_AGENT_GUID
+ },
+ {
+ DEBUG_EXCEPT_GP_FAULT, // Vector 13
+ EFI_VECTOR_HANDOFF_HOOK_BEFORE,
+ EFI_DEBUG_AGENT_GUID
+ },
+ {
+ DEBUG_EXCEPT_PAGE_FAULT, // Vector 14
+ EFI_VECTOR_HANDOFF_HOOK_BEFORE,
+ EFI_DEBUG_AGENT_GUID
+ },
+ {
+ DEBUG_EXCEPT_FP_ERROR, // Vector 16
+ EFI_VECTOR_HANDOFF_HOOK_BEFORE,
+ EFI_DEBUG_AGENT_GUID
+ },
+ {
+ DEBUG_EXCEPT_ALIGNMENT_CHECK, // Vector 17
+ EFI_VECTOR_HANDOFF_HOOK_BEFORE,
+ EFI_DEBUG_AGENT_GUID
+ },
+ {
+ DEBUG_EXCEPT_MACHINE_CHECK, // Vector 18
+ EFI_VECTOR_HANDOFF_HOOK_BEFORE,
+ EFI_DEBUG_AGENT_GUID
+ },
+ {
+ DEBUG_EXCEPT_SIMD, // Vector 19
+ EFI_VECTOR_HANDOFF_HOOK_BEFORE,
+ EFI_DEBUG_AGENT_GUID
+ },
+ {
+ DEBUG_TIMER_VECTOR, // Vector 32
+ EFI_VECTOR_HANDOFF_DO_NOT_HOOK,
+ EFI_DEBUG_AGENT_GUID
+ },
+ {
+ DEBUG_MAILBOX_VECTOR, // Vector 33
+ EFI_VECTOR_HANDOFF_DO_NOT_HOOK,
+ EFI_DEBUG_AGENT_GUID
+ },
+ {
+ 0,
+ EFI_VECTOR_HANDOFF_LAST_ENTRY,
+ { 0 }
+ }
+};
+
+UINTN mVectorHandoffInfoCount = sizeof (mVectorHandoffInfoDebugAgent) / sizeof (EFI_VECTOR_HANDOFF_INFO);
+
/**
Calculate CRC16 for target data.