Can you connect the Visual Studio debugger to IronPython Tools? - visual-studio-2010

I use IronPython for a lot of debugging, and I usually attach my Visual Studio debugger to ipy.exe, then import and use a .NET assembly to step through my code. However, I find that the IronPython Interactive extension for VS2010 is more fully-featured than the ipy.exe shell, and I would like to know whether it is possible to attach the debugger to the extension. Thank you!

Right click on the project file (not the solution) Proprieties/ Debug.
Then you should select "Standrad Python Louncher" for launch mode. It will use the ipy.exe, for interpeter, just you can debug easier.
You sould make visible the "Python Debug Interactiv" from Debug menu

Related

On Visual Studio 2019, how to debug pure C++ and CLI C++ in a C++ Debug program?

I want to debug a C++ MFC/CLI program developped on Visual Studio 2019.
Until now, I can debug C++ native (MFC) code.
DebugType in Debug panel is set to Auto.
All breakpoints in C++/CLI modules are flagged as inactive (a red circle with an interrogation character in a yellow triangle).
After having changed DebugType from Auto to 'Mixed (.Net Framework), Visual Studio, when starting a debug session, is displaying following warning box.
But my build is in DEBUG mode !
What is happening ?
What must I do to debug pure C++ AND CLI C++ code ?
PS: I have also tried to debug in only C++/CLI code, but Visual Studio 2019 is displaying same message !
On Visual Studio 2019, how to debug pure C++ and CLI C++ in a C++
Debug program?
Since I do not have your project and cannot troubleshoot the issue quickly unless you provide a sample.
You can try the following suggestions:
Suggestions
1) try to reset all settings by Tools-->Import and Export Settings-->Reset All Settings
2) disable any third party extensions under Extensions-->Manage Extensions in case one of them causes the behavior.
3) check Use Managed Compatibility Mode option, Enable .NET Framework source stepping option and Suppress JIT optimization on module load (Managed only) option under Tools-->Options-->Debugging-->General.
4) close VS, delete .vs hidden folder, Debug folder from the solution folder and also Debug folder in the project folder. Then restart your project to test again.
I'm putting this here because it might help someone in the future, and because it's completely nuts.
I've followed all instructions I could find, including the ones on this question, reinstalled VS twice, with different versions, and nothing.
What solved for me was to simply delete the lines of code and write them again.
Yes.
I know.

Custom Visual Studio Debug Engine for Simulator

I have a requirement for developing a debugger extension for Visual Studio. The code is in C++, however, it is run in a simulator environment. The application is capable of receiving break points and displaying variable information.
I have looked into the Concord API, but it seems rather complex. Do I have to develop an Expression Evaluator, even though the code is in C++?
Basically I just want the program to run and hit the breakpoints that the user has created for starters.
Should I try and write a visual studio extension instead? Although I don't see any way of halting execution of a program in debug mode?
Thanks
Ah the joy of writing a custom debugger! I'm writing one now. See the visual studio custom debug engine sample to start with. Python Tools for Visual Studio, MIDebugEngine are more complex but also more complete and production code. Much easier to write the debugger in C#.
Some blogs that helped me a lot.
https://limbioliong.wordpress.com/2011/08/30/creating-a-com-server-using-c/
https://blogs.msdn.microsoft.com/jmstall/2009/07/09/icustomqueryinterface-and-clr-v4/
VS2005 SDK PDF has more detailed debugger documentation.
VS2015/17 C# Extension projects has a custom project type package which comes with a script debugger launcher to start with.

Can we debug a program in cmd rather than in Visual Studio IDE?

In Visual Studio 2015 IDE, we can debug a C# or C or C++ program.
Without the IDE, in cmd instead, how can we debug a program? Thanks.
The CLR debugger or MDbg is the tool I used to debug app in command line. But they also have some limitations more or less.
For example, not all projects/developing languages are supported by them.
Other workaround is that you could think about using other Editor instead of the CMD if you don't have the VS Environment like the VC code or the Windbug or others.

My F# code doesn't run, how can I investigate further?

I downloaded Visual Studio Community 2015 to try and lean F#. My F# projects compiles without any issues but when I try to launch the console project (even the default console project) Visual Studio just hangs and then freezes. The only way I have to shut it down is to go to the task manager.
Same thing if I try to directly launch the generated .exe file: explorer freezes and I have to go to the task manager to restart it.
All my C# projects work fine...
I have seen a similar behavior before on a machine that had an anti-virus installed. The anti-virus was blocking Visual Studio from running F# code with debugger and disabling the anti-virus resolved the issue.
In general, there are a few ways to run F# code in Visual Studio:
Using F5 to start the program with a debugger (this is the one that the anti-virus was blocking); F11 which steps into the debugger was also not working
Using Ctrl+F5 which starts the program without a debugger - this should work!
By creating an F# script file (Script.fsx), selecting code and using Alt+Enter to run code using F# interactive - this should work too.
Many people do quite a lot of work with F# using F# Interactive, so learning how to use that is a good skill, but to use the debugger, disabling anti-virus should do the trick.

Debugging IronPython in Visual Studio

I'm using Visual Studio 2012 to debug my IronPython program. I've got IronPython and PyTools installed already.
While debugging, when I hover over a variable, say tenants_path, the value that's shown is IronPython.Runtime.ClosureCell. Why is this happening?
To rectify this issue, I needed to right click on the solution, and choose Properties.
In the General tab, ensure that Interpreter is set to IronPython 2.7.
In Debug tab, ensure Launch mode: is set to Standard Python launcher.
IronPython doesn't generate debugging information for its generated code by default, so VS just does the best it can.
If you're running ipy.exe, then you should run with the -X:Debug command-line option; if you're embedding, you'll need to pass "Debug" as true when creating the engine.

Resources