• 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
Re: How to break on a variable change in XCode debugging
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to break on a variable change in XCode debugging
      • From: Jerry <email@hidden>
References: 
 >How to break on a variable change in XCode debugging (From: Mike Lazear <email@hidden>)

  • Prev by Date: How to break on a variable change in XCode debugging
  • Next by Date: Re: How to find the memory smasher (Was: How to break on a variable change in XCode debugging)
  • Previous by thread: How to break on a variable change in XCode debugging
  • Next by thread: Re: How to break on a variable change in XCode debugging
  • Index(es):
    • Date
    • Thread