Title: [218347] trunk/Source/WebCore
Revision
218347
Author
ddkil...@apple.com
Date
2017-06-15 12:29:53 -0700 (Thu, 15 Jun 2017)

Log Message

Build fix: [iOS] Generate a simulated crash when the WebThread starts in MobileSafari
<https://webkit.org/b/173386>
<rdar://problem/32776426>

* platform/ios/CrashReporterSupportSoftLink.h:
* platform/ios/CrashReporterSupportSoftLink.mm:
* platform/ios/wak/WebCoreThread.mm:
(WebThreadEnable): Log to the console on iOS Simulator.
* platform/spi/ios/CrashReporterSupportSPI.h:
- CrashReporterSupport.h is not available on iOS Simulator, so
  restrict to iOS hardware only.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (218346 => 218347)


--- trunk/Source/WebCore/ChangeLog	2017-06-15 19:00:29 UTC (rev 218346)
+++ trunk/Source/WebCore/ChangeLog	2017-06-15 19:29:53 UTC (rev 218347)
@@ -1,3 +1,17 @@
+2017-06-15  David Kilzer  <ddkil...@apple.com>
+
+        Build fix: [iOS] Generate a simulated crash when the WebThread starts in MobileSafari
+        <https://webkit.org/b/173386>
+        <rdar://problem/32776426>
+
+        * platform/ios/CrashReporterSupportSoftLink.h:
+        * platform/ios/CrashReporterSupportSoftLink.mm:
+        * platform/ios/wak/WebCoreThread.mm:
+        (WebThreadEnable): Log to the console on iOS Simulator.
+        * platform/spi/ios/CrashReporterSupportSPI.h:
+        - CrashReporterSupport.h is not available on iOS Simulator, so
+          restrict to iOS hardware only.
+
 2017-06-15  Chris Dumez  <cdu...@apple.com>
 
         Unreviewed, rolling out r218318.

Modified: trunk/Source/WebCore/platform/ios/CrashReporterSupportSoftLink.h (218346 => 218347)


--- trunk/Source/WebCore/platform/ios/CrashReporterSupportSoftLink.h	2017-06-15 19:00:29 UTC (rev 218346)
+++ trunk/Source/WebCore/platform/ios/CrashReporterSupportSoftLink.h	2017-06-15 19:29:53 UTC (rev 218347)
@@ -22,7 +22,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)
 
 #import "CrashReporterSupportSPI.h"
 #import "SoftLinking.h"
@@ -34,4 +34,4 @@
 
 using WebCore::softLink_CrashReporterSupport_SimulateCrash;
 
-#endif // PLATFORM(IOS)
+#endif // PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)

Modified: trunk/Source/WebCore/platform/ios/CrashReporterSupportSoftLink.mm (218346 => 218347)


--- trunk/Source/WebCore/platform/ios/CrashReporterSupportSoftLink.mm	2017-06-15 19:00:29 UTC (rev 218346)
+++ trunk/Source/WebCore/platform/ios/CrashReporterSupportSoftLink.mm	2017-06-15 19:29:53 UTC (rev 218347)
@@ -24,7 +24,7 @@
 
 #import "config.h"
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)
 
 #import "CrashReporterSupportSPI.h"
 #import "SoftLinking.h"
@@ -33,4 +33,4 @@
 
 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CrashReporterSupport, SimulateCrash, BOOL, (pid_t pid, mach_exception_data_type_t exceptionCode, NSString *description), (pid, exceptionCode, description));
 
-#endif // PLATFORM(IOS)
+#endif // PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)

Modified: trunk/Source/WebCore/platform/ios/wak/WebCoreThread.mm (218346 => 218347)


--- trunk/Source/WebCore/platform/ios/wak/WebCoreThread.mm	2017-06-15 19:00:29 UTC (rev 218346)
+++ trunk/Source/WebCore/platform/ios/wak/WebCoreThread.mm	2017-06-15 19:29:53 UTC (rev 218347)
@@ -1003,8 +1003,13 @@
 void WebThreadEnable(void)
 {
     if (WebCore::IOSApplication::isMobileSafari()) {
+        NSString *message = @"MobileSafari should never run a WebThread";
+#if !PLATFORM(IOS_SIMULATOR)
         const mach_exception_data_type_t kExceptionCode = 0xbbadd0b1; // "Bad Dub 1" or Bad WK1.
-        SimulateCrash(getpid(), kExceptionCode, @"MobileSafari should never run a WebThread");
+        SimulateCrash(getpid(), kExceptionCode, message);
+#else
+        NSLog(@"ERROR: %@\n%@", message, [NSThread callStackSymbols]);
+#endif
     }
     RELEASE_ASSERT_WITH_MESSAGE(!WebCore::IOSApplication::isWebProcess(), "The WebProcess should never run a WebThread");
 

Modified: trunk/Source/WebCore/platform/spi/ios/CrashReporterSupportSPI.h (218346 => 218347)


--- trunk/Source/WebCore/platform/spi/ios/CrashReporterSupportSPI.h	2017-06-15 19:00:29 UTC (rev 218346)
+++ trunk/Source/WebCore/platform/spi/ios/CrashReporterSupportSPI.h	2017-06-15 19:29:53 UTC (rev 218347)
@@ -26,6 +26,8 @@
 #import <Foundation/Foundation.h>
 #import <mach/exception_types.h>
 
+#if PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)
+
 #if USE(APPLE_INTERNAL_SDK)
 
 WTF_EXTERN_C_BEGIN
@@ -37,3 +39,5 @@
 WTF_EXTERN_C_BEGIN
 BOOL SimulateCrash(pid_t pid, mach_exception_data_type_t exceptionCode, NSString *description);
 WTF_EXTERN_C_END
+
+#endif // PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to