Today, I set a breakpoint at <https://trac.webkit.org/browser/trunk/Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm?rev=233316#L91>. Using a debug built of WebKit, I started MiniBrowser and opened a new WK2 window. When the breakpoint was hit I ran `p m_url.string()`. LLDB emitted the following: (lldb) p m_url.string() (const WTF::String) $9 = { length = 0, contents = '' } { m_impl = { m_ptr = 0x000000011ce6fb18 { length = 0, is8bit = 0, contents = '' } } } But m_url.string() is not an empty string: (lldb) p m_url.string().isEmpty() (bool) $10 = false I am using Xcode 10.0 (10L177m) on macOS Mojave (18A323).
$ Tools/Scripts/dump-class-layout -c Debug JavaScriptCore StringImpl Found 1 types matching "StringImpl" in "/Volumes/.../WebKitBuild/Debug/JavaScriptCore.framework/JavaScriptCore" for x86_64 +0 { 24} StringImpl +0 { 24} WTF::StringImplShape +0 < 4> unsigned int m_refCount; +4 < 4> unsigned int m_length; +8 < 8> WTF::StringImplShape::(anonymous union) None; +16 < 4> unsigned int m_hashAndFlags; +20 < 4> <PADDING> +20 < 4> <PADDING> Total byte size: 24 Total pad bytes: 8 Padding percentage: 33.33 %
dump-class-layout does not have an issue resolving that WTF::StringImpl is effectively a WTF::StringImplShape. The LLDB repl seems to have an issue with this.
Created attachment 343923 [details] Patch
Committed r233375: <https://trac.webkit.org/changeset/233375>
<rdar://problem/41657759>