/[gxemul]/upstream/0.4.4/src/main.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /upstream/0.4.4/src/main.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 10 by dpavlin, Mon Oct 8 16:18:27 2007 UTC revision 20 by dpavlin, Mon Oct 8 16:19:23 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: main.c,v 1.238 2005/06/25 13:25:33 debug Exp $   *  $Id: main.c,v 1.248 2005/11/23 02:17:00 debug Exp $
29   */   */
30    
31  #include <stdio.h>  #include <stdio.h>
# Line 200  static void usage(int longusage) Line 200  static void usage(int longusage)
200    
201          printf("\nusage: %s [machine, other, and general options] [file "          printf("\nusage: %s [machine, other, and general options] [file "
202              "[...]]\n", progname);              "[...]]\n", progname);
203          printf("   or  %s [general options] @configfile [...]\n", progname);          printf("   or  %s [general options] @configfile\n", progname);
204          printf("   or  %s [userland, other, and general options] file "          printf("   or  %s [userland, other, and general options] file "
205              "[args ...]\n", progname);              "[args ...]\n", progname);
206    
# Line 217  static void usage(int longusage) Line 217  static void usage(int longusage)
217              "with -E.)\n");              "with -E.)\n");
218    
219          printf("\nOther options:\n");          printf("\nOther options:\n");
220            printf("  -A        disable alignment checks in some cases (for higher"
221                " speed)\n");
222  #ifdef BINTRANS  #ifdef BINTRANS
223          printf("  -B        disable dynamic binary translation. (translation"          printf("  -B        disable dynamic binary translation. (translation"
224              " is turned on\n            by default, if the host "              " is turned on\n            by default, if the host "
# Line 338  int get_cmd_args(int argc, char *argv[], Line 340  int get_cmd_args(int argc, char *argv[],
340          int msopts = 0;         /*  Machine-specific options used  */          int msopts = 0;         /*  Machine-specific options used  */
341          struct machine *m = emul_add_machine(emul, "default");          struct machine *m = emul_add_machine(emul, "default");
342    
343          while ((ch = getopt(argc, argv, "BC:Dd:E:e:HhI:iJj:KM:m:"          while ((ch = getopt(argc, argv, "ABC:Dd:E:e:HhI:iJj:KM:m:"
344              "Nn:Oo:p:QqRrSsTtUu:VvW:XxY:y:Z:z:")) != -1) {              "Nn:Oo:p:QqRrSsTtUu:VvW:XxY:y:Z:z:")) != -1) {
345                  switch (ch) {                  switch (ch) {
346                    case 'A':
347                            m->dyntrans_alignment_check = 0;
348                            msopts = 1;
349                            break;
350                  case 'B':                  case 'B':
351                          m->bintrans_enable = 0;                          m->bintrans_enable = 0;
352                          msopts = 1;                          msopts = 1;
# Line 507  int get_cmd_args(int argc, char *argv[], Line 513  int get_cmd_args(int argc, char *argv[],
513                          break;                          break;
514                  case 'Y':                  case 'Y':
515                          m->x11_scaledown = atoi(optarg);                          m->x11_scaledown = atoi(optarg);
516                            if (m->x11_scaledown < -1) {
517                                    m->x11_scaleup = - m->x11_scaledown;
518                                    m->x11_scaledown = 1;
519                            }
520                          if (m->x11_scaledown < 1) {                          if (m->x11_scaledown < 1) {
521                                  fprintf(stderr, "Invalid scaledown value.\n");                                  fprintf(stderr, "Invalid scaledown value.\n");
522                                  exit(1);                                  exit(1);
# Line 547  int get_cmd_args(int argc, char *argv[], Line 557  int get_cmd_args(int argc, char *argv[],
557                  }                  }
558          }          }
559    
560          if (type != NULL) {          if (type != NULL || subtype != NULL) {
561                    if (type == NULL)
562                            type = "";
563                  if (subtype == NULL)                  if (subtype == NULL)
564                          subtype = "";                          subtype = "";
565                  res = machine_name_to_type(type, subtype,                  res = machine_name_to_type(type, subtype,
# Line 570  int get_cmd_args(int argc, char *argv[], Line 582  int get_cmd_args(int argc, char *argv[],
582          }          }
583    
584    
585          /*  -i, -r, -t are pretty verbose:  */          /*  -i and -r are pretty verbose:  */
586    
587          if (m->instruction_trace && !verbose) {          if (m->instruction_trace && !verbose) {
588                  fprintf(stderr, "Implicitly %sturning on -v, because"                  fprintf(stderr, "Implicitly %sturning on -v, because"
# Line 586  int get_cmd_args(int argc, char *argv[], Line 598  int get_cmd_args(int argc, char *argv[],
598                  quiet_mode = 0;                  quiet_mode = 0;
599          }          }
600    
         if (m->show_trace_tree && !verbose) {  
                 fprintf(stderr, "Implicitly %sturning on -v, because"  
                     " of -t\n", quiet_mode? "turning off -q and " : "");  
                 verbose = 1;  
                 quiet_mode = 0;  
         }  
   
601          if ((m->instruction_trace || m->register_dump || m->show_trace_tree)          if ((m->instruction_trace || m->register_dump || m->show_trace_tree)
602              && m->bintrans_enable) {              && m->bintrans_enable) {
603                  fprintf(stderr, "Implicitly turning off bintrans.\n");                  if (m->arch == ARCH_MIPS)
604                            fprintf(stderr, "Implicitly turning off bintrans.\n");
605                  m->bintrans_enable = 0;                  m->bintrans_enable = 0;
606          }          }
607    
# Line 645  int get_cmd_args(int argc, char *argv[], Line 651  int get_cmd_args(int argc, char *argv[],
651                  exit(1);                  exit(1);
652          }          }
653    
654          if (m->bintrans_enable) {          if (m->bintrans_enable && m->arch == ARCH_MIPS) {
655                  m->speed_tricks = 0;                  m->speed_tricks = 0;
656                  /*  TODO: Print a warning about this?  */                  /*  TODO: Print a warning about this?  */
657          }          }
658    
659          if (m->n_breakpoints > 0 && m->bintrans_enable) {          if (m->n_breakpoints > 0 &&
660                  fprintf(stderr, "Breakpoints and dynamic translation "              m->bintrans_enable && m->arch == ARCH_MIPS) {
661                    fprintf(stderr, "Breakpoints and MIPS binary translation "
662                      "don't work too well together right now.\n");                      "don't work too well together right now.\n");
663                  exit(1);                  exit(1);
664          }          }
# Line 793  int main(int argc, char *argv[]) Line 800  int main(int argc, char *argv[])
800    
801          if (n_emuls == 0) {          if (n_emuls == 0) {
802                  fprintf(stderr, "No emulations defined. Maybe you forgot to "                  fprintf(stderr, "No emulations defined. Maybe you forgot to "
803                      "use -E xx (and -e yy), to specify\nthe machine type)."                      "use -E xx and/or -e yy, to specify\nthe machine type."
804                      " For example:\n\n    %s -E dec -e 3max -d disk.img\n\n"                      " For example:\n\n    %s -e 3max -d disk.img\n\n"
805                      "to boot an emulated DECstation 5000/200 with a disk "                      "to boot an emulated DECstation 5000/200 with a disk "
806                      "image.\n", progname);                      "image.\n", progname);
807                  exit(1);                  exit(1);
808          }          }
809    
810          device_set_exit_on_error(0);          device_set_exit_on_error(0);
811            console_warn_if_slaves_are_needed();
812    
813          /*  Run all emulations:  */          /*  Run all emulations:  */
814          emul_run(emuls, n_emuls);          emul_run(emuls, n_emuls);

Legend:
Removed from v.10  
changed lines
  Added in v.20

  ViewVC Help
Powered by ViewVC 1.1.26