Re: gdb breakpoints for synthesized properties
Re: gdb breakpoints for synthesized properties
- Subject: Re: gdb breakpoints for synthesized properties
- From: Jim Ingham <email@hidden>
- Date: Fri, 8 Feb 2008 10:53:01 -0800
@synthesized properties sometimes define setters & getters, though not
always. If they do, the setter will have the form (for property
"propName"):
-[ClassName setPropName:]
If it is there you can break on it. "obj.propName = foo" seems to
always get translated to a call to the setter if it exists. Of course
if you've renamed the setter, then it will be whatever you've called it.
However, it looks like sometimes the compiler decides it doesn't need
to define a setter. In that case, if you know what the backing ivar
is, you can try watching that. Watchpoints work pretty well on x86
Macs - where we have access to the hardware watchpoint registers. The
don't work so well on PPC. Note also there are only 4 watchpoint
registers on the x86 chips, so you can usefully watch 4 variables, and
after that we have to fall back to software watchpoints, which are
very slow.
If you're on Xcode 2.5 or 3.0, we've added a convenient bit to the
watch command:
(gdb) watch -location obj->propName
will watch the location where propName is stored directly. Otherwise:
(gdb) watch obj->propName
will watch both obj & obj->propName to see if either changes, which
can cause problems if obj is a local variable, since the watch no
longer makes sense when obj goes out of scope...
Jim
On Feb 8, 2008, at 7:58 AM, Jim Turner wrote:
I'm curious how one could go about setting a breakpoint on the
assignment of a synthesized property. Normally I would just set the
breakpoint inside the setter, but without any actual code, it's
unclear if this is even possible.
Thanks!
--
Jim
http://nukethemfromorbit.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden