Skip to content

Conversation

croath
Copy link

@croath croath commented Jun 8, 2015

correct the output and command of lldb

correct the output and command of lldb
@chriseidhof
Copy link
Contributor

I think it should be p, right? Not po? It's an integer.

@croath
Copy link
Author

croath commented Jun 8, 2015

@chriseidhof It's true that po stands for print object as described in manual.

But according to the original article, the output is 3. If you try the commands in Xcode Debugger, you will get the result as:

(lldb) e NSArray *$array = @[ @"Saturday", @"Sunday", @"Monday" ]
(lldb) p [$array count]
(NSUInteger) $0 = 3
(lldb) po [$array count]
3
#there is an empty line

In a word if you're using p, the result is (NSUInteger) $0 = 3,
If the result is only 3, the command should be po instead.

It's quite wired that po can print "description" of non-object value, but it just happened and I don't think it's a bug of LLDB, at most some kind of workaround or syntactic sugar.

I'm trying to figure it out but it's too difficult to me to read the source code of LLDB. Please let me know if you got the technical reason. 😄

@croath
Copy link
Author

croath commented Jul 11, 2015

@chriseidhof anything updated here?

Copy link
Contributor

@revolter revolter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either this, either change the output line to (NSUInteger) $0 = 3, though I think having 3 is better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants