]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix more InitializeDebugAgent API change bugs. GDB stub was not turned on in example...
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 23 Jul 2010 15:25:32 +0000 (15:25 +0000)
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 23 Jul 2010 15:25:32 +0000 (15:25 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10687 6f19259b-4bc3-4df7-8a09-765794883524

BeagleBoardPkg/BeagleBoardPkg.dsc
EmbeddedPkg/Library/GdbDebugAgent/Arm/Processor.c
EmbeddedPkg/Library/GdbDebugAgent/GdbDebugAgent.h
EmbeddedPkg/Library/GdbDebugAgent/Ia32/Processor.c

index bc886201bec27aa09f4f8b4986efb54de6707663..0e5f42eddce5702e098acc46e53fe0502d3b8cbd 100644 (file)
   OmapLib|Omap35xxPkg/Library/OmapLib/OmapLib.inf
   OmapDmaLib|Omap35xxPkg/Library/OmapDmaLib/OmapDmaLib.inf
   EblNetworkLib|EmbeddedPkg/Library/EblNetworkLib/EblNetworkLib.inf
-  
+  DebugAgentTimerLib|Omap35xxPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.inf\r
+
   GdbSerialLib|Omap35xxPkg/Library/GdbSerialLib/GdbSerialLib.inf
   ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
   DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf
   # 1/123 faster than Stm or Vstm version
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
 
+  # Uncomment to turn on GDB stub in SEC. \r
+  #DebugAgentLib|EmbeddedPkg/Library/GdbDebugAgent/GdbDebugAgent.inf\r
+
 [LibraryClasses.common.PEI_CORE]
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
index c5f59323dbb6bb1eaa3f3e22de400caff066de4f..d3c050499a302fb2f9155649bc8f669ab4429122 100755 (executable)
@@ -15,7 +15,6 @@
 \r
 \r
 #include <GdbDebugAgent.h>\r
-#include <Library/CacheMaintenanceLib.h>\r
 #include <Library/PrintLib.h>\r
 #include <Library/ArmLib.h>\r
 \r
@@ -597,17 +596,31 @@ GdbFPutString (
 /**\r
   Initialize debug agent.\r
 \r
-  This function is used to set up debug enviroment. It may enable interrupts.\r
+  This function is used to set up debug environment to support source level debugging.\r
+  If certain Debug Agent Library instance has to save some private data in the stack,\r
+  this function must work on the mode that doesn't return to the caller, then\r
+  the caller needs to wrap up all rest of logic after InitializeDebugAgent() into one\r
+  function and pass it into InitializeDebugAgent(). InitializeDebugAgent() is\r
+  responsible to invoke the passing-in function at the end of InitializeDebugAgent().\r
 \r
-  @param[in] InitFlag   Init flag is used to decide initialize process.\r
-  @param[in] Context    Context needed according to InitFlag, it was optional.\r
+  If the parameter Function is not NULL, Debug Agent Libary instance will invoke it by\r
+  passing in the Context to be its parameter.\r
+\r
+  If Function() is NULL, Debug Agent Library instance will return after setup debug\r
+  environment.\r
+\r
+  @param[in] InitFlag     Init flag is used to decide the initialize process.\r
+  @param[in] Context      Context needed according to InitFlag; it was optional.\r
+  @param[in] Function     Continue function called by debug agent library; it was\r
+                          optional.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 InitializeDebugAgent (\r
   IN UINT32                InitFlag,\r
-  IN VOID                  *Context  OPTIONAL\r
+  IN VOID                  *Context, OPTIONAL\r
+  IN DEBUG_AGENT_CONTINUE  Function  OPTIONAL\r
   )\r
 {  
   UINTN                Offset;\r
@@ -653,6 +666,10 @@ InitializeDebugAgent (
     ArmEnableInterrupts ();\r
   }\r
 \r
+  if (Function != NULL) {\r
+    Function (Context);\r
+  }\r
+\r
   return;\r
 }\r
 \r
index eee9f6d7678d3e23fc651dbd3713740816c7415c..2d0570e3dc472cb736db1f4af3b384453ed3956e 100755 (executable)
@@ -26,6 +26,7 @@
 #include <Library/PrintLib.h>
 #include <Library/CacheMaintenanceLib.h>
 #include <Library/DebugAgentTimerLib.h>
+#include <Library/DebugAgentLib.h>\r
 
 #include <IndustryStandard/PeImage.h>
 #include <Protocol/DebugSupport.h>
index c2f4b640b9af6384553d3e50d6efec904a192c99..96a1a596f3aeb9a5441013aa5bbafc2515fbc342 100755 (executable)
@@ -915,19 +915,37 @@ RemoveBreakPoint (
 /**\r
   Initialize debug agent.\r
 \r
-  This function is used to set up debug enviroment. It may enable interrupts.\r
+  This function is used to set up debug environment to support source level debugging.\r
+  If certain Debug Agent Library instance has to save some private data in the stack,\r
+  this function must work on the mode that doesn't return to the caller, then\r
+  the caller needs to wrap up all rest of logic after InitializeDebugAgent() into one\r
+  function and pass it into InitializeDebugAgent(). InitializeDebugAgent() is\r
+  responsible to invoke the passing-in function at the end of InitializeDebugAgent().\r
 \r
-  @param[in] InitFlag   Init flag is used to decide initialize process.\r
-  @param[in] Context    Context needed according to InitFlag, it was optional.\r
+  If the parameter Function is not NULL, Debug Agent Libary instance will invoke it by\r
+  passing in the Context to be its parameter.\r
+\r
+  If Function() is NULL, Debug Agent Library instance will return after setup debug\r
+  environment.\r
+\r
+  @param[in] InitFlag     Init flag is used to decide the initialize process.\r
+  @param[in] Context      Context needed according to InitFlag; it was optional.\r
+  @param[in] Function     Continue function called by debug agent library; it was\r
+                          optional.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 InitializeDebugAgent (\r
   IN UINT32                InitFlag,\r
-  IN VOID                  *Context  OPTIONAL\r
+  IN VOID                  *Context, OPTIONAL\r
+  IN DEBUG_AGENT_CONTINUE  Function  OPTIONAL\r
   )\r
 {\r
   // BugBug: Add the code to build an GDT/IDT\r
+\r
+  if (Function != NULL) {\r
+    Function (Context);\r
+  }\r
 }\r
 \r