From: borutr Date: Sun, 14 Jan 2007 19:35:01 +0000 (+0000) Subject: * as/mcs51/asnoice.c: fixed bug #1447412: X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=3929272bc523af272364e741f5a4565c97c47932;p=fw%2Fsdcc * as/mcs51/asnoice.c: fixed bug #1447412: Cannot debug files that contain spaces in the path name by converting spaces in asm file mane to underscores git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4571 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index b29b6453..d0fcbf3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-01-14 Borut Razem + + * as/mcs51/asnoice.c: fixed bug #1447412: + Cannot debug files that contain spaces in the path name + by converting spaces in asm file mane to underscores + 2007-01-13 Borut Razem * doc/sdccman.lyx: fixed format errors diff --git a/as/mcs51/asnoice.c b/as/mcs51/asnoice.c index 38d3233f..a18b1f15 100644 --- a/as/mcs51/asnoice.c +++ b/as/mcs51/asnoice.c @@ -9,12 +9,13 @@ #include #include #include +#include #include "asm.h" -/* Return basic file name without path or extension */ -static char* BaseFileName( int fileNumber ); +/* Return basic file name without path or extension. + If spacesToUnderscores != 0 then spaces are converted to underscores */ -char* BaseFileName( int fileNumber ) +char* BaseFileName( int fileNumber, int spacesToUnderscores ) { static int prevFile = -1; static char baseName[ PATH_MAX ]; @@ -42,6 +43,15 @@ char* BaseFileName( int fileNumber ) if (p2 != NULL) *p2 = 0; /* SD comment this out since not a ANSI Function */ /* strupr( baseName ); */ + + if (spacesToUnderscores) + { + /* Convert spaces to underscores */ + for (p1 = baseName; *p1; ++p1) + if (isspace(*p1)) + *p1 = '_'; + } + } return baseName; } @@ -53,7 +63,7 @@ void DefineNoICE_Line() struct sym *pSym; /* symbol is FILE.nnn */ - sprintf( name, "%s.%u", BaseFileName( cfile ), srcline[ cfile ] ); + sprintf( name, "%s.%u", BaseFileName( cfile, 0 ), srcline[ cfile ] ); pSym = lookup( name ); pSym->s_type = S_USER; @@ -69,7 +79,7 @@ void DefineCDB_Line() struct sym *pSym; /* symbol is FILE.nnn */ - sprintf( name, "A$%s$%u", BaseFileName( cfile ), srcline[ cfile ] ); + sprintf( name, "A$%s$%u", BaseFileName( cfile, 1 ), srcline[ cfile ] ); pSym = lookup( name ); pSym->s_type = S_USER;