Adapt to changed object file format.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4930 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* (C) 2002-2010, Ullrich von Bassewitz */
|
/* (C) 2002-2011, Ullrich von Bassewitz */
|
||||||
/* Roemerstrasse 52 */
|
/* Roemerstrasse 52 */
|
||||||
/* D-70794 Filderstadt */
|
/* D-70794 Filderstadt */
|
||||||
/* EMail: uz@cc65.org */
|
/* EMail: uz@cc65.org */
|
||||||
@@ -111,7 +111,7 @@ static char* TimeToStr (unsigned long Time)
|
|||||||
/* Remove the trailing newline */
|
/* Remove the trailing newline */
|
||||||
unsigned Len = strlen (S);
|
unsigned Len = strlen (S);
|
||||||
if (Len > 0 && S[Len-1] == '\n') {
|
if (Len > 0 && S[Len-1] == '\n') {
|
||||||
S[Len-1 ] = '\0';
|
S[Len-1 ] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the time string */
|
/* Return the time string */
|
||||||
@@ -120,6 +120,20 @@ static char* TimeToStr (unsigned long Time)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void SkipLineInfoList (FILE* F)
|
||||||
|
/* Skip a line info list from the given file */
|
||||||
|
{
|
||||||
|
/* Count preceeds the list */
|
||||||
|
unsigned long Count = ReadVar (F);
|
||||||
|
|
||||||
|
/* Skip indices */
|
||||||
|
while (Count--) {
|
||||||
|
(void) ReadVar (F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void SkipExpr (FILE* F)
|
static void SkipExpr (FILE* F)
|
||||||
/* Skip an expression from the given file */
|
/* Skip an expression from the given file */
|
||||||
{
|
{
|
||||||
@@ -145,7 +159,7 @@ static void SkipExpr (FILE* F)
|
|||||||
case EXPR_SECTION:
|
case EXPR_SECTION:
|
||||||
/* Read the segment number */
|
/* Read the segment number */
|
||||||
(void) Read8 (F);
|
(void) Read8 (F);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Error ("Invalid expression op: %02X", Op);
|
Error ("Invalid expression op: %02X", Op);
|
||||||
@@ -388,7 +402,7 @@ void DumpObjFiles (FILE* F, unsigned long Offset)
|
|||||||
/* Read the data for one file */
|
/* Read the data for one file */
|
||||||
const char* Name = GetString (&StrPool, ReadVar (F));
|
const char* Name = GetString (&StrPool, ReadVar (F));
|
||||||
unsigned long MTime = Read32 (F);
|
unsigned long MTime = Read32 (F);
|
||||||
unsigned long Size = Read32 (F);
|
unsigned long Size = ReadVar (F);
|
||||||
unsigned Len = strlen (Name);
|
unsigned Len = strlen (Name);
|
||||||
|
|
||||||
/* Print the header */
|
/* Print the header */
|
||||||
@@ -473,7 +487,6 @@ void DumpObjImports (FILE* F, unsigned long Offset)
|
|||||||
Collection StrPool = AUTO_COLLECTION_INITIALIZER;
|
Collection StrPool = AUTO_COLLECTION_INITIALIZER;
|
||||||
unsigned Count;
|
unsigned Count;
|
||||||
unsigned I;
|
unsigned I;
|
||||||
FilePos Pos;
|
|
||||||
|
|
||||||
/* Seek to the header position and read the header */
|
/* Seek to the header position and read the header */
|
||||||
FileSetPos (F, Offset);
|
FileSetPos (F, Offset);
|
||||||
@@ -500,7 +513,9 @@ void DumpObjImports (FILE* F, unsigned long Offset)
|
|||||||
unsigned char AddrSize = Read8 (F);
|
unsigned char AddrSize = Read8 (F);
|
||||||
const char* Name = GetString (&StrPool, ReadVar (F));
|
const char* Name = GetString (&StrPool, ReadVar (F));
|
||||||
unsigned Len = strlen (Name);
|
unsigned Len = strlen (Name);
|
||||||
ReadFilePos (F, &Pos);
|
|
||||||
|
/* Skip the line infos */
|
||||||
|
SkipLineInfoList (F);
|
||||||
|
|
||||||
/* Print the header */
|
/* Print the header */
|
||||||
printf (" Index:%27u\n", I);
|
printf (" Index:%27u\n", I);
|
||||||
@@ -524,7 +539,6 @@ void DumpObjExports (FILE* F, unsigned long Offset)
|
|||||||
Collection StrPool = AUTO_COLLECTION_INITIALIZER;
|
Collection StrPool = AUTO_COLLECTION_INITIALIZER;
|
||||||
unsigned Count;
|
unsigned Count;
|
||||||
unsigned I;
|
unsigned I;
|
||||||
FilePos Pos;
|
|
||||||
|
|
||||||
/* Seek to the header position and read the header */
|
/* Seek to the header position and read the header */
|
||||||
FileSetPos (F, Offset);
|
FileSetPos (F, Offset);
|
||||||
@@ -567,7 +581,9 @@ void DumpObjExports (FILE* F, unsigned long Offset)
|
|||||||
Value = Read32 (F);
|
Value = Read32 (F);
|
||||||
HaveValue = 1;
|
HaveValue = 1;
|
||||||
}
|
}
|
||||||
ReadFilePos (F, &Pos);
|
|
||||||
|
/* Skip the line infos */
|
||||||
|
SkipLineInfoList (F);
|
||||||
|
|
||||||
/* Print the header */
|
/* Print the header */
|
||||||
printf (" Index:%27u\n", I);
|
printf (" Index:%27u\n", I);
|
||||||
@@ -595,7 +611,6 @@ void DumpObjDbgSyms (FILE* F, unsigned long Offset)
|
|||||||
Collection StrPool = AUTO_COLLECTION_INITIALIZER;
|
Collection StrPool = AUTO_COLLECTION_INITIALIZER;
|
||||||
unsigned Count;
|
unsigned Count;
|
||||||
unsigned I;
|
unsigned I;
|
||||||
FilePos Pos;
|
|
||||||
|
|
||||||
/* Seek to the header position and read the header */
|
/* Seek to the header position and read the header */
|
||||||
FileSetPos (F, Offset);
|
FileSetPos (F, Offset);
|
||||||
@@ -640,7 +655,9 @@ void DumpObjDbgSyms (FILE* F, unsigned long Offset)
|
|||||||
Value = Read32 (F);
|
Value = Read32 (F);
|
||||||
HaveValue = 1;
|
HaveValue = 1;
|
||||||
}
|
}
|
||||||
ReadFilePos (F, &Pos);
|
|
||||||
|
/* Skip the line infos */
|
||||||
|
SkipLineInfoList (F);
|
||||||
|
|
||||||
/* Print the header */
|
/* Print the header */
|
||||||
printf (" Index:%27u\n", I);
|
printf (" Index:%27u\n", I);
|
||||||
@@ -697,9 +714,8 @@ void DumpObjLineInfo (FILE* F, unsigned long Offset)
|
|||||||
/* Read and print all line infos */
|
/* Read and print all line infos */
|
||||||
for (I = 0; I < Count; ++I) {
|
for (I = 0; I < Count; ++I) {
|
||||||
|
|
||||||
FilePos Pos;
|
|
||||||
|
|
||||||
/* Read one line info */
|
/* Read one line info */
|
||||||
|
FilePos Pos;
|
||||||
ReadFilePos (F, &Pos);
|
ReadFilePos (F, &Pos);
|
||||||
|
|
||||||
/* Print the header */
|
/* Print the header */
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* (C) 2000-2009, Ullrich von Bassewitz */
|
/* (C) 2000-2011, Ullrich von Bassewitz */
|
||||||
/* Roemerstrasse 52 */
|
/* Roemerstrasse 52 */
|
||||||
/* D-70794 Filderstadt */
|
/* D-70794 Filderstadt */
|
||||||
/* EMail: uz@cc65.org */
|
/* EMail: uz@cc65.org */
|
||||||
@@ -201,7 +201,7 @@ static void OptVersion (const char* Opt attribute ((unused)),
|
|||||||
/* Print the assembler version */
|
/* Print the assembler version */
|
||||||
{
|
{
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
"%s V%s - (C) Copyright 2000-2009, Ullrich von Bassewitz\n",
|
"%s V%s - (C) Copyright 2000-2011, Ullrich von Bassewitz\n",
|
||||||
ProgName, GetVersionAsString ());
|
ProgName, GetVersionAsString ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user