]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/GdbStub/GdbStub.c
ARM Packages: Fixed coding style and typos
[mirror_edk2.git] / EmbeddedPkg / GdbStub / GdbStub.c
index 8a13cc8a193d11894a84fce610fc4ee32c150fb4..9136c14b2bda0e23a74585efb1c9ae99f87418f4 100644 (file)
@@ -75,7 +75,6 @@ GdbStubEntry (
   IN EFI_HANDLE        ImageHandle,\r
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
-\r
 {\r
   EFI_STATUS                  Status;  \r
   EFI_DEBUG_SUPPORT_PROTOCOL  *DebugSupport;\r
@@ -84,8 +83,7 @@ GdbStubEntry (
   UINTN                       Index;\r
   UINTN                       Processor;\r
   BOOLEAN                     IsaSupported;\r
\r
-   \r
+\r
   Status = EfiGetSystemConfigurationTable (&gEfiDebugImageInfoTableGuid, (VOID **)&gDebugImageTableHeader);\r
   if (EFI_ERROR (Status)) {\r
     gDebugImageTableHeader = NULL;\r
@@ -136,10 +134,9 @@ GdbStubEntry (
   DEBUG ((EFI_D_INFO, "Debug Support Protocol Processor Index %d\n", gMaxProcessorIndex));\r
   \r
   // Call processor-specific init routine\r
-  InitializeProcessor();\r
+  InitializeProcessor ();\r
 \r
   for (Processor = 0; Processor <= gMaxProcessorIndex; Processor++) {\r
-    \r
     for (Index = 0; Index < MaxEfiException (); Index++) {\r
       Status = DebugSupport->RegisterExceptionCallback (DebugSupport, Processor,  GdbExceptionHandler, gExceptionType[Index].Exception);\r
       ASSERT_EFI_ERROR (Status);\r
@@ -165,7 +162,7 @@ GdbStubEntry (
   ASSERT_EFI_ERROR (Status);\r
 \r
   //\r
-  // Register for protocol notifactions on this event\r
+  // Register for protocol notifications on this event\r
   //\r
   Status = gBS->RegisterProtocolNotify (\r
                   &gEfiLoadedImageProtocolGuid,\r
@@ -182,8 +179,6 @@ GdbStubEntry (
   return EFI_SUCCESS;\r
 }\r
 \r
-\r
-\r
 /**\r
  Transfer length bytes of input buffer, starting at Address, to memory.\r
 \r
@@ -485,12 +480,11 @@ EFIAPI
 SendNotSupported (\r
   VOID          \r
   )             \r
-{       \r
+{\r
   SendPacket ("");\r
 }\r
 \r
 \r
-\r
 /**\r
  Send the T signal with the given exception type (in gdb order) and possibly with n:r pairs related to the watchpoints\r
  \r
@@ -596,11 +590,11 @@ ConvertEFItoGDBtype (
   IN  EFI_EXCEPTION_TYPE      EFIExceptionType\r
   )\r
 { \r
-  UINTN i;\r
+  UINTN Index;\r
   \r
-  for (i=0; i < MaxEfiException() ; i++) {\r
-    if (gExceptionType[i].Exception == EFIExceptionType) {\r
-      return gExceptionType[i].SignalNo;\r
+  for (Index = 0; Index < MaxEfiException () ; Index++) {\r
+    if (gExceptionType[Index].Exception == EFIExceptionType) {\r
+      return gExceptionType[Index].SignalNo;\r
     }\r
   }\r
   return GDB_SIGTRAP; // this is a GDB trap\r
@@ -635,14 +629,14 @@ ReadFromMemory (
   InBufPtr++; // this skips ',' in the buffer\r
   \r
   /* Error checking */\r
-  if (AsciiStrLen(AddressBuffer) >= MAX_ADDR_SIZE) {\r
+  if (AsciiStrLen (AddressBuffer) >= MAX_ADDR_SIZE) {\r
     Print((CHAR16 *)L"Address is too long\n");\r
     SendError (GDB_EBADMEMADDRBUFSIZE); \r
     return;\r
   }\r
   \r
   // 2 = 'm' + ','\r
-  if (AsciiStrLen(PacketData) - AsciiStrLen(AddressBuffer) - 2 >= MAX_LENGTH_SIZE) {\r
+  if (AsciiStrLen (PacketData) - AsciiStrLen (AddressBuffer) - 2 >= MAX_LENGTH_SIZE) {\r
     Print((CHAR16 *)L"Length is too long\n");\r
     SendError (GDB_EBADMEMLENGTH); \r
     return;\r
@@ -699,14 +693,14 @@ WriteToMemory (
   /* Error checking */\r
   \r
   //Check if Address is not too long.\r
-  if (AsciiStrLen(AddressBuffer) >= MAX_ADDR_SIZE) {\r
+  if (AsciiStrLen (AddressBuffer) >= MAX_ADDR_SIZE) {\r
     Print ((CHAR16 *)L"Address too long..\n");\r
     SendError (GDB_EBADMEMADDRBUFSIZE); \r
     return;\r
   }\r
   \r
   //Check if message length is not too long\r
-  if (AsciiStrLen(LengthBuffer) >= MAX_LENGTH_SIZE) {\r
+  if (AsciiStrLen (LengthBuffer) >= MAX_LENGTH_SIZE) {\r
     Print ((CHAR16 *)L"Length too long..\n");\r
     SendError (GDB_EBADMEMLENGBUFSIZE); \r
     return;\r
@@ -714,7 +708,7 @@ WriteToMemory (
   \r
   // Check if Message is not too long/short.\r
   // 3 = 'M' + ',' + ':'\r
-  MessageLength = (AsciiStrLen(PacketData) - AsciiStrLen(AddressBuffer) - AsciiStrLen(LengthBuffer) - 3);\r
+  MessageLength = (AsciiStrLen (PacketData) - AsciiStrLen (AddressBuffer) - AsciiStrLen (LengthBuffer) - 3);\r
   if (MessageLength != (2*Length)) {\r
     //Message too long/short. New data is not the right size.\r
     SendError (GDB_EBADMEMDATASIZE);   \r
@@ -770,7 +764,7 @@ ParseBreakpointPacket (
   *AddressBufferPtr = '\0';\r
 \r
   //Check if Address is not too long.\r
-  if (AsciiStrLen(AddressBuffer) >= MAX_ADDR_SIZE) {\r
+  if (AsciiStrLen (AddressBuffer) >= MAX_ADDR_SIZE) {\r
     Print ((CHAR16 *)L"Address too long..\n");\r
     return 40; //EMSGSIZE: Message size too long.\r
   }\r
@@ -801,7 +795,7 @@ gXferObjectReadResponse (
   CHAR8   Char;\r
   UINTN   Count;\r
 \r
-  // responce starts with 'm' or 'l' if it is the end\r
+  // Response starts with 'm' or 'l' if it is the end\r
   OutBufPtr = gOutBuffer;\r
   *OutBufPtr++ = Type;\r
   Count = 1;\r
@@ -989,12 +983,11 @@ PeCoffLoaderGetDebuggerInfo (
 }\r
 \r
 \r
-\r
 /** \r
   Process "qXfer:object:read:annex:offset,length" request.\r
   \r
   Returns an XML document that contains loaded libraries. In our case it is \r
-  infomration in the EFI Debug Inmage Table converted into an XML document.\r
+  information in the EFI Debug Image Table converted into an XML document.\r
   \r
   GDB will call with an arbitrary length (it can't know the real length and \r
   will reply with chunks of XML that are easy for us to deal with. Gdb will \r
@@ -1006,12 +999,12 @@ PeCoffLoaderGetDebuggerInfo (
     <library name="/a/l/f/f.dll"><segment address="0x30000000"/></library>\r
   </library-list>\r
   \r
-  Since we can not allocate memory in interupt context this module has \r
+  Since we can not allocate memory in interrupt context this module has\r
   assumptions about how it will get called:\r
   1) Length will generally be max remote packet size (big enough)\r
   2) First Offset of an XML document read needs to be 0\r
   3) This code will return back small chunks of the XML document on every read.\r
-     Each subseqent call will ask for the next availble part of the document.\r
+     Each subsequent call will ask for the next available part of the document.\r
      \r
   Note: The only variable size element in the XML is:\r
   "  <library name=\"%s\"><segment address=\"%p\"/></library>\n" and it is \r
@@ -1039,6 +1032,7 @@ QxferLibrary (
     \r
     // Force a retry from the beginning \r
     gPacketqXferLibraryOffset = 0;\r
+\r
     return;\r
   }\r
 \r
@@ -1117,7 +1111,7 @@ GdbExceptionHandler (
   CHAR8   *Ptr;\r
       \r
   \r
-  if (ValidateException(ExceptionType, SystemContext) == FALSE) {\r
+  if (ValidateException (ExceptionType, SystemContext) == FALSE) {\r
     return;\r
   }\r
 \r
@@ -1254,7 +1248,7 @@ GdbPeriodicCallBack (
   if (gCtrlCBreakFlag) {\r
     //\r
     // Update the context to force a single step trap when we exit the GDB\r
-    // stub. This will trasfer control to GdbExceptionHandler () and let\r
+    // stub. This will transfer control to GdbExceptionHandler () and let\r
     // us break into the program. We don't want to break into the GDB stub.\r
     //\r
     AddSingleStep (SystemContext);\r