0

In my iOS code, I have the following code

(char *)xmlTextReaderValue(reader)

How can I can see what this C function returns in XCode? I know that if it was Objective C object I could use po to print the object. Is there any alternative for C functions?

2
  • 1
    You drop the o from po and you're left with the p command... Commented Jul 9, 2013 at 14:54
  • By the way, this isn't really something about Xcode, it's rather about the lldb debugger it uses. (The same instruction works with gdb, of course.) Commented Jul 9, 2013 at 14:55

1 Answer 1

1

If your char * contains printable data (like a well formed string that is NULL terminated, you can simply use the p command, explicitly casting the result:

p (char *) xmlTextReaderValue(reader)
Sign up to request clarification or add additional context in comments.

2 Comments

Since there's probably no type information and for C functions lldb can't query the runtime, you have to explicitly cast: p (char *) xmlTextReaderValue(reader)
Thanks for the comment @NikolaiRuhe, added details to my answer.

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.