Re: How to break on a variable change in XCode debugging
Re: How to break on a variable change in XCode debugging
- Subject: Re: How to break on a variable change in XCode debugging
- From: Jim Ingham <email@hidden>
- Date: Mon, 20 Dec 2004 18:32:31 -0800
There isn't a GUI way to do this yet. But you can do it in the gdb
console. Just bring up the Debugger log (under the Debug menu), and
use the "watch" command.
One little subtlety, if you do something like:
(gdb) watch foo->bar->baz
gdb will watch all three locations so you will know if the result of
the expression changes for any reason. This is sometimes what you
want, and sometimes not. If you know you just want to watch a simple
memory location, it is sometimes easier to do:
(gdb) print &(foo->bar->baz)
(gdb) watch *<HEX address returned from the previous command>
The * in this case tells gdb that you are giving it an address, and not
an expression... And of course, without the <>'s...
If you want more help on how to use the gdb console, there are docs in
/Developer/Documentation/DeveloperTools/gdb/gdb/gdb_toc.html.
Jim
On Dec 20, 2004, at 6:22 PM, Mike Lazear wrote:
We are trying to debug a problem in our code where we are clobbering
memory. We would like to create a breakpoint that happens when a
particular global variable gets changed. In XCode 1.5 I can't figure
out how to do this. This is a common feature in most debuggers. Is
this possible with XCode?
Thanks,
Mike
_______________________________________________
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