1

I've attached to process and I'm currently stepping through code inside very large class. In the line I'm interested in, there is a usage of some important pointer. I need to know where it's value (any property of the object it is pointing at) was recently changed. The stack trace is not helpful as the change was done from some asynchronous call. How to identify this code ? How in Microsoft Visual C++ 6.0 can I set the data breakpoint, which will help me to investigate the places of explicit memory changes as the time goes by ?

EDIT: I'm not asking about new Microsoft Visual Studio and yes, I need to use a 15-year-old compiler.

Community
  • 1
  • 1
jwaliszko
  • 16,942
  • 22
  • 92
  • 158

1 Answers1

0

It's not difficult. Just create a breakpoint somewhere after the execution of the initial writing of the pointer (the location is somewhat arbitrary). Then right-click, select Condition..., and enter the expression yourPtr and select Has changed.

Scott Jones
  • 2,880
  • 13
  • 19
  • In Visual Studio it is simple but I just switched to the older one - Microsoft Visual C++ and cannot find similar option. – jwaliszko May 17 '13 at 13:30
  • I don't understand your distinction - most devs use VS to edit/debug VC++. Unless you're using a VERY old version, conditional breakpoints have been around for years. – Scott Jones May 17 '13 at 13:33
  • @Scott, you're describing conditional breakpoints, not data breakpoints. – JoeG May 17 '13 at 13:34
  • @JaroslawWaliszko: Do you have a particular need to use a 15-year-old compiler that doesn't know about Standard C++? If not, then it might be a good idea to update it. – Mike Seymour May 17 '13 at 13:44
  • @Mike Seymour: Unfortunately the code is also not so new. I'm using virtual machine at which there is this particular compiler installed. I need to move some parts of functionality to the new system, but I need to know exactly what's going on at the old one to be aware of what I need. – jwaliszko May 17 '13 at 13:49