Solved

VC Debugging Problem in XP

Posted on 2003-11-05
6
352 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Strange date stored 22 100
Add content to output file 4 58
sumHeights  challenge 17 61
unix example issues 18 49
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…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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 video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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

11 Experts available now in Live!

Get 1:1 Help Now