创建或加载自定义项目类型时,有什么方法可以触发调试器加载项? [英] Is there any way I can trigger my debugger add-in when my custom project type is created or loaded?

查看:69
本文介绍了创建或加载自定义项目类型时,有什么方法可以触发调试器加载项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨-

我有一个要添加到Visual Studio的自定义语言和项目系统,并创建了一个加载包,该加载包既加载调试器扩展(由DKM调试引擎构建),又安装自定义项目类型(通过ProvideProjectFactory)属性 在package类上,并且还从ProjectPackage继承了这个类,而不仅仅是Package.)

I have a custom language and project system that I am adding to Visual Studio and have created an add-in package that both loads a debugger extension (built off the DKM debug engine) and installs a custom project type (via the ProvideProjectFactory attribute on the package class, and also inheriting this class from ProjectPackage and not just Package).

vsdconfig机制将调试器扩展配置为侦听本地Windows模块加载的时间,如果将适当的项目类型加载到Visual Studio的实验调试实例中,则可以触发扩展中的断点 并在调试器下运行它.  但是我有兴趣激活调试器扩展,不是在用户执行加载的项目时,而是在项目本身实际加载时.  原因是我想实例化我的核心 语言运行时,并由正在调试扩展的原始Visual Studio实例的调试器对其进行调试.  本质上,我希望能够将我的语言运行时以及VSIX包本身作为VSIX扩展的一部分进行调试.  我还希望我的自定义项目类型的用户不要对我的语言的运行时显式可见,而是完全在后台加载和操作.

The debugger extension is configured by the vsdconfig mechanism to listen for when native Windows modules get loaded, and I can trigger breakpoints in the extension if I load an appropriate project type into the experimental debug instance of Visual Studio and run it under the debugger.   But I am interested in activating the debugger extension not when the user executes a loaded project, but when the project itself is actually loading.   The reason for this is that I would like to instantiate my core language runtime at this time and have it debugged by the original Visual Studio instance's debugger that is debugging the extension.   In essence I want to be able to debug my language runtime along with the VSIX package itself as part of the VSIX extension.  I also want my language's runtime not to be explicitly visible to the user of my custom project type, but loading and operating entirely in the background.

不知道其中有多少有意义,但是如果该机制确实支持的话,我可以想象有两种方法可以完成.  如果事实证明我的调试器扩展只能在实验实例自己的调试器时才能激活 被激活,那么我可以想象能够通过启动并执行后台进程来操纵实验实例的自动化对象来实现这一目标.  但是如果事实证明调试器扩展将在以下情况下激活 任何本地Windows模块都会启动,而与它是否是执行实验实例的调试器的一部分无关,那么我可以想象,无论何时创建或加载我的一个项目,都直接从我的项目工厂启动一个模块,并且 让它在我的调试器扩展中触发Breakpint.

Don't know how much of this made sense, but there are a couple of ways I could imagine accomplishing if the mechanism does indeed support it.   If it turns out that my debugger extension can only be activated when the experimental instance's own debugger is activated, then I could imagine possibly being able to manipulate the experimental instance's automation objects to make this happen by launching and executing a background process.  But if it turns out that the debugger extension will activate when any native windows module is launched, independent of whether it happens as part of executing the experimental instance's debugger, then I could imagine launching a module directly from my project factory whenever one of my projects is created or loaded and having it trigger a breakpint in my debugger extension.

再一次,不确定其中是否可以理解,但是如果某个善于调试器扩展的人比我能帮助我理解调试器扩展的实际激活方式,我将不胜感激 并认真对待您的债务.

Once again, not sure if any of this is intelligble, but if some kind soul who has better understanding of debugger extensions than I could take a shot at helping me understand how debugger extensions are actually activated, I would be enormously grateful and seriously in your debt.

非常感谢.

此致

迈克

 


推荐答案

还有一件事情:

One more thing:

我在上面的消息中没有解释的一件事是,我在调试语言运行时时需要激活调试器扩展,因为语言运行时本身是通过将intel汇编语言字节写入内存然后执行来执行的 一旦它们足够地启动了执行引擎,它们就会启动.  显然,Visual Studio调试器无法在没有一些其他帮助的情况下以这种方式在内存代码上使用断点,这是我想在 调试器扩展.

One thing that I didn't explain in the message above is that I need the debugger extension to be active when I debug my language runtime, because the language runtime itself is executed by writing intel assembly language bytes to memory and then executing these once they've sufficiently bootstrapped an execution engine.   Apparently the Visual Studio debugger is not equipped to work with breakpoints on in-memory code this way without some additional help, which is part of what I want to implement in the debugger extension.

这是一个整体元维度,有些让人头晕.可能会发现,为了在调试器扩展程序的上下文中调试语言运行时,我一直在讨论,对于原始程序,我将需要一个调试器扩展程序 启动了VSIX程序包和实验实例的Visual Studio,到目前为止我一直在讨论的程序包扩展中所做的一切,仅对调试在实验实例的调试器下执行的程序有所帮​​助.

There's a whole meta- dimension to this that is somewhat head twisting.  it may turn out that in order to debug my language runtime in the context of the debugger extension I have been discussing that I will need a debugger extension for the original Visual Studio that launched my VSIX package and the experimental instance and that anything I do in the package extension I've been discussing so far will only be of help in debugging programs executed under the experimental instance's debugger. 

要谈论这个问题,而又要听起来毫无希望地感到困惑.  我想我不是,但是我确实需要更好地了解调试器扩展的激活方式.

It's hard to talk about this without sounding hopelessly confused.  I don't think I am, but I do need a better understanding of how debugger extensions get activated.


这篇关于创建或加载自定义项目类型时,有什么方法可以触发调试器加载项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆