* SUMMARY Auto-attach fails after r179562, initialization too late after dispatch. The async initialization of the RemoteInspector singleton causes auto-attach to fail if for instance you have: int main() { [[[JSContext alloc] init] evaluateScript:@"debugger"]; ... } We should detect if we are on the main thread and do it synchronously, since that was the only reason we were dispatching to the main thread anyways.
<rdar://problem/20525746>
Created attachment 250679 [details] [PATCH] Proposed Fix
Comment on attachment 250679 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=250679&action=review > Source/JavaScriptCore/inspector/remote/RemoteInspector.mm:87 > - dispatch_async(dispatch_get_main_queue(), ^{ > + dispatch_block_t initialize = ^{ One could argue that we should just change the dispatch_async to be a dispatch_sync. I'm going to cq- while I think about that.
> One could argue that we should just change the dispatch_async to be a > dispatch_sync. I'm going to cq- while I think about that. I couldn't reproduce the issue I was thinking with background queues, so I'm going to keep this dispatch_async in the non-main thread case.
http://trac.webkit.org/changeset/182825