Commit 74c33bed31839bbff861877194a5a39f8000c284

Authored by bellard
1 parent afce2927

User-mode gdbserver port number (Paul Brook)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1591 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 5 additions and 6 deletions
linux-user/main.c
@@ -978,7 +978,7 @@ void usage(void) @@ -978,7 +978,7 @@ void usage(void)
978 "Linux CPU emulator (compiled for %s emulation)\n" 978 "Linux CPU emulator (compiled for %s emulation)\n"
979 "\n" 979 "\n"
980 "-h print this help\n" 980 "-h print this help\n"
981 - "-g wait gdb connection to port %d\n" 981 + "-g port wait gdb connection to port\n"
982 "-L path set the elf interpreter prefix (default=%s)\n" 982 "-L path set the elf interpreter prefix (default=%s)\n"
983 "-s size set the stack size in bytes (default=%ld)\n" 983 "-s size set the stack size in bytes (default=%ld)\n"
984 "\n" 984 "\n"
@@ -989,7 +989,6 @@ void usage(void) @@ -989,7 +989,6 @@ void usage(void)
989 "-d options activate log (logfile=%s)\n" 989 "-d options activate log (logfile=%s)\n"
990 "-p pagesize set the host page size to 'pagesize'\n", 990 "-p pagesize set the host page size to 'pagesize'\n",
991 TARGET_ARCH, 991 TARGET_ARCH,
992 - DEFAULT_GDBSTUB_PORT,  
993 interp_prefix, 992 interp_prefix,
994 x86_stack_size, 993 x86_stack_size,
995 DEBUG_LOGFILE); 994 DEBUG_LOGFILE);
@@ -1013,7 +1012,7 @@ int main(int argc, char **argv) @@ -1013,7 +1012,7 @@ int main(int argc, char **argv)
1013 CPUState *env; 1012 CPUState *env;
1014 int optind; 1013 int optind;
1015 const char *r; 1014 const char *r;
1016 - int use_gdbstub = 0; 1015 + int gdbstub_port = 0;
1017 1016
1018 if (argc <= 1) 1017 if (argc <= 1)
1019 usage(); 1018 usage();
@@ -1068,7 +1067,7 @@ int main(int argc, char **argv) @@ -1068,7 +1067,7 @@ int main(int argc, char **argv)
1068 exit(1); 1067 exit(1);
1069 } 1068 }
1070 } else if (!strcmp(r, "g")) { 1069 } else if (!strcmp(r, "g")) {
1071 - use_gdbstub = 1; 1070 + gdbstub_port = atoi(argv[optind++]);
1072 } else 1071 } else
1073 #ifdef USE_CODE_COPY 1072 #ifdef USE_CODE_COPY
1074 if (!strcmp(r, "no-code-copy")) { 1073 if (!strcmp(r, "no-code-copy")) {
@@ -1247,8 +1246,8 @@ int main(int argc, char **argv) @@ -1247,8 +1246,8 @@ int main(int argc, char **argv)
1247 #error unsupported target CPU 1246 #error unsupported target CPU
1248 #endif 1247 #endif
1249 1248
1250 - if (use_gdbstub) {  
1251 - gdbserver_start (DEFAULT_GDBSTUB_PORT); 1249 + if (gdbstub_port) {
  1250 + gdbserver_start (gdbstub_port);
1252 gdb_handlesig(env, 0); 1251 gdb_handlesig(env, 0);
1253 } 1252 }
1254 cpu_loop(env); 1253 cpu_loop(env);