X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=debugger%2Fmcs51%2Fsimi.c;h=c44b40718ff2047a48350343c94c1b12f9b54f6c;hb=3bd25d75bcad68055bb616dcc29dde8a2965965e;hp=09f63ca3c9ad96c779b8ae3ae676147887078044;hpb=1883cb8232c73fdebbd89e5a0f97b5fb8b859c97;p=fw%2Fsdcc diff --git a/debugger/mcs51/simi.c b/debugger/mcs51/simi.c index 09f63ca3..c44b4071 100644 --- a/debugger/mcs51/simi.c +++ b/debugger/mcs51/simi.c @@ -315,7 +315,7 @@ void openSimulator (char **args, int nargs) fh = _open_osfhandle((intptr_t)sock, _O_TEXT); if (-1 == fh) { - perror("cannot _open_osfhandle"); + perror("cannot _open_osfhandle"); exit(1); } @@ -329,7 +329,7 @@ void openSimulator (char **args, int nargs) fh = _open_osfhandle((intptr_t)sock, _O_TEXT); if (-1 == fh) { - perror("cannot _open_osfhandle"); + perror("cannot _open_osfhandle"); exit(1); } @@ -363,6 +363,7 @@ static int execSimulator(char **args, int nargs) exit(1); } } + return simPid; } void openSimulator (char **args, int nargs) @@ -544,7 +545,7 @@ int simSetValue (unsigned int addr,char mem, int size, unsigned long val) s = buffer + strlen(buffer) -1; for ( i = 0 ; i < size ; i++ ) { - sprintf(s," 0x%x", val & 0xff); + sprintf(s," 0x%lx", val & 0xff); s += strlen(s); val >>= 8; } @@ -589,7 +590,7 @@ unsigned long simGetValue (unsigned int addr,char mem, int size) case of bit variables which case it becomes [address] [assembler bit address] [v] */ /* first skip thru white space */ - while (isspace(*resp)) resp++ ; + resp = trim_left(resp); if (strncmp(resp, "0x",2) == 0) resp += 2; @@ -611,7 +612,7 @@ unsigned long simGetValue (unsigned int addr,char mem, int size) for (i = 0 ; i < size ; i++ ) { /* skip white space */ - while (isspace(*resp)) resp++ ; + resp = trim_left(resp); b[i] = strtol(resp,&resp,16); } @@ -653,7 +654,7 @@ void simLoadFile (char *s) char buff[128]; sprintf(buff,"file \"%s\"\n",s); - printf(buff); + printf("%s",buff); sendSim(buff); waitForSim(500,NULL); }