I have a superclass and a subclass, both of which define instance variables.
Rough outline of superclass:
/* GenericClass.h */
@interface GenericCla
GDB is not an Objective-C compiler. The compiler knows about things like lexical scope within Objective-C methods, but GDB does not. It does, however, understand local variables.
In Objective-C, every method has an implicit self
parameter passed to it when it's called. So when you look at self->str
, GDB is interpreting that like it would interpret any other local variable evaluation.
When you try to evaluate str
on its own, GDB will look for a local variable called str
and, not finding one, reports that it's not in scope. This is not an error; this is the expected behavior.