Vyachaslav Gerchicov
Vyachaslav Gerchicov

Reputation: 2457

Get pointer to self in LLDB?

I want to create a breakpoint in xCode which uses LLDB and checks the current object class in condition section.

The problem is LLDB doesn't allow to use self to get a class. How to solve this problem? Maybe through other commands? For example, bt command output contains correct classname but it seems it is not allowed in LLDB too.

Upvotes: 0

Views: 328

Answers (1)

Jim Ingham
Jim Ingham

Reputation: 27118

I presume this is related to:

Using of symbolic breakpoints for child classes in Xcode?

The problem comes if your breakpoint is in code with no debug information (like in system libraries.) The debugger knows nothing about self in this context, and you have to give it more help. In the case of self, you know that it was passed into a method call as the first argument, so you can use $arg1 to get at the value.

Upvotes: 1

Related Questions