* as/z80/z80mch.c: fixed bug #1704376: missing as-z80 errors
[fw/sdcc] / debugger / mcs51 / simi.c
index 09f63ca3c9ad96c779b8ae3ae676147887078044..c44b40718ff2047a48350343c94c1b12f9b54f6c 100644 (file)
@@ -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);
 }