Title: [221878] trunk/Source/_javascript_Core
Revision
221878
Author
[email protected]
Date
2017-09-11 14:24:48 -0700 (Mon, 11 Sep 2017)

Log Message

Make jsc dump the command line if JSC_dumpOption environment variable is set with a non-zero value.
https://bugs.webkit.org/show_bug.cgi?id=176722

Reviewed by Saam Barati.

For PLATFORM(COCOA), I also dumped the JSC_* environmental variables that are
in effect when jsc is invoked.

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

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (221877 => 221878)


--- trunk/Source/_javascript_Core/ChangeLog	2017-09-11 21:13:19 UTC (rev 221877)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-09-11 21:24:48 UTC (rev 221878)
@@ -1,3 +1,16 @@
+2017-09-11  Mark Lam  <[email protected]>
+
+        Make jsc dump the command line if JSC_dumpOption environment variable is set with a non-zero value.
+        https://bugs.webkit.org/show_bug.cgi?id=176722
+
+        Reviewed by Saam Barati.
+
+        For PLATFORM(COCOA), I also dumped the JSC_* environmental variables that are
+        in effect when jsc is invoked.
+
+        * jsc.cpp:
+        (CommandLine::parseArguments):
+
 2017-09-11  Ryan Haddad  <[email protected]>
 
         Unreviewed, rolling out r221854.

Modified: trunk/Source/_javascript_Core/jsc.cpp (221877 => 221878)


--- trunk/Source/_javascript_Core/jsc.cpp	2017-09-11 21:13:19 UTC (rev 221877)
+++ trunk/Source/_javascript_Core/jsc.cpp	2017-09-11 21:24:48 UTC (rev 221878)
@@ -103,6 +103,10 @@
 #include <unistd.h>
 #endif
 
+#if PLATFORM(COCOA)
+#include <crt_externs.h>
+#endif
+
 #if HAVE(READLINE)
 // readline/history.h has a Function typedef which conflicts with the WTF::Function template from WTF/Forward.h
 // We #define it to something else to avoid this conflict.
@@ -3595,6 +3599,20 @@
 {
     Options::initialize();
     
+    if (Options::dumpOptions()) {
+        printf("Command line:");
+#if PLATFORM(COCOA)
+        for (char** envp = *_NSGetEnviron(); *envp; envp++) {
+            const char* env = *envp;
+            if (!strncmp("JSC_", env, 4))
+                printf(" %s", env);
+        }
+#endif // PLATFORM(COCOA)
+        for (int i = 0; i < argc; ++i)
+            printf(" %s", argv[i]);
+        printf("\n");
+    }
+
     int i = 1;
     JSC::Options::DumpLevel dumpOptionsLevel = JSC::Options::DumpLevel::None;
     bool needToExit = false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to