Solved

VC Debugging Problem in XP

Posted on 2003-11-05
6
355 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need Help INsttalling wget on Mavericks OS X 3 90
Strange date stored 22 106
how do i create updater to My Activex application? 3 79
Looking for a specific application/software 2 104
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

943 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

Need Help in Real-Time?

Connect with top rated Experts

4 Experts available now in Live!

Get 1:1 Help Now