From fd67da9d82f190df558abfb076460cf4f9bf1bc0 Mon Sep 17 00:00:00 2001 From: kbongers Date: Sat, 9 Feb 2002 07:05:37 +0000 Subject: [PATCH] add -mz80 support git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1908 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- debugger/mcs51/sdcdb.c | 26 +++++++++++++++++++++++--- debugger/mcs51/simi.c | 6 +++++- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/debugger/mcs51/sdcdb.c b/debugger/mcs51/sdcdb.c index a416625a..c40e3d8c 100644 --- a/debugger/mcs51/sdcdb.c +++ b/debugger/mcs51/sdcdb.c @@ -40,8 +40,9 @@ linkrec **linkrecs = NULL; /* all linkage editor records */ 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; @@ -86,7 +87,7 @@ struct cmdtab { "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" @@ -102,7 +103,7 @@ struct cmdtab }, { "l" , cmdListSrc , NULL }, { "show" , cmdShow , - "show\n" + "show" "\t {copying}\t copying & distribution terms\n" "\t {warranty}\t warranty information\n" }, @@ -774,6 +775,20 @@ static void parseCmdLine (int argc, char **argv) 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 { @@ -800,7 +815,12 @@ static void parseCmdLine (int argc, char **argv) int main ( int argc, char **argv) { printVersionInfo(); + + simArgs[nsimArgs++] = "s51"; + simArgs[nsimArgs++] = "-P"; + simArgs[nsimArgs++] = "-r 9756"; /* parse command line */ + parseCmdLine(argc,argv); commandLoop(); diff --git a/debugger/mcs51/simi.c b/debugger/mcs51/simi.c index 12430d1e..168f02eb 100644 --- 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 ; + +#if 0 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; +#endif /* 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 */ - if (execvp("s51",simargs) < 0) { +// if (execvp("s51",simargs) < 0) { + if (execvp(args[0],args) < 0) { perror("cannot exec simulator"); exit(1); } -- 2.30.2