Title: [160649] trunk/Tools
Revision
160649
Author
[email protected]
Date
2013-12-16 10:17:01 -0800 (Mon, 16 Dec 2013)

Log Message

[ASAN] WebKitLauncher: Include libasancrashreporter.dylib in DYLD_INSERT_LIBRARIES if it exists
https://bugs.webkit.org/show_bug.cgi?id=124610

Reviewed by Mark Rowe.

* WebKitLauncher/WebKitNightlyEnabler.m:
(enableWebKitNightlyBehaviour):
Add libasancrashreporter.dylib to DYLD_INSERT_LIBRARIES.
* WebKitLauncher/main.m:
(main):
Include both libasancrashreporter and the nightly enabler to
the list of libraries to insert.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (160648 => 160649)


--- trunk/Tools/ChangeLog	2013-12-16 18:10:58 UTC (rev 160648)
+++ trunk/Tools/ChangeLog	2013-12-16 18:17:01 UTC (rev 160649)
@@ -1,3 +1,18 @@
+2013-12-16  David Farler  <[email protected]>
+
+        [ASAN] WebKitLauncher: Include libasancrashreporter.dylib in DYLD_INSERT_LIBRARIES if it exists
+        https://bugs.webkit.org/show_bug.cgi?id=124610
+
+        Reviewed by Mark Rowe.
+
+        * WebKitLauncher/WebKitNightlyEnabler.m:
+        (enableWebKitNightlyBehaviour):
+        Add libasancrashreporter.dylib to DYLD_INSERT_LIBRARIES.
+        * WebKitLauncher/main.m:
+        (main):
+        Include both libasancrashreporter and the nightly enabler to
+        the list of libraries to insert.
+
 2013-12-16  Gergo Balogh  <[email protected]>
 
         Resolve inconsistant style warning caused by r160319.

Modified: trunk/Tools/WebKitLauncher/WebKitNightlyEnabler.m (160648 => 160649)


--- trunk/Tools/WebKitLauncher/WebKitNightlyEnabler.m	2013-12-16 18:10:58 UTC (rev 160648)
+++ trunk/Tools/WebKitLauncher/WebKitNightlyEnabler.m	2013-12-16 18:17:01 UTC (rev 160649)
@@ -139,6 +139,11 @@
     unsetenv("DYLD_INSERT_LIBRARIES");
     poseAsWebKitApp();
 
+    NSString *pathToASanCrashReporterLib = [webKitLauncherBundle() pathForResource:@"libasancrashreporter" ofType:@"dylib"];
+
+    if (pathToASanCrashReporterLib)
+        setenv("DYLD_INSERT_LIBRARIES", [pathToASanCrashReporterLib UTF8String], 1);
+
     extensionPaths = [[NSSet alloc] initWithObjects:@"~/Library/InputManagers/", @"/Library/InputManagers/",
                                                     @"~/Library/Application Support/SIMBL/Plugins/", @"/Library/Application Support/SIMBL/Plugins/",
                                                     @"~/Library/Application Enhancers/", @"/Library/Application Enhancers/",

Modified: trunk/Tools/WebKitLauncher/main.m (160648 => 160649)


--- trunk/Tools/WebKitLauncher/main.m	2013-12-16 18:10:58 UTC (rev 160648)
+++ trunk/Tools/WebKitLauncher/main.m	2013-12-16 18:17:01 UTC (rev 160649)
@@ -246,6 +246,10 @@
                             [NSString stringWithFormat:@"Nightly builds of WebKit are not supported on OS X %@ at this time.", systemVersion]);
 
     NSString *pathToEnablerLib = [[NSBundle mainBundle] pathForResource:@"WebKitNightlyEnabler" ofType:@"dylib"];
+    NSString *dyldInsertLibraries = pathToEnablerLib;
+    NSString *pathToASanCrashReporterLib = [[NSBundle mainBundle] pathForResource:@"libasancrashreporter" ofType:@"dylib"];
+    if (pathToASanCrashReporterLib)
+        dyldInsertLibraries = [@[ pathToASanCrashReporterLib, pathToEnablerLib ] componentsJoinedByString:@":"];
 
     NSBundle *safariBundle = locateSafariBundle();
     NSString *executablePath = determineExecutablePath(safariBundle);
@@ -263,7 +267,7 @@
 
     NSMutableArray *arguments = [NSMutableArray arrayWithObject:executablePath];
     NSMutableDictionary *environment = [[[NSDictionary dictionaryWithObjectsAndKeys:frameworkPath, @"DYLD_FRAMEWORK_PATH", @"YES", @"WEBKIT_UNSET_DYLD_FRAMEWORK_PATH",
-                                                                                    pathToEnablerLib, @"DYLD_INSERT_LIBRARIES", [[NSBundle mainBundle] executablePath], @"WebKitAppPath", nil] mutableCopy] autorelease];
+                                                                                    dyldInsertLibraries, @"DYLD_INSERT_LIBRARIES", [[NSBundle mainBundle] executablePath], @"WebKitAppPath", nil] mutableCopy] autorelease];
     [environment addEntriesFromDictionary:[[NSProcessInfo processInfo] environment]];
     addStartPageToArgumentsIfNeeded(arguments);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to