From: johanknol Date: Sat, 19 Jan 2002 14:39:27 +0000 (+0000) Subject: first pass at including c-code as asm comments X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=e9edb591ea588a700ad978ca5baba6838418c13d;p=fw%2Fsdcc first pass at including c-code as asm comments git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1818 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/asm.c b/src/asm.c index c7ef55c5..cd819e43 100644 --- a/src/asm.c +++ b/src/asm.c @@ -203,6 +203,42 @@ asm_addTree (const ASM_MAPPINGS * pMappings) } } +/*-----------------------------------------------------------------*/ +/* printCLine - try to find the c-code for this lineno */ +/*-----------------------------------------------------------------*/ +static FILE *inFile=NULL; +static char inLineString[1024]; +static int inLineNo=0; +int rewinds=0; + +char *printCLine (char *srcFile, int lineno) { + char *ilsP=inLineString; + if (!inFile) { + inFile=fopen(srcFile, "r"); + if (!inFile) { + perror ("printCLine"); + exit (1); + } + } + if (lineno