context *currCtxt = NULL;
short fullname = 0;
char *ssdirl = SDCC_LIB_DIR ":" SDCC_LIB_DIR "/small" ;
-char *simArgs[8];
+char *simArgs[20];
int nsimArgs = 0;
+char model_str[20];
/* fake filename & lineno to make linker */
char *filename=NULL;
{ "h" , cmdHelp , NULL },
{ "info" , cmdInfo ,
- "info\n"
+ "info"
"\t {break}\t list all break points\n"
"\t {stack}\t information about call stack\n"
"\t {frame}\t current frame information\n"
},
{ "l" , cmdListSrc , NULL },
{ "show" , cmdShow ,
- "show\n"
+ "show"
"\t {copying}\t copying & distribution terms\n"
"\t {warranty}\t warranty information\n"
},
continue ;
}
+ /* model string */
+ if (strncmp(argv[i],"-m",2) == 0) {
+ strncpy(model_str, &argv[i][2], 15);
+ if (strcmp(model_str,"avr") == 0)
+ simArgs[0] = "savr";
+ else if (strcmp(model_str,"rrz80") == 0)
+ simArgs[0] = "rrz80";
+ else if (strcmp(model_str,"xa") == 0)
+ simArgs[0] = "sxa";
+ else if (strcmp(model_str,"z80") == 0)
+ simArgs[0] = "sz80";
+ continue ;
+ }
+
fprintf(stderr,"unknown option %s --- ignored\n",
argv[i]);
} else {
int main ( int argc, char **argv)
{
printVersionInfo();
+
+ simArgs[nsimArgs++] = "s51";
+ simArgs[nsimArgs++] = "-P";
+ simArgs[nsimArgs++] = "-r 9756";
/* parse command line */
+
parseCmdLine(argc,argv);
commandLoop();
struct sockaddr_in sin;
int retry = 0;
int i ;
+
+#if 0
char *simargs[32] = { "s51","-P","-r 9756", NULL };
/* create the arguments */
simargs[i+3] = args[i];
}
simargs[i+3]= NULL;
+#endif
/* fork and start the simulator as a subprocess */
if ((simPid = fork())) {
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);
}