Ask the Expert

How to use a Watch window

I am trying to evaluate a C++ program by using the debugger options in Visual C++ .NET 2003. I have picked a Watch window and placed the variables in it that I need to monitor. I am using the "step into" function to invoke execution of the code. The debugger seems to work fine for a few steps, but then my screen shows other outputs that, frankly, I don't have any idea what they are about. Could you tell me what is happening and why I don't see my variables any more in the Watch window?
If I read your question correctly, it sounds like you've stepped into a function, so the values you placed in the Watch window are no longer in scope, so the debugger can't evaluate them. If you want to watch items up the stack, enter them using the context identifier scope in the Watch window: {function,source file,exe/dll name}variable. If the function is Foo, the source file is MyFile.CPP, the binary is BAR.EXE", and the viable is "i" the entry looks like the following: {Foo,MyFile.CPP,BAR.EXE}i

This was first published in August 2003

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: