* src/pic/gen.c,
authortecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 9 Mar 2007 12:30:51 +0000 (12:30 +0000)
committertecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 9 Mar 2007 12:30:51 +0000 (12:30 +0000)
* src/pic/glue.c,
* src/pic/ralloc.c: suppress undesired debug output
* src/SDCCmain.c (linkEdit): initialize c to quieten compiler

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4672 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCCmain.c
src/pic/gen.c
src/pic/glue.c
src/pic/ralloc.c

index 8734cc7e52c2e51ffb5176e986b9bf7f63a64dbb..b7ce06bf7bdf97d3422c1fead9950503891343e7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-03-09 Raphael Neider <rneider AT web.de>
+
+       * src/pic/gen.c,
+       * src/pic/glue.c,
+       * src/pic/ralloc.c: suppress undesired debug output
+       * src/SDCCmain.c (linkEdit): initialize c to quieten compiler
+
 2007-03-08 Frieder Ferlemann <Frieder.Ferlemann AT web.de>
 
        * device/lib/printf_large.c: 6 bytes less __data mem (6 more __idata)
index 62d11db7e94d450daaf18f63b635e5e2a2a77077..083ecb12557eee763c4e732e733b0800c4af6514 100644 (file)
@@ -1488,6 +1488,7 @@ linkEdit (char **envp)
   char linkerScriptFileName[PATH_MAX];
 
   linkerScriptFileName[0] = 0;
+  c = NULL;
 
   if(port->linker.needLinkerScript)
     {
index 429e44a284e4b19df5f888fa9c3cfe2a5d5dca77..cfbd202863db2b4e8998f631b2215d03c82d02f0 100644 (file)
@@ -3115,8 +3115,7 @@ registers :-) */
 #endif
                
                /* if debug then send end of function */
-               /*      if (options.debug && currFunc) { */
-               if (currFunc) {
+               if (options.debug && debugFile && currFunc) {
                        debugFile->writeEndFunction (currFunc, ic, 1);
                }
                
@@ -3151,7 +3150,7 @@ registers :-) */
                }
                
                /* if debug then send end of function */
-               if (currFunc) {
+               if (options.debug && debugFile && currFunc) {
                        debugFile->writeEndFunction (currFunc, ic, 1);
                }
                
@@ -10567,10 +10566,8 @@ void genpic14Code (iCode *lic)
        addpBlock(pb);
        
        /* if debug information required */
-       if (options.debug && currFunc) { 
-               if (currFunc) {
-                       debugFile->writeFunction (currFunc, lic);
-               }
+       if (options.debug && debugFile && currFunc) { 
+               debugFile->writeFunction (currFunc, lic);
        }
        
        
index a2403e96ac6b6bb7a494502db881c60de7b3cb00..51050ae07dd27508946cd1a39b1aaeac97e633e1 100644 (file)
@@ -72,6 +72,7 @@ extern void printChar (FILE * ofile, char *s, int plen);
 void  pCodeInitRegisters(void);
 int getConfigWord(int address);
 int getHasSecondConfigReg(void);
+void pic14_debugLogClose(void); // from ralloc.c
 
 char *udata_section_name=0;            // FIXME Temporary fix to change udata section name -- VR
 int pic14_hasInterrupt = 0;            // Indicates whether to emit interrupt handler or not
@@ -1429,7 +1430,7 @@ picglue ()
        
        AnalyzepCode('*');
        
-       pcode_test();
+       if (options.debug) pcode_test();
        
        
        /* now put it all together into the assembler file */
@@ -1580,6 +1581,7 @@ picglue ()
        fprintf (asmFile,"\tend\n");
        
        fclose (asmFile);
+       pic14_debugLogClose();
 }
 
 /*
index d51dca63908cc3bbd70662d61bd533b44c9ae55c..38db701321b4047c039e6210820b1254c1f4b485 100644 (file)
@@ -88,14 +88,14 @@ int Gstack_size = 0;
 
 
 static void spillThis (symbol *);
-static int debug = 1;
+static int debug = 0;  // should be 0 when committed, creates .d files
 static FILE *debugF = NULL;
 /*-----------------------------------------------------------------*/
 /* debugLog - open a file for debugging information                */
 /*-----------------------------------------------------------------*/
 //static void debugLog(char *inst,char *fmt, ...)
 static void
-       debugLog (char *fmt,...)
+debugLog (char *fmt,...)
 {
        static int append = 0;  // First time through, open the file without append.
 
@@ -118,41 +118,29 @@ static void
                        werror (E_FILE_OPEN_ERR, buffer);
                        exit (1);
                }
-               append = 1;             // Next time debubLog is called, we'll append the debug info
+               append = 1;             // Next time debugLog is called, we'll append the debug info
 
        }
 
        va_start (ap, fmt);
-
        vsprintf (buffer, fmt, ap);
+       va_end (ap);
 
        fprintf (debugF, "%s", buffer);
        //if (options.verbose) fprintf (stderr, "%s: %s", __FUNCTION__, buffer);
-       /*
-       while (isspace((unsigned char)*bufferP)) bufferP++;
-
-       if (bufferP && *bufferP) 
-               lineCurr = (lineCurr ?
-               connectLine(lineCurr,newLineNode(lb)) :
-               (lineHead = newLineNode(lb)));
-       lineCurr->isInline = _G.inLine;
-       lineCurr->isDebug  = _G.debugLine;
-       */
-       va_end (ap);
-
 }
  
 static void
-       debugNewLine (void)
+debugNewLine (void)
 {
        if (debugF)
                fputc ('\n', debugF);
 }
  /*-----------------------------------------------------------------*/
- /* debugLogClose - closes the debug log file (if opened)           */
+ /* pic14_debugLogClose - closes the debug log file (if opened)           */
  /*-----------------------------------------------------------------*/
-static void
-       debugLogClose (void)
+void
+pic14_debugLogClose (void)
 {
        if (debugF)
        {
@@ -163,20 +151,20 @@ static void
 #define AOP(op) op->aop
  
 static char *
-       debugAopGet (char *str, operand * op)
+debugAopGet (char *str, operand * op)
 {
-        if (str)
-               debugLog (str);
+       if (!debug) return NULL;
+
+        if (str) debugLog (str);
 
        printOperand (op, debugF);
        debugNewLine ();
 
        return NULL;
-
 }
 
 static char *
-       decodeOp (unsigned int op)
+decodeOp (unsigned int op)
 {
 
        if (op < 128 && op > ' ')
@@ -3640,10 +3628,11 @@ packForPush (iCode * ic, eBBlock * ebp)
 
 void printSymType(char * str, sym_link *sl)
 {
-       debugLog ("    %s Symbol type: ",str);
-       printTypeChain( sl, debugF);
-       debugLog ("\n");
-       
+       if (debug) {
+               debugLog ("    %s Symbol type: ",str);
+               printTypeChain( sl, debugF);
+               debugLog ("\n");
+       }
 }
 
 /*-----------------------------------------------------------------*/
@@ -4169,6 +4158,6 @@ pic14_assignRegisters (ebbIndex * ebbi)
        //pic14_freeAllRegs ();
        
        debugLog ("leaving\n<><><><><><><><><><><><><><><><><>\n");
-       debugLogClose ();
+       pic14_debugLogClose ();
        return;
 }