]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SourceLevelDebugPkg/DebugAgent: Add some comments and debug message
authorJeff Fan <jeff.fan@intel.com>
Mon, 27 Apr 2015 05:26:03 +0000 (05:26 +0000)
committervanjeff <vanjeff@Edk2>
Mon, 27 Apr 2015 05:26:03 +0000 (05:26 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17206 6f19259b-4bc3-4df7-8a09-765794883524

SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c

index 7f597352f1f2f8cd59e67d8eee9ac4067eac3b06..3daa6336cb7781da34c92b71e25ef00e74b287e1 100644 (file)
@@ -1335,8 +1335,12 @@ GetBreakCause (
       if ((CpuContext->Dr6 & BIT14) != 0) {\r
         Cause = DEBUG_DATA_BREAK_CAUSE_STEPPING;\r
         //\r
-        // If it's single step, no need to check DR0, to ensure single step work in PeCoffExtraActionLib\r
-        // (right after triggering a breakpoint to report image load/unload).\r
+        // DR6.BIT14 Indicates (when set) that the debug exception was\r
+        // triggered by the single step execution mode.\r
+        // The single-step mode is the highest priority debug exception.\r
+        // This is single step, no need to check DR0, to ensure single step\r
+        // work in PeCoffExtraActionLib (right after triggering a breakpoint\r
+        // to report image load/unload).\r
         //\r
         return Cause;\r
 \r
@@ -2392,9 +2396,16 @@ InterruptProcess (
     // Check if this exception is issued by Debug Agent itself\r
     // If yes, fill the debug agent exception buffer and LongJump() back to\r
     // the saved CPU content in CommandCommunication()\r
+    // If exception is issued when executing Stepping, will be handled in\r
+    // exception handle procedure.\r
     //\r
     if (GetDebugFlag (DEBUG_AGENT_FLAG_AGENT_IN_PROGRESS) == 1) {\r
-      DebugAgentMsgPrint (DEBUG_AGENT_ERROR, "Debug agent meet one Exception, ExceptionNum is %d, EIP = 0x%x.\n", Vector, (UINTN)CpuContext->Eip);\r
+      DebugAgentMsgPrint (\r
+        DEBUG_AGENT_ERROR,\r
+        "Debug agent meet one Exception, ExceptionNum is %d, EIP = 0x%x.\n",\r
+        Vector,\r
+        (UINTN)CpuContext->Eip\r
+        );\r
       ExceptionBuffer = (DEBUG_AGENT_EXCEPTION_BUFFER *) (UINTN) GetMailboxPointer()->ExceptionBufferPointer;\r
       ExceptionBuffer->ExceptionContent.ExceptionNum  = (UINT8) Vector;\r
       ExceptionBuffer->ExceptionContent.ExceptionData = (UINT32) CpuContext->ExceptionData;\r
@@ -2604,9 +2615,16 @@ InterruptProcess (
 \r
   default:\r
     if (Vector <= DEBUG_EXCEPT_SIMD) {\r
+      DebugAgentMsgPrint (\r
+        DEBUG_AGENT_ERROR,\r
+        "Exception happened, ExceptionNum is %d, EIP = 0x%x.\n",\r
+        Vector,\r
+        (UINTN) CpuContext->Eip\r
+        );\r
       if (BreakCause == DEBUG_DATA_BREAK_CAUSE_STEPPING) {\r
         //\r
-        // Stepping is finished, send Ack package.\r
+        // If exception happened when executing Stepping, send Ack package.\r
+        // HOST consider Stepping command was finished.\r
         //\r
         if (MultiProcessorDebugSupport()) {\r
           mDebugMpContext.BreakAtCpuIndex = ProcessorIndex;\r