Cannot debug files that contain spaces in the path name
by converting spaces in asm file name to underscores
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4572
4a8a32a2-be11-0410-ad9d-
d568d2c75423
2007-01-14 Borut Razem <borut.razem AT siol.net>
2007-01-14 Borut Razem <borut.razem AT siol.net>
- * as/mcs51/asnoice.c: fixed bug #1447412:
+ * as/mcs51/asnoice.c, as/hc08/asnoice.c: fixed bug #1447412:
Cannot debug files that contain spaces in the path name
Cannot debug files that contain spaces in the path name
- by converting spaces in asm file mane to underscores
+ by converting spaces in asm file name to underscores
2007-01-13 Borut Razem <borut.razem AT siol.net>
2007-01-13 Borut Razem <borut.razem AT siol.net>
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
#include <stdio.h>
#include <setjmp.h>
#include <string.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 ];
{
static int prevFile = -1;
static char baseName[ PATH_MAX ];
if (p2 != NULL) *p2 = 0;
/* SD comment this out since not a ANSI Function */
/* strupr( baseName ); */
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 = '_';
+ }
struct sym *pSym;
/* symbol is FILE.nnn */
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;
pSym = lookup( name );
pSym->s_type = S_USER;
struct sym *pSym;
/* symbol is FILE.nnn */
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;
pSym = lookup( name );
pSym->s_type = S_USER;
if (isspace(*p1))
*p1 = '_';
}
if (isspace(*p1))
*p1 = '_';
}