How do I attach a specific debugger engine to a process I launch?


Hmmm! Looks like someone is feeling lonely. No seriously, this is an area where the doctor does not have very many recommendations. Visual Studio 2003 Debugger object model does not expose any way to specify a specific debug engine to be used when attaching to or launching a process under the debugger. This might change in future releases of Visual Studio.


 


If you are a Visual Studio Package then you can specify the debug engine to use when debugging a process. Here is what you need to do:


·          Query for the SVsDebugger service and get the IVsDebugger interface


·          Allocate and initialize a VsDebugTargetInfo structure with appropriate values


·          Set the VsDebugTargetInfo.clsidCustom member to choose the debug engine of choice.


·          You can view debug engine GUIDs from EnvSDK\common\inc\msdbg.h. See code snippet  below


·          Call IVsDebugger::LaunchDebugTargets passing the VsDebugTargetInfo structure created above


 


//from msdbg.h


extern GUID guidScriptEng;


extern GUID guidSQLEng;


extern GUID guidCOMPlusNativeEng;


extern GUID guidCOMPlusOnlyEng;


extern GUID guidNativeOnlyEng;


extern GUID guidMsOrclEng;


extern GUID guidEmbeddedCLREng;


 


See the FigPkgs\FigPrj sample for more information.


 


Thanks


Dr. eX


Comments (3)
  1. John Lewicki says:

    Wow I didnt know IVsDebugger existed! Is there any documentation for that interface (and related types) besides vsshell.idl and the VSIP samples? It doesn’t seem to be listed in the help file that shipped with the VSIP SDK.

    Thanks!

  2. Annoymous coward says:

    Ok, I launch IE and I want to debug javascript. So I guess I use guidScriptEng, right?

    I have my own custom project type. How does VS.Net knows how to map a break point I set on an html page with that request so I can debug the javascript interactively?

    I’m missing something here.

  3. Chetan N. Parmar says:

    Hi John,

    Sigh! I wish I had a good answer. Unfortunately the IDL file is the best source at this moment. The doctor is doing all he can to get these in for the future release.

    Thanks

    Chetan N. Parmar(MSFT)

    VSIP Team

Comments are closed.

Skip to main content