--- trunk/src/main.c 2007/10/08 16:18:11 6 +++ trunk/src/main.c 2007/10/08 16:18:51 14 @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: main.c,v 1.236 2005/05/25 06:40:18 debug Exp $ + * $Id: main.c,v 1.244 2005/09/07 07:41:29 debug Exp $ */ #include @@ -200,7 +200,7 @@ printf("\nusage: %s [machine, other, and general options] [file " "[...]]\n", progname); - printf(" or %s [general options] @configfile [...]\n", progname); + printf(" or %s [general options] @configfile\n", progname); printf(" or %s [userland, other, and general options] file " "[args ...]\n", progname); @@ -217,9 +217,12 @@ "with -E.)\n"); printf("\nOther options:\n"); + printf(" -A disable alignment checks in some cases (for higher" + " speed)\n"); #ifdef BINTRANS - printf(" -B disable dynamic binary translation completely\n"); - printf(" -b use the OLD binary translation subsystem\n"); + printf(" -B disable dynamic binary translation. (translation" + " is turned on\n by default, if the host " + "supports it)\n"); #endif printf(" -C x try to emulate a specific CPU. (Use -H to get a " "list of types.)\n"); @@ -337,15 +340,15 @@ int msopts = 0; /* Machine-specific options used */ struct machine *m = emul_add_machine(emul, "default"); - while ((ch = getopt(argc, argv, "BbC:Dd:E:e:HhI:iJj:KM:m:" + while ((ch = getopt(argc, argv, "ABC:Dd:E:e:HhI:iJj:KM:m:" "Nn:Oo:p:QqRrSsTtUu:VvW:XxY:y:Z:z:")) != -1) { switch (ch) { - case 'B': - m->bintrans_enable = 0; + case 'A': + m->dyntrans_alignment_check = 0; msopts = 1; break; - case 'b': - m->old_bintrans_enable = 1; + case 'B': + m->bintrans_enable = 0; msopts = 1; break; case 'C': @@ -544,13 +547,15 @@ msopts = 1; break; default: - fprintf(stderr, "Invalid option.\n"); - usage(0); + fprintf(stderr, "Run %s -h for help on command " + "line options.\n", progname); exit(1); } } - if (type != NULL) { + if (type != NULL || subtype != NULL) { + if (type == NULL) + type = ""; if (subtype == NULL) subtype = ""; res = machine_name_to_type(type, subtype, @@ -566,17 +571,6 @@ extra_argv = argv; - if (!m->bintrans_enable && m->old_bintrans_enable) { - fprintf(stderr, "You cannot both select old bintrans and" - " disable bintrans at the same time.\n"); - exit(1); - } - - /* TODO: Remove this once there is a new bintrans system. */ - if (m->bintrans_enable && !m->old_bintrans_enable) { - m->bintrans_enable = 0; - } - if (m->machine_type == MACHINE_NONE && msopts) { fprintf(stderr, "Machine specific options used directly on " "the command line, but no machine\nemulation specified?\n"); @@ -584,7 +578,7 @@ } - /* -i, -r, -t are pretty verbose: */ + /* -i and -r are pretty verbose: */ if (m->instruction_trace && !verbose) { fprintf(stderr, "Implicitly %sturning on -v, because" @@ -600,11 +594,10 @@ quiet_mode = 0; } - 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; + if ((m->instruction_trace || m->register_dump || m->show_trace_tree) + && m->bintrans_enable) { + fprintf(stderr, "Implicitly turning off bintrans.\n"); + m->bintrans_enable = 0; } @@ -658,8 +651,9 @@ /* TODO: Print a warning about this? */ } - if (m->n_breakpoints > 0 && m->bintrans_enable) { - fprintf(stderr, "Breakpoints and dynamic translation " + if (m->n_breakpoints > 0 && + m->bintrans_enable && m->arch == ARCH_MIPS) { + fprintf(stderr, "Breakpoints and MIPS binary translation " "don't work too well together right now.\n"); exit(1); } @@ -801,8 +795,8 @@ if (n_emuls == 0) { fprintf(stderr, "No emulations defined. Maybe you forgot to " - "use -E xx (and -e yy), to specify\nthe machine type)." - " For example:\n\n %s -E dec -e 3max -d disk.img\n\n" + "use -E xx and/or -e yy, to specify\nthe machine type." + " For example:\n\n %s -e 3max -d disk.img\n\n" "to boot an emulated DECstation 5000/200 with a disk " "image.\n", progname); exit(1);