Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    2
  • comments
    2
  • views
    2786

Debugging - Knowing when a variable changes

Sign in to follow this  
xEricx

425 views

This is a short entry to explain what I was talking about in luasitdown's thread about knowing when a variable changes.

Step 1:

Taking the address of the object we want to watch:



Note: I dragged the "Value" of &a as a new watch, to be able to copy paste it.

Step 2:

Adding the new breakpoint that watches the variable's address (WARNING: This can slow things dramatically...)



Step 3:

Notification when the memory is modified:






I didn't get it working on complex structures, but you can most likely find out which member you want to check, and test for its value change.

If anyone knows how to structures, drop me a mail.

Cheers
Sign in to follow this  


2 Comments


Recommended Comments

Just plug in the address of the member. &(structure->member), or just take the address of the structure and add on the requisite offset.

Share this comment


Link to comment
Yep, that's I've always been doing, but I was wondering if it was possible to watch for all the members of a struct, with one single breakpoint. It must be possible to somehow specify a sizeof for the address specified and to have the debugger watch for this range of memory addresses for changes...

Thanks for the input though, I should have mentionned it :)

Cheers

Eric

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!