1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-11 11:30:13 +00:00

More debugging output

git-svn-id: svn://svn.cc65.org/cc65/trunk@3084 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2004-06-04 14:36:36 +00:00
parent eb9d9ee0c5
commit b1d7f78bce
3 changed files with 60 additions and 16 deletions

View File

@ -6,7 +6,7 @@
/* */ /* */
/* */ /* */
/* */ /* */
/* (C) 2001-2003 Ullrich von Bassewitz */ /* (C) 2001-2004 Ullrich von Bassewitz */
/* Römerstrasse 52 */ /* Römerstrasse 52 */
/* D-70794 Filderstadt */ /* D-70794 Filderstadt */
/* EMail: uz@cc65.org */ /* EMail: uz@cc65.org */
@ -1269,6 +1269,35 @@ static char* RegInfoDesc (unsigned U, char* Buf)
static char* RegContentDesc (const RegContents* RC, char* Buf)
/* Return a string containing register contents */
{
char* B = Buf;
if (RegValIsUnknown (RC->RegA)) {
strcpy (B, "A:XX ");
} else {
sprintf (B, "A:%02X ", RC->RegA);
}
B += 5;
if (RegValIsUnknown (RC->RegX)) {
strcpy (B, "X:XX ");
} else {
sprintf (B, "X:%02X ", RC->RegX);
}
B += 5;
if (RegValIsUnknown (RC->RegY)) {
strcpy (B, "Y:XX");
} else {
sprintf (B, "Y:%02X", RC->RegY);
}
B += 4;
return Buf;
}
void CE_Output (const CodeEntry* E, FILE* F) void CE_Output (const CodeEntry* E, FILE* F)
/* Output the code entry to a file */ /* Output the code entry to a file */
{ {
@ -1357,16 +1386,25 @@ void CE_Output (const CodeEntry* E, FILE* F)
char Use [128]; char Use [128];
char Chg [128]; char Chg [128];
fprintf (F, fprintf (F,
"%*s; USE: %-12s CHG: %-12s SIZE: %u\n", "%*s; USE: %-12s CHG: %-12s SIZE: %u",
30-Chars, "", 30-Chars, "",
RegInfoDesc (E->Use, Use), RegInfoDesc (E->Use, Use),
RegInfoDesc (E->Chg, Chg), RegInfoDesc (E->Chg, Chg),
E->Size); E->Size);
} else {
if (E->RI) {
char RegIn[32];
char RegOut[32];
fprintf (F,
" In %s Out %s",
RegContentDesc (&E->RI->In, RegIn),
RegContentDesc (&E->RI->Out, RegOut));
}
}
/* Terminate the line */ /* Terminate the line */
fprintf (F, "\n"); fprintf (F, "\n");
} }
}

View File

@ -6,7 +6,7 @@
/* */ /* */
/* */ /* */
/* */ /* */
/* (C) 2001-2003 Ullrich von Bassewitz */ /* (C) 2001-2004 Ullrich von Bassewitz */
/* Römerstrasse 52 */ /* Römerstrasse 52 */
/* D-70794 Filderstadt */ /* D-70794 Filderstadt */
/* EMail: uz@cc65.org */ /* EMail: uz@cc65.org */
@ -1253,7 +1253,7 @@ void CS_OutputEpilogue (const CodeSeg* S, FILE* F)
void CS_Output (const CodeSeg* S, FILE* F) void CS_Output (CodeSeg* S, FILE* F)
/* Output the code segment data to a file */ /* Output the code segment data to a file */
{ {
unsigned I; unsigned I;
@ -1267,6 +1267,9 @@ void CS_Output (const CodeSeg* S, FILE* F)
return; return;
} }
/* Generate register info */
CS_GenRegInfo (S);
/* Output the segment directive */ /* Output the segment directive */
fprintf (F, ".segment\t\"%s\"\n\n", S->SegName); fprintf (F, ".segment\t\"%s\"\n\n", S->SegName);
@ -1314,6 +1317,9 @@ void CS_Output (const CodeSeg* S, FILE* F)
if (DebugInfo) { if (DebugInfo) {
fputs ("\t.dbg\tline\n", F); fputs ("\t.dbg\tline\n", F);
} }
/* Free register info */
CS_FreeRegInfo (S);
} }

View File

@ -6,7 +6,7 @@
/* */ /* */
/* */ /* */
/* */ /* */
/* (C) 2001-2003 Ullrich von Bassewitz */ /* (C) 2001-2004 Ullrich von Bassewitz */
/* Römerstrasse 52 */ /* Römerstrasse 52 */
/* D-70794 Filderstadt */ /* D-70794 Filderstadt */
/* EMail: uz@cc65.org */ /* EMail: uz@cc65.org */
@ -275,7 +275,7 @@ void CS_OutputEpilogue (const CodeSeg* S, FILE* F);
* assembler epilogue into the file. That is: Close the local function scope. * assembler epilogue into the file. That is: Close the local function scope.
*/ */
void CS_Output (const CodeSeg* S, FILE* F); void CS_Output (CodeSeg* S, FILE* F);
/* Output the code segment data to a file */ /* Output the code segment data to a file */
void CS_FreeRegInfo (CodeSeg* S); void CS_FreeRegInfo (CodeSeg* S);