Link to home
Start Free TrialLog in
Avatar of vinniew
vinniew

asked on

Attaching the VC++ compiler/debugger to a process

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?
Avatar of y96andha
y96andha

Have you enabled just-in-time debugging in the settings in MSVC?
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.
Avatar of vinniew

ASKER

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?

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.
ASKER CERTIFIED SOLUTION
Avatar of mnguyen021997
mnguyen021997

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vinniew

ASKER

I hadn't thought of that.  Thanks