Title: [103647] trunk/Source/WebCore
Revision
103647
Author
m...@apple.com
Date
2011-12-23 20:35:22 -0800 (Fri, 23 Dec 2011)

Log Message

Print dlerror() when dyld functions fail unexpectedly
https://bugs.webkit.org/show_bug.cgi?id=75185

Reviewed by Sam Weinig.

* platform/mac/SoftLinking.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (103646 => 103647)


--- trunk/Source/WebCore/ChangeLog	2011-12-24 04:11:44 UTC (rev 103646)
+++ trunk/Source/WebCore/ChangeLog	2011-12-24 04:35:22 UTC (rev 103647)
@@ -1,3 +1,12 @@
+2011-12-23  Dan Bernstein  <m...@apple.com>
+
+        Print dlerror() when dyld functions fail unexpectedly
+        https://bugs.webkit.org/show_bug.cgi?id=75185
+
+        Reviewed by Sam Weinig.
+
+        * platform/mac/SoftLinking.h:
+
 2011-12-23  Sam Weinig  <s...@webkit.org>
 
         Start extracting platform specific bits out of PlatformEvents

Modified: trunk/Source/WebCore/platform/mac/SoftLinking.h (103646 => 103647)


--- trunk/Source/WebCore/platform/mac/SoftLinking.h	2011-12-24 04:11:44 UTC (rev 103646)
+++ trunk/Source/WebCore/platform/mac/SoftLinking.h	2011-12-24 04:35:22 UTC (rev 103647)
@@ -33,7 +33,7 @@
     static void* lib##Library() \
     { \
         static void* dylib = dlopen("/usr/lib/" #lib ".dylib", RTLD_NOW); \
-        ASSERT(dylib); \
+        ASSERT_WITH_MESSAGE(dylib, "%s", dlerror()); \
         return dylib; \
     }
 
@@ -41,7 +41,7 @@
     static void* framework##Library() \
     { \
         static void* frameworkLibrary = dlopen("/System/Library/Frameworks/" #framework ".framework/" #framework, RTLD_NOW); \
-        ASSERT(frameworkLibrary); \
+        ASSERT_WITH_MESSAGE(frameworkLibrary, "%s", dlerror()); \
         return frameworkLibrary; \
     }
 
@@ -56,7 +56,7 @@
     static void* framework##Library() \
     { \
         static void* frameworkLibrary = dlopen("/System/Library/Frameworks/CoreServices.framework/Frameworks/" #framework ".framework/" #framework, RTLD_NOW); \
-        ASSERT(frameworkLibrary); \
+        ASSERT_WITH_MESSAGE(frameworkLibrary, "%s", dlerror()); \
         return frameworkLibrary; \
     }
 
@@ -67,7 +67,7 @@
     static resultType init##functionName parameterDeclarations \
     { \
         softLink##functionName = (resultType (*) parameterDeclarations) dlsym(framework##Library(), #functionName); \
-        ASSERT(softLink##functionName); \
+        ASSERT_WITH_MESSAGE(softLink##functionName, "%s", dlerror()); \
         return softLink##functionName parameterNames; \
     }\
     \
@@ -118,7 +118,7 @@
     static type init##name() \
     { \
         void** pointer = static_cast<void**>(dlsym(framework##Library(), #name)); \
-        ASSERT(pointer); \
+        ASSERT_WITH_MESSAGE(pointer, "%s", dlerror()); \
         pointer##name = static_cast<type>(*pointer); \
         get##name = name##Function; \
         return pointer##name; \
@@ -156,7 +156,7 @@
     static type init##name() \
     { \
         void* constant = dlsym(framework##Library(), #name); \
-        ASSERT(constant); \
+        ASSERT_WITH_MESSAGE(constant, "%s", dlerror()); \
         constant##name = *static_cast<type*>(constant); \
         get##name = name##Function; \
         return constant##name; \
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to