简体   繁体   English

我可以为C#创建自己的JIT \\ Interpreter \\ Compiler并在Visual Studio中使用它吗?

[英]Can I make my own JIT\Interpreter\Compiler for C# and use it in Visual Studio?

I am currently writing a compiler that produces JIT-like EXE from C# (rewrites itself), is there anyway to make Visual Studio and it's debugger recognize the way I want to build it (with my compiler) and debug the output? 我目前正在编写一个从C#生成类似JIT的EXE(重写自身)的编译器,无论如何都要使Visual Studio和它的调试器识别我想要构建它的方式(使用我的编译器)并调试输出?

My compiler's output is EXE, but it doesn't contain MSIL, it contains my intermediate language, and the rest of the content is the JIT written in C++. 我的编译器输出是EXE,但它不包含MSIL,它包含我的中间语言,其余内容是用C ++编写的JIT。 (The C++ reads itself\\EXE and executes) (C ++自己读取\\ EXE并执行)

I am well-aware it's not magic to make it compatible; 我很清楚让它兼容并不神奇; I am here to get a straight answer whatever it's possible and hints to start; 无论有什么可能,我都会在这里得到一个直接的答案并提示开始; eg write a C++ DLL with such functions and parameters and give the DLL path to Visual Studio's debugger parameters, or just point me to reference at MSDN. 例如,编写带有这些函数和参数的C ++ DLL,并给出Visual Studio调试器参数的DLL路径,或者只是指向我在MSDN上的引用。 (I got zero promising results from Google) (我从谷歌那里获得了零结果)

It appears that what you want to do is possible. 看来你想做的事情是可能的。 The relevant sections of MSDN would be : MSDN的相关部分将是:

The Visual Studio integrated development environment (IDE) provides the user interface (UI) for standard components, such as compilers, editors, and debuggers. Visual Studio集成开发环境(IDE)为标准组件(如编译器,编辑器和调试器)提供用户界面(UI)。 Features like Visual C++ and Visual Basic that are included with Visual Studio are themselves extensions of the IDE. Visual Studio附带的Visual C ++和Visual Basic等功能本身就是IDE的扩展。 The Visual Studio SDK provides tools, samples, wizards, designers, and documentation that helps you develop your own applications that extend the IDE and integrate seamlessly with it. Visual Studio SDK提供了工具,示例,向导,设计器和文档,可帮助您开发自己的应用程序,以扩展IDE并与其无缝集成。

Pay particular attention to : 特别注意:

Visual Studio includes a fully interactive source code debugger, providing a powerful and easy-to-use tool for tracking down bugs in your program. Visual Studio包含一个完全交互式的源代码调试器,提供了一个功能强大且易于使用的工具,用于跟踪程序中的错误。 The debugger has complete support Visual Basic, C#, C/C++, and JavaScript. 调试器完全支持Visual Basic,C#,C / C ++和JavaScript。 However, with the Visual Studio SDK, that is available from the Microsoft Download Center,, other programming languages can be supported in the debugger with the same rich features. 但是,使用可从Microsoft下载中心获得的Visual Studio SDK,调试器中可以支持具有相同丰富功能的其他编程语言。

Also take note of the Language Services section - this describes means to add support for a new language to visual studio. 另请注意Language Services部分 - 这描述了向visual studio添加对新语言的支持的方法。 In particular, you can also add debug support for the language. 特别是,您还可以为该语言添加调试支持。

see : Language Service Support For Debugging 请参阅: 语言服务支持调试

The type of compiler determines what you need to do to implement debugging for your language. 编译器类型决定了为实现语言调试需要执行的操作。 If your compiler targets the Windows operating system and writes a .pdb file, you can debug programs with the native code debugging engine that is integrated into Visual Studio. 如果您的编译器以Windows操作系统为目标并写入.pdb文件,则可以使用集成到Visual Studio中的本机代码调试引擎来调试程序。 If your compiler produces Microsoft intermediate language (MSIL), you can debug programs with the managed code debugging engine, which is also integrated into Visual Studio. 如果编译器生成Microsoft中间语言(MSIL),则可以使用托管代码调试引擎调试程序,该引擎也集成到Visual Studio中。 If your compiler targets a proprietary operating system or a different runtime environment, you need to write your own debugging engine. 如果您的编译器针对专有操作系统或不同的运行时环境,则需要编写自己的调试引擎。

Emphasis mine - ie: you can debug anything you want, but you will need to write the debugger yourself. 强调我的 - 即:你可以调试你想要的任何东西,但你需要自己编写调试器。

You'll probably want to download the Visual Studio SDK . 您可能希望下载Visual Studio SDK

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 JIT编译器是编译器还是解释器? - Is JIT compiler a Compiler or Interpreter? 如何在 C# 中进行自己的活动? - How can I make my own event in C#? 如何在 visual studio 中制作我的表单以记住 C# 中 5 个按钮中最后检查的 ReadioButtom? - How can I make my form in visual studio to remember the last checked ReadioButtom among 5 buttoms in C#? 当 Visual Studio 调试器评估值时,我可以让我的 C# 代码在断点处停止吗? - Can I make my C# code stop at breakpoint when Visual Studio debugger is evaluating the value? Visual Studio的C#interpreter加载项 - C# interpreter add-in for visual studio 如何在Visual Studio 2017中使用“C#Interactive”窗口查询“数据连接”中的源代码 - How can I use, in Visual Studio 2017, the “C# Interactive” window to query a source in my “Data Connections” 如何在 C# (Visual Studio) 中进行热键控制 - How can I make Hotkey control at C# (Visual Studio) 有没有办法在Visual Studio 2008中使用2005 C#编译器? - Is there any way to use the 2005 C# compiler in Visual Studio 2008? 强制Visual Studio 2012使用旧的C#编译器 - Force Visual Studio 2012 to use old C# compiler 将我自己的C#项目配置添加到MSBuild / Visual Studio中 - Adding my own configuration for a C# project into MSBuild / Visual Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM