projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix some things
[fw/sdcc]
/
debugger
/
mcs51
/
simi.c
diff --git
a/debugger/mcs51/simi.c
b/debugger/mcs51/simi.c
index 12430d1e625a5bbc4ad54d7c80854332f34f952d..aac8f253fd5b5b92f02212708777d05b92e384ab 100644
(file)
--- a/
debugger/mcs51/simi.c
+++ b/
debugger/mcs51/simi.c
@@
-88,6
+88,8
@@
void openSimulator (char **args, int nargs)
struct sockaddr_in sin;
int retry = 0;
int i ;
struct sockaddr_in sin;
int retry = 0;
int i ;
+
+#if 0
char *simargs[32] = { "s51","-P","-r 9756", NULL };
/* create the arguments */
char *simargs[32] = { "s51","-P","-r 9756", NULL };
/* create the arguments */
@@
-95,6
+97,7
@@
void openSimulator (char **args, int nargs)
simargs[i+3] = args[i];
}
simargs[i+3]= NULL;
simargs[i+3] = args[i];
}
simargs[i+3]= NULL;
+#endif
/* fork and start the simulator as a subprocess */
if ((simPid = fork())) {
/* fork and start the simulator as a subprocess */
if ((simPid = fork())) {
@@
-103,7
+106,8
@@
void openSimulator (char **args, int nargs)
else {
/* we are in the child process : start the simulator */
else {
/* we are in the child process : start the simulator */
- if (execvp("s51",simargs) < 0) {
+// if (execvp("s51",simargs) < 0) {
+ if (execvp(args[0],args) < 0) {
perror("cannot exec simulator");
exit(1);
}
perror("cannot exec simulator");
exit(1);
}
@@
-194,7
+198,8
@@
unsigned long simGetValue (unsigned int addr,char mem, int size)
break;
case 'H':
case 'J':
break;
case 'H':
case 'J':
- prefix = "db" ;
+// prefix = "db" ;
+ prefix = "dump" ;
break;
case 'I':
prefix = "ds" ;
break;
case 'I':
prefix = "ds" ;
@@
-215,11
+220,14
@@
unsigned long simGetValue (unsigned int addr,char mem, int size)
/* first skip thru white space */
while (isspace(*resp)) resp++ ;
/* first skip thru white space */
while (isspace(*resp)) resp++ ;
+ if (strncmp(resp, "0x",2) == 0)
+ resp += 2;
+
/* then make the branch for bit variables */
/* skip thru the address part */
while (isxdigit(*resp)) resp++;
/* then make the branch for bit variables */
/* skip thru the address part */
while (isxdigit(*resp)) resp++;
- if (!strcmp(prefix,"d
b
")) {
+ if (!strcmp(prefix,"d
ump
")) {
/* skip white space */
while (isspace(*resp)) resp++ ;
/* skip white space */
while (isspace(*resp)) resp++ ;
@@
-417,6
+425,11
@@
char *simRegs()
/* make it some more readable */
resp = simResponse();
/* make it some more readable */
resp = simResponse();
+ return resp;
+
+#if 0
+ Take this out(2-09-02) cant see as its that useful to reformat, karl.
+
/* the response is of the form
XXXXXX R0 R1 R2 R3 R4 R5 R6 R7 ........
XXXXXX XX . ACC=0xxx dd cc B=0xxx dd cc DPTR= 0xxxxx @DPTR= 0xxx dd cc
/* the response is of the form
XXXXXX R0 R1 R2 R3 R4 R5 R6 R7 ........
XXXXXX XX . ACC=0xxx dd cc B=0xxx dd cc DPTR= 0xxxxx @DPTR= 0xxx dd cc
@@
-483,8
+496,7
@@
F 0x006d 75 87 80 MOV PCON,#80
getValueStr(resp,"P="));
return regBuff;
getValueStr(resp,"P="));
return regBuff;
-
-
+#endif
}
}