]> git.sur5r.net Git - cc65/commitdiff
Add initializer bit in debug syms
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 30 Oct 2000 19:33:04 +0000 (19:33 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 30 Oct 2000 19:33:04 +0000 (19:33 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@407 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/ca65/symtab.c

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