• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Inspecting synthesized variables in gdb
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Inspecting synthesized variables in gdb


  • Subject: Inspecting synthesized variables in gdb
  • From: Ingvar Nedrebo <email@hidden>
  • Date: Fri, 19 Jun 2009 17:52:48 +0100

I've recently been experimenting with some code that takes advantage of the new features of Objective-C 2.0 and the 64-bit runtime: Synthesized variables, ie. declaring properties in a class extension without declaring the corresponding variables in the class interface - like so:

Foo.h:

@interface Foo
{}
@end

Foo.m:

@interface Foo ()
@property (copy) NSString * p;
@end

@implementation Foo
@synthesize p;
@end


But I can't get gdb to give up the values of such properties when debugging. I've tried:


(gdb) po foo.p
There is no member named p.
(gdb) po [foo p]
Target does not respond to this message selector.
(gdb) po [(id)foo p]
Target does not respond to this message selector.

Is it at all possible to inspect synthesized variables in gdb, or do I need to go back to old school declared variables? This is on Mac OS X 10.5.7, XCode 3.1.3.

Thanks,
Ingvar

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Just implementing -isEqual:, never invoked, causes crash
  • Next by Date: Re: Basic, but still confuses me (initWithFrame and drawRect)
  • Previous by thread: Re: Basic, but still confuses me (initWithFrame and drawRect)
  • Next by thread: Rosetta Booster Conclusion - It Works
  • Index(es):
    • Date
    • Thread