locked
Register Debug Engine when loading Platform files RRS feed

  • Question

  • Hello,

    I have a custom MSBuild Platform configuration which I would like to create a Debug Engine for.

    I am working on Win7 and targeting VS2010.

    The platform configuration is stored within a repository so that no installation is needed to use the platform. Instead our vcxproj files are configured to load the Microsoft.Cpp.props and Microsoft.Cpp.targets from the repository. These files have been modified to look within the repository for requested platforms.

    Given this setup I would like the Debug Engine to register with VS when a project is launched which uses the platform definition.

    I have gone through the Sample Debug Engine from here:
    http://archive.msdn.microsoft.com/debugenginesample

    As well as the Project System walkthroughs:

    http://msdn.microsoft.com/en-us/library/vstudio/cc512961.aspx

    http://msdn.microsoft.com/en-us/library/vstudio/cc826178.aspx


    They suggest to me that this should be possible if I can get a .pkgdef or .vsct file to load while the platform definition is being loaded. With something like VSCTCompile put in the platform .targets file. The samples I have found either create a menu or menu item to launch the debug Engine or are a fully installed project system with templates etc.

    Ideally I would like to be able to place the dll for the Debug Engine in the same place as the other platform target dll and config files and perhaps with another config file register the Debug Engine when the platform is loaded. The end result will be that the Debug Engine is launched when debugging a project (for example with F5)

    Could someone please let me know how I can achieve this?


    • Edited by PCavaco Friday, February 8, 2013 2:57 PM
    Friday, February 8, 2013 12:48 PM

All replies

  • VS didn't provide this extension, AFAIK.

    Ghost,
    Call me ghost for short, Thanks
    To get the better answer, it should be a better question.

    Monday, February 11, 2013 8:38 AM
  • Hi,

    Seems you want to learn how to register a Custom Debug Engine to VS. I think you can view the article below:

    http://msdn.microsoft.com/en-us/library/bb147122.aspx

    Best regards,


    Ego [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, February 15, 2013 12:04 AM
  • Hello thank you for your response


    Are there some other walkthroughts or samples I could look at? As stated above I have been working through the Project System walkthrough and have been looking at the Debug Sample Engine extensively.

    I am implementing my Debug Engine in C# since it is most samples I have found do as well and because of some existing utilities in C#.

    A solution based only on C#  would be preferred to keep things simple and to avoid an extra project just for registering the classes (as done in the Debug Sample Engine). Perhaps similar to this http://blog.blackhc.net/2008/09/visual-torquescript-3/

    I would be ok with settling with a method like in the Debug Sample Engine except that the sample has never worked for me despite reading all of the messages on the download page and Jackson Davis' related blog articles.

    Perhaps I am lacking some prerequisite experience but the steps described in http://msdn.microsoft.com/en-us/library/bb147122.aspx are not  very helpful. I can see that it is C++ code but what I am missing is how does it need to be written or compiled to trigger the registry registration? Would it be a matter of compiling a dll with the SetMetric instructions and calling regsrv32 with the dll as argument?

    At the moment I am leaning towards writting my own .rgs file for my Debug Engine and loading that to the registry.

    It seems clear enough to me that I need to register the CLSID of my Debug Engine as well as register it with the AD7Metrics/Engine as per
    http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/11a3fb55-f3bc-45b2-a5c0-d80c69846802/

    What is still missing is a workable way of doing this that doesn't require manually maintaining a rgs or manually changing the registry.

    Friday, February 15, 2013 6:48 PM
  • Hi,

    I will involve some experts into this issue to see whether they can help you out. There might be some time delay, appreciate for your patience.
     
    Thank you for your understanding and support.
     
    Best regards,


    Ego [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, February 18, 2013 9:21 AM
  • There is an older tutorial online for implementing a debug engine (in ATL)

    http://msdn.microsoft.com/en-us/library/bb147024(v=vs.80).aspx

    I don't know of any samples that don't register the COM objects that implement the debugger interfaces and use the SetMetric calls to register debugger features.

    Thursday, April 4, 2013 8:44 PM
  • This isn't a supported scenario. Debug engines cannot be temporarily registered/unregistered. The registry hive used by the IDE is volatile, and if it wasn't there when the IDE was invoked, it will not ever see the changes you make (until you rerun the IDE with something like /setup).

    If you want to effect which debugger is launched for a specific configuration, you'll need to do this from the project system itself. With C# or VB, that would entail implementing a project subtype (aka flavor), but I'm not sure if that can be done with the C++ project type.

    Basically you have to aggregate and override the base project types IVsDebuggableProjectCfg to get control of the how/where the project type launches the debugger (IVsDebuggableProjectCfg.DebugLaunch).

    Sincerely,


    Ed Dore

    Friday, April 5, 2013 4:41 AM