summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c')
-rw-r--r--ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c47
1 files changed, 22 insertions, 25 deletions
diff --git a/ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c b/ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c
index 80e531921c..6539c01763 100644
--- a/ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c
+++ b/ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c
@@ -39,18 +39,18 @@ WriteStringToFile (
// This gets you all the symbols except for SEC. To get SEC symbols you need to copy the
// debug print in the SEC into the debugger manually
SemihostWriteString (Buffer);
-/*
- I'm currently having issues with this code crashing the debugger. Seems like it should work.
- UINT32 SemihostHandle;
- UINT32 SemihostMode = SEMIHOST_FILE_MODE_WRITE | SEMIHOST_FILE_MODE_BINARY | SEMIHOST_FILE_MODE_UPDATE;
+ /*
+ I'm currently having issues with this code crashing the debugger. Seems like it should work.
- SemihostFileOpen ("c:\rvi_symbols.inc", SemihostMode, &SemihostHandle);
- SemihostFileWrite (SemihostHandle, &Length, Buffer);
- SemihostFileClose (SemihostHandle);
- */
-}
+ UINT32 SemihostHandle;
+ UINT32 SemihostMode = SEMIHOST_FILE_MODE_WRITE | SEMIHOST_FILE_MODE_BINARY | SEMIHOST_FILE_MODE_UPDATE;
+ SemihostFileOpen ("c:\rvi_symbols.inc", SemihostMode, &SemihostHandle);
+ SemihostFileWrite (SemihostHandle, &Length, Buffer);
+ SemihostFileClose (SemihostHandle);
+ */
+}
/**
If the build is done on cygwin the paths are cygpaths.
@@ -62,12 +62,12 @@ WriteStringToFile (
**/
CHAR8 *
DeCygwinPathIfNeeded (
- IN CHAR8 *Name
+ IN CHAR8 *Name
)
{
- CHAR8 *Ptr;
- UINTN Index;
- UINTN Len;
+ CHAR8 *Ptr;
+ UINTN Index;
+ UINTN Len;
Ptr = AsciiStrStr (Name, "/cygdrive/");
if (Ptr == NULL) {
@@ -88,14 +88,13 @@ DeCygwinPathIfNeeded (
// switch path separators
for (Index = 11; Index < Len; Index++) {
if (Ptr[Index] == '/') {
- Ptr[Index] = '\\' ;
+ Ptr[Index] = '\\';
}
}
return Name;
}
-
/**
Performs additional actions after a PE/COFF image has been loaded and relocated.
@@ -111,20 +110,18 @@ PeCoffLoaderRelocateImageExtraAction (
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
)
{
- CHAR8 Buffer[256];
+ CHAR8 Buffer[256];
-#if (__ARMCC_VERSION < 500000)
- AsciiSPrint (Buffer, sizeof(Buffer), "load /a /ni /np \"%a\" &0x%08x\n", ImageContext->PdbPointer, (UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders));
-#else
- AsciiSPrint (Buffer, sizeof(Buffer), "add-symbol-file %a 0x%08x\n", ImageContext->PdbPointer, (UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders));
-#endif
+ #if (__ARMCC_VERSION < 500000)
+ AsciiSPrint (Buffer, sizeof (Buffer), "load /a /ni /np \"%a\" &0x%08x\n", ImageContext->PdbPointer, (UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders));
+ #else
+ AsciiSPrint (Buffer, sizeof (Buffer), "add-symbol-file %a 0x%08x\n", ImageContext->PdbPointer, (UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders));
+ #endif
DeCygwinPathIfNeeded (&Buffer[16]);
WriteStringToFile (Buffer, AsciiStrSize (Buffer));
}
-
-
/**
Performs additional actions just before a PE/COFF image is unloaded. Any resources
that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.
@@ -141,9 +138,9 @@ PeCoffLoaderUnloadImageExtraAction (
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
)
{
- CHAR8 Buffer[256];
+ CHAR8 Buffer[256];
- AsciiSPrint (Buffer, sizeof(Buffer), "unload symbols_only \"%a\"\n", ImageContext->PdbPointer);
+ AsciiSPrint (Buffer, sizeof (Buffer), "unload symbols_only \"%a\"\n", ImageContext->PdbPointer);
DeCygwinPathIfNeeded (Buffer);
WriteStringToFile (Buffer, AsciiStrSize (Buffer));