mirror of
https://github.com/cc65/cc65.git
synced 2024-07-05 21:29:03 +00:00
Added more debug output.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5041 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
8cb4788e13
commit
c17816fafd
@ -172,6 +172,7 @@ Section* NewSection (Segment* Seg, unsigned char Align, unsigned char AddrSize)
|
|||||||
/* Initialize the data */
|
/* Initialize the data */
|
||||||
S->Next = 0;
|
S->Next = 0;
|
||||||
S->Seg = Seg;
|
S->Seg = Seg;
|
||||||
|
S->Obj = 0;
|
||||||
S->FragRoot = 0;
|
S->FragRoot = 0;
|
||||||
S->FragLast = 0;
|
S->FragLast = 0;
|
||||||
S->Size = 0;
|
S->Size = 0;
|
||||||
@ -231,6 +232,9 @@ Section* ReadSection (FILE* F, ObjData* O)
|
|||||||
/* Allocate the section we will return later */
|
/* Allocate the section we will return later */
|
||||||
Sec = NewSection (S, Align, Type);
|
Sec = NewSection (S, Align, Type);
|
||||||
|
|
||||||
|
/* Remember the object file this section was from */
|
||||||
|
Sec->Obj = O;
|
||||||
|
|
||||||
/* Set up the minimum segment alignment */
|
/* Set up the minimum segment alignment */
|
||||||
if (Sec->Align > S->Align) {
|
if (Sec->Align > S->Align) {
|
||||||
/* Section needs larger alignment, use this one */
|
/* Section needs larger alignment, use this one */
|
||||||
@ -467,7 +471,12 @@ void SegWrite (const char* TgtName, FILE* Tgt, Segment* S, SegWriteFunc F, void*
|
|||||||
while (Sec) {
|
while (Sec) {
|
||||||
Fragment* Frag;
|
Fragment* Frag;
|
||||||
|
|
||||||
|
/* Output were this section is from */
|
||||||
|
Print (stdout, 2, " Section from \"%s\"\n", GetObjFileName (Sec->Obj));
|
||||||
|
|
||||||
/* If we have fill bytes, write them now */
|
/* If we have fill bytes, write them now */
|
||||||
|
Print (stdout, 2, " Filling 0x%x bytes with 0x%02x\n",
|
||||||
|
Sec->Fill, S->FillVal);
|
||||||
WriteMult (Tgt, S->FillVal, Sec->Fill);
|
WriteMult (Tgt, S->FillVal, Sec->Fill);
|
||||||
Offs += Sec->Fill;
|
Offs += Sec->Fill;
|
||||||
|
|
||||||
@ -480,14 +489,14 @@ void SegWrite (const char* TgtName, FILE* Tgt, Segment* S, SegWriteFunc F, void*
|
|||||||
|
|
||||||
|
|
||||||
/* Output fragment data */
|
/* Output fragment data */
|
||||||
switch (Frag->Type) {
|
switch (Frag->Type) {
|
||||||
|
|
||||||
case FRAG_LITERAL:
|
case FRAG_LITERAL:
|
||||||
WriteData (Tgt, Frag->LitBuf, Frag->Size);
|
WriteData (Tgt, Frag->LitBuf, Frag->Size);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FRAG_EXPR:
|
case FRAG_EXPR:
|
||||||
case FRAG_SEXPR:
|
case FRAG_SEXPR:
|
||||||
Sign = (Frag->Type == FRAG_SEXPR);
|
Sign = (Frag->Type == FRAG_SEXPR);
|
||||||
/* Call the users function and evaluate the result */
|
/* Call the users function and evaluate the result */
|
||||||
switch (F (Frag->Expr, Sign, Frag->Size, Offs, Data)) {
|
switch (F (Frag->Expr, Sign, Frag->Size, Offs, Data)) {
|
||||||
@ -527,6 +536,8 @@ void SegWrite (const char* TgtName, FILE* Tgt, Segment* S, SegWriteFunc F, void*
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Update the offset */
|
/* Update the offset */
|
||||||
|
Print (stdout, 2, " Fragment with 0x%x bytes\n",
|
||||||
|
Frag->Size);
|
||||||
Offs += Frag->Size;
|
Offs += Frag->Size;
|
||||||
|
|
||||||
/* Next fragment */
|
/* Next fragment */
|
||||||
|
@ -70,7 +70,7 @@ struct Segment {
|
|||||||
unsigned char AddrSize; /* Address size of segment */
|
unsigned char AddrSize; /* Address size of segment */
|
||||||
unsigned char ReadOnly; /* True for readonly segments (config) */
|
unsigned char ReadOnly; /* True for readonly segments (config) */
|
||||||
unsigned char Relocatable; /* True if the segment is relocatable */
|
unsigned char Relocatable; /* True if the segment is relocatable */
|
||||||
unsigned char Placed; /* Did we place this segment already? */
|
unsigned char Placed; /* Did we place this segment already? */
|
||||||
unsigned char Dumped; /* Did we dump this segment? */
|
unsigned char Dumped; /* Did we dump this segment? */
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -81,6 +81,7 @@ typedef struct Section Section;
|
|||||||
struct Section {
|
struct Section {
|
||||||
Section* Next; /* List of sections in a segment */
|
Section* Next; /* List of sections in a segment */
|
||||||
Segment* Seg; /* Segment that contains the section */
|
Segment* Seg; /* Segment that contains the section */
|
||||||
|
struct ObjData* Obj; /* Object file this section comes from */
|
||||||
struct Fragment* FragRoot; /* Fragment list */
|
struct Fragment* FragRoot; /* Fragment list */
|
||||||
struct Fragment* FragLast; /* Pointer to last fragment */
|
struct Fragment* FragLast; /* Pointer to last fragment */
|
||||||
unsigned long Offs; /* Offset into the segment */
|
unsigned long Offs; /* Offset into the segment */
|
||||||
|
Loading…
Reference in New Issue
Block a user