Given wchar_t* str; which points to a null-terminated utf32 (or utf16) string, what command should I use to print it in lldb?
Given wchar_t* str; which points to a null-terminated utf32 (or utf16) string, what command
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I assume you want to print it as utf8. It’s a little involved – you need to create a summary provider for the type in python that returns a utf8 string for printing. It’s not especially complicated though. Create a little python file like
~/lldb/wcharsummary.pywith contents likeLoad this in to lldb and set this python function as the summary provider for wchar_t*; easiest to put this in your
~/.lldbinitfile for re-use:then given some source that has some utf32 encoded characters in 32-bit wchar_t’s,
lldb will print them in utf8 for us: