简体   繁体   中英

“ Attach to Process ” in Visual Studio 2005

I installed Visual Studio 2005 ( with SP1 ) and made the default settings as what is required for C++ .

Now i open a solution and run the exe . Under " Tools " menu item i go and Select " Attach the process " and i attach it to the exe i just ran . I put breakpoints several places in the code ( this breakpoints looks enabled ) and these are the places where the breakpoints should definitely be hit . But for some reason , my breakpoints are not hit .

PS : All pdb's are present in correct location .

Is there any setting i am missing .

Perhaps it is attaching to "the wrong kind" of code.

In the "Attach to Process" dialog, there is a setting that allows you to select the kind of code you want to debug. Try clicking "Select" button next to "Attach to" text box and checking only "Managed code" the relevant code type.

http://img204.imageshack.us/img204/3017/capture5ct4.png

Most of the time, leaving "automatically determine the type of code to debug" setting on works for me. However, in some cases, the debugger is not able to understand that I want to attach to managed code (if I have launched my application from a batch file, for example) and when it does that, the above solution works for me.

Are you in Debug mode? I've had this problem when I was trying to do it in Release mode. It doesn't complain, it just doesn't hit the breakpoints.

使用“ 模块”视图查看是否已加载exe / dll,如果未加载,则指定从何处加载PDB。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM