From: tecodev Date: Fri, 9 Mar 2007 12:30:51 +0000 (+0000) Subject: * src/pic/gen.c, X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=b40923cae3697a11c95777bdcc09777430a1e02b;p=fw%2Fsdcc * 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 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4672 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 8734cc7e..b7ce06bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-03-09 Raphael Neider + + * 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 * device/lib/printf_large.c: 6 bytes less __data mem (6 more __idata) diff --git a/src/SDCCmain.c b/src/SDCCmain.c index 62d11db7..083ecb12 100644 --- a/src/SDCCmain.c +++ b/src/SDCCmain.c @@ -1488,6 +1488,7 @@ linkEdit (char **envp) char linkerScriptFileName[PATH_MAX]; linkerScriptFileName[0] = 0; + c = NULL; if(port->linker.needLinkerScript) { diff --git a/src/pic/gen.c b/src/pic/gen.c index 429e44a2..cfbd2028 100644 --- a/src/pic/gen.c +++ b/src/pic/gen.c @@ -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); } diff --git a/src/pic/glue.c b/src/pic/glue.c index a2403e96..51050ae0 100644 --- a/src/pic/glue.c +++ b/src/pic/glue.c @@ -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(); } /* diff --git a/src/pic/ralloc.c b/src/pic/ralloc.c index d51dca63..38db7013 100644 --- a/src/pic/ralloc.c +++ b/src/pic/ralloc.c @@ -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; }