Solved

Attaching the VC++ compiler/debugger to a process

Posted on 1997-10-16
6
584 Views
Last Modified: 2013-12-04
I've been trying to get my VC++ 5.0 debugger to attach to processes for months now.  I've reinstalled NT, formatted and reinstalled VC++ 5.0, and messed with configuration until the sun went down.  I've seen it done, I know it can be done.  I load up task manager and right click on a task and try to attach the debugger, and I get an error - file not found.  Unfortunately, some creep at Microsoft decided that WHICH file wasn't found was unimportant.  So, my question is, how do you attach the debugger to a .dll, service or other file that you've created with debug information?  I've tried using msdev -p PID, and it got into the disassembly, but I haven't gotten past that.  Any ideas?
0
Comment
Question by:vinniew
6 Comments
 
LVL 5

Expert Comment

by:y96andha
ID: 1407628
Have you enabled just-in-time debugging in the settings in MSVC?
0
 
LVL 5

Expert Comment

by:dirtdart
ID: 1407629
In Visual Studio, you can click the Build Menu, and move down to Start Debugging.  This will give you an option to attach the debugger to a process.  When you click this option, it will present you with a list of running processes that you can attach to.
0
 
LVL 3

Author Comment

by:vinniew
ID: 1407630
That's close to what I was looking for.  Yes, I've got the JIT debugging turned on.  Is there something I didn't install?  I did a 'typical' installation of VC++.

With regard to the attach to process function,

I haven't used that... What else do you have to have set up to use it?  Breakpoints?

0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 5

Expert Comment

by:dirtdart
ID: 1407631
I haven't done much with attaching it to a process I'm not debugging, but I think you just have to attach it, and then you can step through the process.  The only drawback, of course, is that if there aren't any symbols for the file, you will get the decompilation.
0
 
LVL 2

Accepted Solution

by:
mnguyen021997 earned 100 total points
ID: 1407632
the other thing you can do is simply place an ASSERT(0) in your code where you want to break and run it.  it will cause an exception and allow you to attach then.  also a "__asm int 3" will do the same
0
 
LVL 3

Author Comment

by:vinniew
ID: 1407633
I hadn't thought of that.  Thanks
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

821 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