Solved

VC Debugging Problem in XP

Posted on 2003-11-05
6
362 Views
Last Modified: 2013-11-20
Just recently I switched from Windows 2000 to XP. But in using VC 6.0, I got a different debugging response of XP from that of Windows 2000. In Windows 2000, when I run the debug version of a program in "non-debug" mode and encounter an ASSERT line, a dialog will pop up to allow me to stop at the ASSERT line, showing where the ASSERT is. But, in XP, a similar dialog, but different, will also pop up, but clicking "Debug" button will terminate the program execution, and return to project editing status. I have no way to know where the ASSERT is. I have to re-run the program in "debug" mode to enable the debugging and try to re-produce the problem.

In XP, I still can use the debug mode to trace the execution, but in "non-debug" mode, XP will not give me the ASSERT information when it occurs.

Do I miss somthing in installing VC 6.0 in XP?
0
Comment
Question by:beender
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 50 total points
ID: 9688023
1) In any case ASSERT message contains information about assertion: source file and line number
2) If you run the program from Windows Explorer and not from Visual Studio, and it shows Assertion dialog, click Rerty, click Debug in the next dialog, and debugger is opened successfully in the new Visual Studio instance.
3) If you run the program from Visual Studio, you have a problem: instead of showing Debug window, it shows Exception Breakpoint window and closes the program. Solution: when Assertion dialog is shown, close Visual Studio instance from which the program was executed. Now click Retry, Close, and it works like in p.2.

Not so nice, but it works. Maybe somebody knows a better solution.
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 9688036
Correction in p.3:
Now click Retry, Debug, and it works like in p.2.
0
 
LVL 13

Expert Comment

by:SteH
ID: 9688565
What do you mean with non debug version? Since MSDN states:
[quote]
In the Release version of MFC, ASSERT does not evaluate the expression and thus will not interrupt the program. If the expression must be evaluated regardless of environment, use the VERIFY macro in place of ASSERT.

Note   This function is available only in the Debug version of MFC.
[/quote]
So I am a bit puzzled where the ASSERT comes from in a non debug (= Release?) build. But if a message box appears at least you should see the file and the line number to have a look at your code.

Another guess. In Release the program opens a new instance of Studio to debug the application. Have you selected the correct one?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 86

Expert Comment

by:jkr
ID: 9688567
See http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/winxppro/proddocs/drwatson_setup.asp on how to set up the debugging option. Just make sure to use

"<path to msdev>\msdev.exe" -p %ld -e %ld

as the "Debugger" value instead of 'drwtsn.exe'.
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 9688605
>> when I run the debug version of a program in "non-debug" mode...
This means: run the Debug version using Run and not Go command.

Setting of msdev as current debugger is done automatically during Visual Studion installation.
0
 

Author Comment

by:beender
ID: 9691403
AlexFM's p1, p2, p3 provides the concise answers to XP debugging problem. That leads me to dig more into IDE's debugging capability.

I found that bringing up the debugger when executing program (Ctrl+F5), not GO (F5) inside IDE is so-called Just-in-time debugging. Shame on me that I have been using VS 5.0/6.0 for many years in Win98, NT4, then Windows2000, and did not know this terminology. In Windows 2000, if you turn off Just-in-time debugging (Tools/Options/Debug tab), you will not be able to bring up the debugger when executing a program and encounter an assertion. I think it is a very neat feature for program developing, and I heavily rely on this feature.

Come to XP version. It seems to me that Microsoft enhances just-in-time debugging, but also introduce a bug (at least I do not know how to enable this JIT debugging while in IDE). But I observeed this JIT debug in IDE closely, and found that the debugger DOES come up showing call stack, disassembly, variables,... windows. Then for some reasons, it quits. Hopefully, it just requires some data and path settings, etc, and some one knows those settings.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question