1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-09 16:29:09 +00:00

Add initializer bit in debug syms

git-svn-id: svn://svn.cc65.org/cc65/trunk@407 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2000-10-30 19:33:04 +00:00
parent 9977ddd973
commit c4778045f9

View File

@ -1146,20 +1146,30 @@ void WriteDbgSyms (void)
/* Check if the symbol is const */ /* Check if the symbol is const */
ExprMask = (SymIsConst (S))? EXP_CONST : EXP_EXPR; ExprMask = (SymIsConst (S))? EXP_CONST : EXP_EXPR;
/* Write the type */ /* Add zeropage/abs bits */
if (S->Flags & SF_ZP) { ExprMask |= (S->Flags & SF_ZP)? EXP_ZP : EXP_ABS;
ObjWrite8 (EXP_ZP | ExprMask);
} else { /* Add the initializer bits */
ObjWrite8 (EXP_ABS | ExprMask); if (S->Flags & SF_INITIALIZER) {
ExprMask |= EXP_INITIALIZER;
} }
/* Write the type */
ObjWrite8 (ExprMask);
/* Write the name */
ObjWriteStr (S->Name); ObjWriteStr (S->Name);
if (ExprMask == EXP_CONST) {
/* Write the value */
if ((ExprMask & EXP_MASK_VAL) == EXP_CONST) {
/* Constant value */ /* Constant value */
ObjWrite32 (S->V.Val); ObjWrite32 (S->V.Val);
} else { } else {
/* Expression involved */ /* Expression involved */
WriteExpr (S->V.Expr); WriteExpr (S->V.Expr);
} }
/* Write the source file position */
ObjWritePos (&S->Pos); ObjWritePos (&S->Pos);
} }
S = S->List; S = S->List;