@@ -148,8 +148,6 @@ static bool use_debug_agent = false;
148148static bool debug_wait_connect = false ;
149149static std::string* debug_host; // coverity[leaked_storage]
150150static int debug_port = 5858 ;
151- static std::string* inspector_host; // coverity[leaked_storage]
152- static int inspector_port = 9229 ;
153151static const int v8_default_thread_pool_size = 4 ;
154152static int v8_thread_pool_size = v8_default_thread_pool_size;
155153static bool prof_process = false ;
@@ -3473,15 +3471,12 @@ static bool ParseDebugOpt(const char* arg) {
34733471 return true ;
34743472 }
34753473
3476- std::string** const the_host = use_inspector ? &inspector_host : &debug_host;
3477- int * const the_port = use_inspector ? &inspector_port : &debug_port;
3478-
34793474 // FIXME(bnoordhuis) Move IPv6 address parsing logic to lib/net.js.
34803475 // It seems reasonable to support [address]:port notation
34813476 // in net.Server#listen() and net.Socket#connect().
34823477 const size_t port_len = strlen (port);
34833478 if (port[0 ] == ' [' && port[port_len - 1 ] == ' ]' ) {
3484- *the_host = new std::string (port + 1 , port_len - 2 );
3479+ debug_host = new std::string (port + 1 , port_len - 2 );
34853480 return true ;
34863481 }
34873482
@@ -3491,13 +3486,13 @@ static bool ParseDebugOpt(const char* arg) {
34913486 // if it's not all decimal digits, it's a host name.
34923487 for (size_t n = 0 ; port[n] != ' \0 ' ; n += 1 ) {
34933488 if (port[n] < ' 0' || port[n] > ' 9' ) {
3494- *the_host = new std::string (port);
3489+ debug_host = new std::string (port);
34953490 return true ;
34963491 }
34973492 }
34983493 } else {
34993494 const bool skip = (colon > port && port[0 ] == ' [' && colon[-1 ] == ' ]' );
3500- *the_host = new std::string (port + skip, colon - skip);
3495+ debug_host = new std::string (port + skip, colon - skip);
35013496 }
35023497
35033498 char * endptr;
@@ -3510,7 +3505,7 @@ static bool ParseDebugOpt(const char* arg) {
35103505 exit (12 );
35113506 }
35123507
3513- *the_port = static_cast <int >(result);
3508+ debug_port = static_cast <int >(result);
35143509
35153510 return true ;
35163511}
@@ -3770,8 +3765,7 @@ static void DispatchMessagesDebugAgentCallback(Environment* env) {
37703765static void StartDebug (Environment* env, const char * path, bool wait) {
37713766 CHECK (!debugger_running);
37723767 if (use_inspector) {
3773- debugger_running = v8_platform.StartInspector (env, path, inspector_port,
3774- wait);
3768+ debugger_running = v8_platform.StartInspector (env, path, debug_port, wait);
37753769 } else {
37763770 env->debugger_agent ()->set_dispatch_handler (
37773771 DispatchMessagesDebugAgentCallback);
0 commit comments