Solved

Attaching the VC++ compiler/debugger to a process

Posted on 1997-10-16
6
581 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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 …
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

22 Experts available now in Live!

Get 1:1 Help Now