jsc CLI should work with the remote inspector
authorkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Nov 2016 01:22:10 +0000 (01:22 +0000)
committerkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Nov 2016 01:22:10 +0000 (01:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=164569

Reviewed by Joseph Pecoraro.

This patch enables using the remote inspector on the jsc CLI.
In order to use the remote inspector, jsc users need to pass an option.

* jsc.cpp:
(CommandLine::parseArguments):
(runJSC):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208514 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/jsc.cpp

index ab7ff9f..f24f59b 100644 (file)
@@ -1,3 +1,17 @@
+2016-11-09  Keith Miller  <keith_miller@apple.com>
+
+        jsc CLI should work with the remote inspector
+        https://bugs.webkit.org/show_bug.cgi?id=164569
+
+        Reviewed by Joseph Pecoraro.
+
+        This patch enables using the remote inspector on the jsc CLI.
+        In order to use the remote inspector, jsc users need to pass an option.
+
+        * jsc.cpp:
+        (CommandLine::parseArguments):
+        (runJSC):
+
 2016-11-09  Saam Barati  <sbarati@apple.com>
 
         Math.min()/Math.max() with no arguments is lowered incorrectly in the BytecodeParser
index e16b44f..23bf747 100644 (file)
@@ -966,6 +966,7 @@ public:
     String m_uncaughtExceptionName;
     bool m_alwaysDumpUncaughtException { false };
     bool m_dumpSamplingProfilerData { false };
+    bool m_enableRemoteDebugging { false };
 
     void parseArguments(int, char**);
 };
@@ -2784,6 +2785,11 @@ void CommandLine::parseArguments(int argc, char** argv)
             continue;
         }
 
+        if (!strcmp(arg, "--remote-debug")) {
+            m_enableRemoteDebugging = true;
+            continue;
+        }
+
         static const unsigned strictFileStrLength = strlen("--strict-file=");
         if (!strncmp(arg, "--strict-file=", strictFileStrLength)) {
             m_scripts.append(Script(Script::StrictMode::Strict, Script::CodeSource::File, Script::ScriptType::Script, argv[i] + strictFileStrLength));
@@ -2851,6 +2857,7 @@ static int NEVER_INLINE runJSC(VM* vm, CommandLine options)
         vm->m_perBytecodeProfiler = std::make_unique<Profiler::Database>(*vm);
 
     GlobalObject* globalObject = GlobalObject::create(*vm, GlobalObject::createStructure(*vm, jsNull()), options.m_arguments);
+    globalObject->setRemoteDebuggingEnabled(options.m_enableRemoteDebugging);
     bool success = runWithScripts(globalObject, options.m_scripts, options.m_uncaughtExceptionName, options.m_alwaysDumpUncaughtException, options.m_dump, options.m_module);
     if (options.m_interactive && success)
         runInteractive(globalObject);