Bug 174637

Summary: lldb: Add type summary for StringView
Product: WebKit Reporter: Daniel Bates <dbates>
Component: Tools / TestsAssignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: jer.noble, jfbastien, lforschler, sam
Priority: P2    
Version: WebKit Local Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch none

Description Daniel Bates 2017-07-18 12:15:23 PDT
We should add a type summary for StringView objects to print the length and contents of the StringView similar to what we do for other string types. Currently you can get the effect of pretty printing a StringView by converting it to String using StringView.toString() and then printing the string in lldb. It would be more convenient to support pretty printing a StringView directly.
Comment 1 Daniel Bates 2017-07-18 12:19:17 PDT
Created attachment 315813 [details]
Patch
Comment 2 Sam Weinig 2017-07-18 14:47:52 PDT
Cool. How does one install these? Do they work in Xcode too?
Comment 3 Daniel Bates 2017-07-18 15:52:35 PDT
(In reply to Sam Weinig from comment #2)
> Cool. How does one install these?

Installation instructions are at the top of the file: <https://trac.webkit.org/browser/trunk/Tools/lldb/lldb_webkit.py?rev=216701#L24>.

If you don't want to always have these type summaries enabled and just want to try them out in a single lldb/Xcode debug session just execute:

command script import {Path to WebKit Root}/Tools/lldb/lldb_webkit.py

in your lldb/Xcode lldb session.

> Do they work in Xcode too?

Yes, it works in an Xcode lldb session.
Comment 4 Daniel Bates 2017-07-18 15:54:04 PDT
Comment on attachment 315813 [details]
Patch

Clearing flags on attachment: 315813

Committed r219637: <http://trac.webkit.org/changeset/219637>
Comment 5 Daniel Bates 2017-07-18 15:54:05 PDT
All reviewed patches have been landed.  Closing bug.