Redesigned option handling, start of libtool introduction
[fw/sdcc] / sim / ucsim / cmd.src / cmdset.cc
index 5d145c56056ff344139a1816597de078421d6e7b..40ab449545dfe50c7fdba1395d58ac57d3b45ae4 100644 (file)
@@ -128,9 +128,9 @@ COMMAND_DO_WORK_SIM(cl_stop_cmd)
 //                  class cl_cmdline *cmdline, class cl_console *con)
 COMMAND_DO_WORK_UC(cl_step_cmd)
 {
-  printf("step %x\n",uc->PC);
+  //printf("step %x\n",uc->PC);
   uc->do_inst(1);
-  printf("step done %x\n",uc->PC);
+  //printf("step done %x\n",uc->PC);
   uc->print_regs(con);
   return(0);
 }
@@ -187,9 +187,10 @@ COMMAND_DO_WORK_SIM(cl_next_cmd)
       sim->start(con);
       //sim->uc->do_inst(-1);
     }
-  else
+  else {
     sim->uc->do_inst(1);
-  sim->uc->print_regs(con);
+    sim->uc->print_regs(con);
+  }
   return(DD_FALSE);
 }
 
@@ -306,4 +307,31 @@ COMMAND_DO_WORK_APP(cl_kill_cmd)
 }
 
 
+/*
+ * EXEC file
+ */
+
+COMMAND_DO_WORK_APP(cl_exec_cmd)
+{
+  class cl_cmd_arg *parm= cmdline->param(0);
+  char *fn= 0;
+
+  if (cmdline->syntax_match(0, STRING)) {
+    fn= parm->value.string.string; 
+  }
+  else
+    con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+
+  class cl_commander *c= app->get_commander();
+  class cl_console *cons= con->clone_for_exec(fn);
+  if (cons)
+    {
+      cons->flags|= CONS_NOWELCOME;
+      c->add_console(cons);
+    }
+
+  return(DD_FALSE);
+}
+
+
 /* End of cmd.src/cmdset.cc */