From e6738d409cdac8036084341a7cc8daea40574732 Mon Sep 17 00:00:00 2001 From: michaelh Date: Mon, 27 Mar 2000 02:06:59 +0000 Subject: [PATCH] Made debugging optional. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@211 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCglobl.h | 1 + src/SDCCglue.c | 18 +++++++++--------- src/z80/main.c | 1 + 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/SDCCglobl.h b/src/SDCCglobl.h index c054ff95..a0b75c2a 100644 --- a/src/SDCCglobl.h +++ b/src/SDCCglobl.h @@ -200,6 +200,7 @@ struct options { int nopeep : 1 ; /* no peep hole optimization */ int asmpeep : 1 ; /* pass inline assembler thru peep hole */ int debug : 1 ; /* generate extra debug info */ + int nodebug : 1 ; /* Generate no debug info. */ int stackOnData:1 ; /* stack after data segment */ int noregparms: 1 ; /* do not pass parameters in registers */ int c1mode : 1 ; /* Act like c1 - no pre-proc, asm or link */ diff --git a/src/SDCCglue.c b/src/SDCCglue.c index 8b462959..9412e4ae 100644 --- a/src/SDCCglue.c +++ b/src/SDCCglue.c @@ -154,7 +154,7 @@ static void emitRegularMap (memmap * map, bool addPublics, bool arFlag) continue; /* print extra debug info if required */ - if (options.debug || sym->level == 0) { + if ((options.debug || sym->level == 0) && !options.nodebug) { cdbSymbol(sym,cdbFile,FALSE,FALSE); @@ -172,7 +172,7 @@ static void emitRegularMap (memmap * map, bool addPublics, bool arFlag) /* if is has an absolute address then generate an equate for this no need to allocate space */ if (SPEC_ABSA (sym->etype)) { - if (options.debug || sym->level == 0) + if ((options.debug || sym->level == 0) && !options.nodebug) fprintf (map->oFile," == 0x%04x\n",SPEC_ADDR (sym->etype)); fprintf (map->oFile, "%s\t=\t0x%04x\n", @@ -181,7 +181,7 @@ static void emitRegularMap (memmap * map, bool addPublics, bool arFlag) } else { /* allocate space */ - if (options.debug || sym->level == 0) + if ((options.debug || sym->level == 0) && !options.nodebug) fprintf(map->oFile,"==.\n"); fprintf (map->oFile, "%s:\n", sym->rname); fprintf (map->oFile, "\t.ds\t0x%04x\n", (unsigned int)getSize (sym->type) & 0xffff); @@ -643,7 +643,7 @@ void emitStaticSeg (memmap * map) addSetHead (&publics, sym); /* print extra debug info if required */ - if (options.debug || sym->level == 0) { + if ((options.debug || sym->level == 0) && !options.nodebug) { cdbSymbol(sym,cdbFile,FALSE,FALSE); @@ -662,7 +662,7 @@ void emitStaticSeg (memmap * map) /* if it has an absolute address */ if (SPEC_ABSA (sym->etype)) { - if (options.debug || sym->level == 0) + if ((options.debug || sym->level == 0) && !options.nodebug) fprintf(code->oFile," == 0x%04x\n", SPEC_ADDR (sym->etype)); fprintf (code->oFile, "%s\t=\t0x%04x\n", @@ -670,7 +670,7 @@ void emitStaticSeg (memmap * map) SPEC_ADDR (sym->etype)); } else { - if (options.debug || sym->level == 0) + if ((options.debug || sym->level == 0) && !options.nodebug) fprintf(code->oFile," == .\n"); /* if it has an initial value */ @@ -853,7 +853,7 @@ static void emitOverlay(FILE *afile) continue; /* print extra debug info if required */ - if (options.debug || sym->level == 0) { + if ((options.debug || sym->level == 0) && !options.nodebug) { cdbSymbol(sym,cdbFile,FALSE,FALSE); @@ -874,7 +874,7 @@ static void emitOverlay(FILE *afile) an equate for this no need to allocate space */ if (SPEC_ABSA (sym->etype)) { - if (options.debug || sym->level == 0) + if ((options.debug || sym->level == 0) && !options.nodebug) fprintf (afile," == 0x%04x\n",SPEC_ADDR (sym->etype)); fprintf (afile, "%s\t=\t0x%04x\n", @@ -882,7 +882,7 @@ static void emitOverlay(FILE *afile) SPEC_ADDR (sym->etype)); } else { - if (options.debug || sym->level == 0) + if ((options.debug || sym->level == 0) && !options.nodebug) fprintf(afile,"==.\n"); /* allocate space */ diff --git a/src/z80/main.c b/src/z80/main.c index 0e0e932d..f99766f4 100644 --- a/src/z80/main.c +++ b/src/z80/main.c @@ -69,6 +69,7 @@ static void _setDefaultOptions(void) options.stackAuto = 1; options.mainreturn = 1; options.noregparms = 1; + options.nodebug = 1; /* first the options part */ options.intlong_rent = 1; -- 2.30.2