Sync basetools' source and binary files with r1707 of the basetools project.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9257 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff
2009-09-11 03:14:43 +00:00
parent f22911b49e
commit fd171542e0
91 changed files with 1794 additions and 974 deletions

View File

@ -856,6 +856,7 @@ Returns:
PeHdr = NULL;
TeHdr = NULL;
OptionHeader.Header = NULL;
//
// Assume success
//
@ -1252,11 +1253,11 @@ PeCoffLoaderGetPdbPointer (
//
// Get the DebugEntry offset in the raw data image.
//
SectionHeader = (EFI_IMAGE_SECTION_HEADER *) (Hdr.Te + 1);
Index = Hdr.Te->NumberOfSections;
SectionHeader = (EFI_IMAGE_SECTION_HEADER *) (Hdr.Te + 1);
Index = Hdr.Te->NumberOfSections;
for (Index1 = 0; Index1 < Index; Index1 ++) {
if ((DirectoryEntry->VirtualAddress >= SectionHeader[Index1].VirtualAddress) &&
(DirectoryEntry->VirtualAddress < (SectionHeader[Index1].VirtualAddress + SectionHeader[Index1].Misc.VirtualSize))) {
if ((DirectoryEntry->VirtualAddress >= SectionHeader[Index1].VirtualAddress) &&
(DirectoryEntry->VirtualAddress < (SectionHeader[Index1].VirtualAddress + SectionHeader[Index1].Misc.VirtualSize))) {
DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *)((UINTN) Hdr.Te +
DirectoryEntry->VirtualAddress -
SectionHeader [Index1].VirtualAddress +
@ -1324,8 +1325,8 @@ PeCoffLoaderGetPdbPointer (
// Get the DebugEntry offset in the raw data image.
//
for (Index1 = 0; Index1 < Index; Index1 ++) {
if ((DirectoryEntry->VirtualAddress >= SectionHeader[Index1].VirtualAddress) &&
(DirectoryEntry->VirtualAddress < (SectionHeader[Index1].VirtualAddress + SectionHeader[Index1].Misc.VirtualSize))) {
if ((DirectoryEntry->VirtualAddress >= SectionHeader[Index1].VirtualAddress) &&
(DirectoryEntry->VirtualAddress < (SectionHeader[Index1].VirtualAddress + SectionHeader[Index1].Misc.VirtualSize))) {
DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) (
(UINTN) Pe32Data +
DirectoryEntry->VirtualAddress -
@ -1349,27 +1350,28 @@ PeCoffLoaderGetPdbPointer (
for (DirCount = 0; DirCount < DirectoryEntry->Size; DirCount += sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY), DebugEntry++) {
if (EFI_IMAGE_DEBUG_TYPE_CODEVIEW == DebugEntry->Type) {
if (DebugEntry->SizeOfData > 0) {
//
// Get the DebugEntry offset in the raw data image.
//
for (Index1 = 0; Index1 < Index; Index1 ++) {
if ((DebugEntry->RVA >= SectionHeader[Index1].VirtualAddress) &&
(DebugEntry->RVA < (SectionHeader[Index1].VirtualAddress + SectionHeader[Index1].Misc.VirtualSize))) {
CodeViewEntryPointer = (VOID *) (
((UINTN)Pe32Data) +
(UINTN) DebugEntry->RVA -
SectionHeader[Index1].VirtualAddress +
SectionHeader[Index1].PointerToRawData +
(UINTN)TEImageAdjust);
break;
}
}
if (Index1 >= Index) {
//
// Can't find CodeViewEntryPointer in raw PE/COFF image.
//
continue;
}
//
// Get the DebugEntry offset in the raw data image.
//
CodeViewEntryPointer = NULL;
for (Index1 = 0; Index1 < Index; Index1 ++) {
if ((DebugEntry->RVA >= SectionHeader[Index1].VirtualAddress) &&
(DebugEntry->RVA < (SectionHeader[Index1].VirtualAddress + SectionHeader[Index1].Misc.VirtualSize))) {
CodeViewEntryPointer = (VOID *) (
((UINTN)Pe32Data) +
(UINTN) DebugEntry->RVA -
SectionHeader[Index1].VirtualAddress +
SectionHeader[Index1].PointerToRawData +
(UINTN)TEImageAdjust);
break;
}
}
if (Index1 >= Index) {
//
// Can't find CodeViewEntryPointer in raw PE/COFF image.
//
continue;
}
switch (* (UINT32 *) CodeViewEntryPointer) {
case CODEVIEW_SIGNATURE_NB10:
return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY));

View File

@ -472,7 +472,7 @@ Returns:
printf (
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x\n",
Guid->Data1,
(unsigned) Guid->Data1,
Guid->Data2,
Guid->Data3,
Guid->Data4[0],
@ -529,7 +529,7 @@ Returns:
sprintf (
(CHAR8 *)Buffer,
"%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X",
Guid->Data1,
(unsigned) Guid->Data1,
Guid->Data2,
Guid->Data3,
Guid->Data4[0],
@ -545,7 +545,7 @@ Returns:
sprintf (
(CHAR8 *)Buffer,
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
Guid->Data1,
(unsigned) Guid->Data1,
Guid->Data2,
Guid->Data3,
Guid->Data4[0],

View File

@ -34,7 +34,7 @@ Abstract:
//
STATIC STATUS mStatus = STATUS_SUCCESS;
STATIC CHAR8 mUtilityName[50] = { 0 };
STATIC UINT32 mPrintLogLevel = INFO_LOG_LEVEL;
STATIC UINT64 mPrintLogLevel = INFO_LOG_LEVEL;
STATIC CHAR8 *mSourceFileName = NULL;
STATIC UINT32 mSourceFileLineNum = 0;
STATIC UINT32 mErrorCount = 0;
@ -355,7 +355,7 @@ VOID
DebugMsg (
CHAR8 *FileName,
UINT32 LineNumber,
UINT32 MsgLevel,
UINT64 MsgLevel,
CHAR8 *Text,
CHAR8 *MsgFmt,
...
@ -495,7 +495,7 @@ Notes:
if (Cptr != NULL) {
sprintf (Line, ": %s", Cptr);
if (LineNumber != 0) {
sprintf (Line2, "(%d)", LineNumber);
sprintf (Line2, "(%u)", (unsigned) LineNumber);
strcat (Line, Line2);
}
}
@ -509,7 +509,7 @@ Notes:
}
sprintf (Line, "%s", Cptr);
if (LineNumber != 0) {
sprintf (Line2, "(%d)", LineNumber);
sprintf (Line2, "(%u)", (unsigned) LineNumber);
strcat (Line, Line2);
}
} else {
@ -524,7 +524,7 @@ Notes:
// message for you. It has to be decimal digits too.
//
if (MessageCode != 0) {
sprintf (Line2, ": %s %04d", Type, MessageCode);
sprintf (Line2, ": %s %04u", Type, (unsigned) MessageCode);
} else {
sprintf (Line2, ": %s", Type);
}
@ -665,7 +665,7 @@ Returns:
VOID
SetPrintLevel (
UINT32 LogLevel
UINT64 LogLevel
)
/*++
@ -843,7 +843,7 @@ TestUtilityMessages (
)
{
CHAR8 *ArgStr = "ArgString";
INTN ArgInt;
int ArgInt;
ArgInt = 0x12345678;
//

View File

@ -96,7 +96,7 @@ VOID
DebugMsg (
CHAR8 *FileName,
UINT32 LineNumber,
UINT32 MsgLevel,
UINT64 MsgLevel,
CHAR8 *OffendingText,
CHAR8 *MsgFmt,
...
@ -123,7 +123,7 @@ KeyMsg (
VOID
SetPrintLevel (
UINT32 LogLevel
UINT64 LogLevel
);
VOID

View File

@ -86,7 +86,7 @@ MyCheck (
"Invalid parameter(s).\n",
Final,
File,
(UINT32)Line
(unsigned)Line
);
exit (1);
@ -98,7 +98,7 @@ MyCheck (
"Invalid parameter.\n",
Final,
File,
(UINT32)Line
(unsigned)Line
);
exit (1);
@ -121,12 +121,12 @@ MyCheck (
"\nFile=%s, Line=%u, nSize=%u, Head=%xh, Tail=%xh\n",
Final,
File,
(UINT32)Line,
(unsigned)Line,
Tmp->File,
(UINT32)Tmp->Line,
(UINT32)Tmp->Size,
*(UINT32 *) (Tmp->Buffer),
*(UINT32 *) (&Tmp->Buffer[Tmp->Size + sizeof (UINT32)])
(unsigned) Tmp->Line,
(unsigned) Tmp->Size,
(unsigned) *(UINT32 *) (Tmp->Buffer),
(unsigned) *(UINT32 *) (&Tmp->Buffer[Tmp->Size + sizeof (UINT32)])
);
exit (1);
@ -141,17 +141,17 @@ MyCheck (
"\nSome allocated items have not been freed.\n",
Final,
File,
(UINT32)Line
(unsigned)Line
);
for (Tmp = MyAllocData; Tmp != NULL; Tmp = Tmp->Next) {
printf (
"File=%s, Line=%u, nSize=%u, Head=%xh, Tail=%xh\n",
Tmp->File,
(UINT32)Tmp->Line,
(UINT32)Tmp->Size,
*(UINT32 *) (Tmp->Buffer),
*(UINT32 *) (&Tmp->Buffer[Tmp->Size + sizeof (UINT32)])
(unsigned) Tmp->Line,
(unsigned) Tmp->Size,
(unsigned) *(UINT32 *) (Tmp->Buffer),
(unsigned) *(UINT32 *) (&Tmp->Buffer[Tmp->Size + sizeof (UINT32)])
);
}
}
@ -201,9 +201,9 @@ MyAlloc (
printf (
"\nMyAlloc(Size=%u, File=%s, Line=%u)"
"\nInvalid parameter(s).\n",
(UINT32)Size,
(unsigned)Size,
File,
(UINT32)Line
(unsigned)Line
);
exit (1);
@ -214,9 +214,9 @@ MyAlloc (
printf (
"\nMyAlloc(Size=%u, File=%s, Line=%u)"
"\nInvalid parameter.\n",
(UINT32)Size,
(unsigned)Size,
File,
(UINT32)Line
(unsigned)Line
);
exit (1);
@ -238,9 +238,9 @@ MyAlloc (
printf (
"\nMyAlloc(Size=%u, File=%s, Line=%u)"
"\nOut of memory.\n",
(UINT32)Size,
(unsigned)Size,
File,
(UINT32)Line
(unsigned)Line
);
exit (1);
@ -315,9 +315,9 @@ MyRealloc (
"\nMyRealloc(Ptr=%p, Size=%u, File=%s, Line=%u)"
"\nInvalid parameter(s).\n",
Ptr,
(UINT32)Size,
(unsigned)Size,
File,
(UINT32)Line
(unsigned)Line
);
exit (1);
@ -328,9 +328,9 @@ MyRealloc (
"\nMyRealloc(Ptr=%p, Size=%u, File=%s, Line=%u)"
"\nInvalid parameter.\n",
Ptr,
(UINT32)Size,
(unsigned)Size,
File,
(UINT32)Line
(unsigned)Line
);
exit (1);
@ -349,9 +349,9 @@ MyRealloc (
"\nMyRealloc(Ptr=%p, Size=%u, File=%s, Line=%u)"
"\nCould not find buffer.\n",
Ptr,
(UINT32)Size,
(unsigned)Size,
File,
(UINT32)Line
(unsigned)Line
);
exit (1);
@ -421,7 +421,7 @@ MyFree (
"\nInvalid parameter(s).\n",
Ptr,
File,
(UINT32)Line
(unsigned)Line
);
exit (1);
@ -433,7 +433,7 @@ MyFree (
"\nInvalid parameter.\n",
Ptr,
File,
(UINT32)Line
(unsigned)Line
);
exit (1);
@ -453,7 +453,7 @@ MyFree (
"\nCalled before memory allocated.\n",
Ptr,
File,
(UINT32)Line
(unsigned)Line
);
exit (1);
@ -486,7 +486,7 @@ MyFree (
"\nNot found.\n",
Ptr,
File,
(UINT32)Line
(unsigned)Line
);
exit (1);

View File

@ -122,6 +122,7 @@ Returns:
GUID_SEC_TOOL_ENTRY *NewGuidTool;
FirstGuidTool = NULL;
LastGuidTool = NULL;
while (TRUE) {
NextLine = ReadMemoryFileLine (InputFile);

View File

@ -379,10 +379,10 @@ Returns:
--*/
{
INT32 Index;
UINT32 Data1;
UINT32 Data2;
UINT32 Data3;
UINT16 Data4[8];
unsigned Data1;
unsigned Data2;
unsigned Data3;
unsigned Data4[8];
if (AsciiGuidBuffer == NULL || GuidBuffer == NULL) {
return EFI_INVALID_PARAMETER;
@ -416,7 +416,7 @@ Returns:
//
Index = sscanf (
AsciiGuidBuffer,
"%08x-%04x-%04x-%02hx%02hx-%02hx%02hx%02hx%02hx%02hx%02hx",
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
&Data1,
&Data2,
&Data3,

View File

@ -536,7 +536,7 @@ Returns:
--*/
{
UINT32 Val;
unsigned Val;
SkipWhiteSpace (&mGlobals.SourceFile);
if (EndOfFile (&mGlobals.SourceFile)) {
@ -554,7 +554,7 @@ Returns:
mGlobals.SourceFile.FileBufferPtr += 2;
sscanf (mGlobals.SourceFile.FileBufferPtr, "%x", &Val);
*Value = Val;
*Value = (UINT32) Val;
while (isxdigit (mGlobals.SourceFile.FileBufferPtr[0])) {
mGlobals.SourceFile.FileBufferPtr++;
}
@ -634,7 +634,7 @@ Returns:
// depth.
//
if (mGlobals.VerboseFile) {
fprintf (stdout, "%*cProcessing file '%s'\n", (INT32)NestDepth * 2, ' ', SourceFile->FileName);
fprintf (stdout, "%*cProcessing file '%s'\n", (int)NestDepth * 2, ' ', SourceFile->FileName);
fprintf (stdout, "Parent source file = '%s'\n", ParentSourceFile->FileName);
}
@ -642,7 +642,7 @@ Returns:
// Make sure we didn't exceed our maximum nesting depth
//
if (NestDepth > MAX_NEST_DEPTH) {
Error (NULL, 0, 3001, "Not Supported", "%s exceeeds max nesting depth (%d)", SourceFile->FileName, NestDepth);
Error (NULL, 0, 3001, "Not Supported", "%s exceeeds max nesting depth (%u)", SourceFile->FileName, (unsigned) NestDepth);
Status = STATUS_ERROR;
goto Finish;
}
@ -698,7 +698,7 @@ Returns:
fseek (SourceFile->Fptr, 0, SEEK_END);
SourceFile->FileSize = ftell (SourceFile->Fptr);
if (mGlobals.VerboseFile) {
printf ("FileSize = %d (0x%X)\n", (INT32)SourceFile->FileSize, (UINT32)SourceFile->FileSize);
printf ("FileSize = %u (0x%X)\n", (unsigned) SourceFile->FileSize, (unsigned) SourceFile->FileSize);
}
fseek (SourceFile->Fptr, 0, SEEK_SET);
@ -819,7 +819,7 @@ Returns:
}
printf ("'\n");
printf ("FileSize = %d (0x%X)\n", (INT32)SourceFile->FileSize, (UINT32)SourceFile->FileSize);
printf ("FileSize = %u (0x%X)\n", (unsigned)SourceFile->FileSize, (unsigned)SourceFile->FileSize);
RewindFile (SourceFile);
}
}
@ -1282,7 +1282,7 @@ Returns:
--*/
{
UINT32 Value32;
unsigned Value32;
UINT32 Index;
FILE_POSITION FPos;
CHAR8 TempString[20];