See Qstring data in Xcode

Source: Internet
Author: User

There is no support for qstring by default in Lldb, you need to add it yourself.

1. Create the ~/.lldb folder in the user directory and create a ' qstring.py ' file in the folder. The contents of the qstring.py are:

ImportLldbdefUtf16string_summary (Value, *rest): D= value. Getchildmemberwithname ("D") Length= D.getchildmemberwithname ("size"). getvalueassigned () offset= D.getchildmemberwithname ("Offset"). getvalueassigned () address= d.getvalueasunsigned () +OffsetifLength = =0:return '""'Error=Lldb. Sberror ()#UTF-16, so we multiply length by 2bytes= value. GetProcess (). ReadMemory (Address, length * 2, error)ifbytes isNone:return '""'           return ''%s ''% (Bytes.decode ('utf-16'). Encode ('Utf-8'))          def __lldb_init_module(Debugger, *rest):Print "Registering QString"Summary= Lldb. Sbtypesummary.createwithfunctionname ("qstring.utf16string_summary") Summary. SetOptions (Lldb.etypeoptionhidechildren) debugger. Getdefaultcategory (). Addtypesummary (lldb. Sbtypenamespecifier ("QString", False), summary)

2. Create a ~/.lldbinit file, write a command to the script import ~/.lldb/qstring.py '

3. Restart Xcode to take effect

Reference

Https://github.com/tgebarowski/lldb-scripts

See Qstring data in Xcode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.