HKTonyLee
HKTonyLee

Reputation: 3300

How to examine the actual class of C++ object with LLDB?

I am now developing Cocos2d-x with Xcode. But I do not know how to examine the actual class of C++ object with LLDB. As you can see in the image, the Xcode's inspector knows the actual class but p or po does not.

So the question is: How to examine the actual class of C++ object with LLDB?

LLDB knows the actual class

Upvotes: 7

Views: 4164

Answers (1)

Enrico Granata
Enrico Granata

Reputation: 3329

This is because the Xcode UI has "dynamic types" enabled by default. Dynamic types are LLDB lingo for "I am going to figure out the actual type of this object". In order to get that same behavior at the console, you could try typing

(lldb) frame variable -d run-target pObject

In the open source LLDB, you could also type

(lldb) expr -d run-target -- pObject

Upvotes: 7

Related Questions