mirror of https://gitee.com/openkylin/qemu.git
User-mode gdbserver port number (Paul Brook)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1591 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
afce2927aa
commit
74c33bed31
|
@ -978,7 +978,7 @@ void usage(void)
|
||||||
"Linux CPU emulator (compiled for %s emulation)\n"
|
"Linux CPU emulator (compiled for %s emulation)\n"
|
||||||
"\n"
|
"\n"
|
||||||
"-h print this help\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"
|
"-L path set the elf interpreter prefix (default=%s)\n"
|
||||||
"-s size set the stack size in bytes (default=%ld)\n"
|
"-s size set the stack size in bytes (default=%ld)\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
@ -989,7 +989,6 @@ void usage(void)
|
||||||
"-d options activate log (logfile=%s)\n"
|
"-d options activate log (logfile=%s)\n"
|
||||||
"-p pagesize set the host page size to 'pagesize'\n",
|
"-p pagesize set the host page size to 'pagesize'\n",
|
||||||
TARGET_ARCH,
|
TARGET_ARCH,
|
||||||
DEFAULT_GDBSTUB_PORT,
|
|
||||||
interp_prefix,
|
interp_prefix,
|
||||||
x86_stack_size,
|
x86_stack_size,
|
||||||
DEBUG_LOGFILE);
|
DEBUG_LOGFILE);
|
||||||
|
@ -1013,7 +1012,7 @@ int main(int argc, char **argv)
|
||||||
CPUState *env;
|
CPUState *env;
|
||||||
int optind;
|
int optind;
|
||||||
const char *r;
|
const char *r;
|
||||||
int use_gdbstub = 0;
|
int gdbstub_port = 0;
|
||||||
|
|
||||||
if (argc <= 1)
|
if (argc <= 1)
|
||||||
usage();
|
usage();
|
||||||
|
@ -1068,7 +1067,7 @@ int main(int argc, char **argv)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
} else if (!strcmp(r, "g")) {
|
} else if (!strcmp(r, "g")) {
|
||||||
use_gdbstub = 1;
|
gdbstub_port = atoi(argv[optind++]);
|
||||||
} else
|
} else
|
||||||
#ifdef USE_CODE_COPY
|
#ifdef USE_CODE_COPY
|
||||||
if (!strcmp(r, "no-code-copy")) {
|
if (!strcmp(r, "no-code-copy")) {
|
||||||
|
@ -1247,8 +1246,8 @@ int main(int argc, char **argv)
|
||||||
#error unsupported target CPU
|
#error unsupported target CPU
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (use_gdbstub) {
|
if (gdbstub_port) {
|
||||||
gdbserver_start (DEFAULT_GDBSTUB_PORT);
|
gdbserver_start (gdbstub_port);
|
||||||
gdb_handlesig(env, 0);
|
gdb_handlesig(env, 0);
|
||||||
}
|
}
|
||||||
cpu_loop(env);
|
cpu_loop(env);
|
||||||
|
|
Loading…
Reference in New Issue