RESOLVED FIXED 187185
[lldb-webkit] Non-empty strings may be pretty-printed as empty
https://bugs.webkit.org/show_bug.cgi?id=187185
Summary [lldb-webkit] Non-empty strings may be pretty-printed as empty
Daniel Bates
Reported 2018-06-29 10:53:23 PDT
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).
Attachments
Patch (2.66 KB, patch)
2018-06-29 11:05 PDT, Daniel Bates
simon.fraser: review+
Daniel Bates
Comment 1 2018-06-29 10:53:59 PDT
$ 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 %
Daniel Bates
Comment 2 2018-06-29 10:56:24 PDT
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.
Daniel Bates
Comment 3 2018-06-29 11:05:50 PDT
Daniel Bates
Comment 4 2018-06-29 16:18:03 PDT
Radar WebKit Bug Importer
Comment 5 2018-06-29 16:19:49 PDT
Note You need to log in before you can comment on or make changes to this bug.