"Linux CPU emulator (compiled for %s emulation)\n"
"\n"
"-h print this help\n"
- "-g wait gdb connection to port %d\n"
+ "-g port wait gdb connection to port\n"
"-L path set the elf interpreter prefix (default=%s)\n"
"-s size set the stack size in bytes (default=%ld)\n"
"\n"
"-d options activate log (logfile=%s)\n"
"-p pagesize set the host page size to 'pagesize'\n",
TARGET_ARCH,
- DEFAULT_GDBSTUB_PORT,
interp_prefix,
x86_stack_size,
DEBUG_LOGFILE);
CPUState *env;
int optind;
const char *r;
- int use_gdbstub = 0;
+ int gdbstub_port = 0;
if (argc <= 1)
usage();
exit(1);
}
} else if (!strcmp(r, "g")) {
- use_gdbstub = 1;
+ gdbstub_port = atoi(argv[optind++]);
} else
#ifdef USE_CODE_COPY
if (!strcmp(r, "no-code-copy")) {
#error unsupported target CPU
#endif
- if (use_gdbstub) {
- gdbserver_start (DEFAULT_GDBSTUB_PORT);
+ if (gdbstub_port) {
+ gdbserver_start (gdbstub_port);
gdb_handlesig(env, 0);
}
cpu_loop(env);