Solved

VC Debugging Problem in XP

Posted on 2003-11-05
6
358 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Turn a spreadsheet into a vba executable. 2 85
windows 10 how make picture as desktop background 2 62
tripleUp challenge 7 78
Problem to open Excel file 15 130
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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

806 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