0

So I have char **sentence with sentence[0] = string0, sentence[1] = string1, etc. Is there a way I can print the entire array in lldb? So that it shows up as {string0, string1, ...}

3
  • What if there are a thousand strings in the array? Do you want them all to display? Commented Mar 8, 2019 at 17:38
  • I don't know C, but have you tried po sentence? Commented Mar 8, 2019 at 18:49
  • po calls class-implemented (in process) description methods. For instance in ObjC they call either description or debugDescription methods. C (and C++) data types have no convention for providing string descriptions of themselves, so po won't do anything more than print or frame var for C and C++ datatypes. Commented Mar 11, 2019 at 18:33

1 Answer 1

1

This is answered in:

View array in LLDB: equivalent of GDB's '@' operator in Xcode 4.1

particularly, you can use the parray command in any recent lldb.

There isn't a way to do this in the Xcode Locals view, but you can do this in the Xcode Debugger Console.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.