How can i debug in visual studio as command line? - visual-studio

I hav my execuatable produced by command line building.
I want to debug it in command line itself as like as gdb does in linux.
Also i want run my program in Visual studio GUI from command line options..
How can i do that?

Make sure it is compiled in the debug version. Run the program. Then "Attach to Process" from VS tools menu.
You can also specify the runtime options when running the debugger (it's in the project properties).

I don't think that VS has a pure command line mode, but you could use CDB/NTSD.
http://msdn.microsoft.com/en-us/library/cc266320.aspx
It is what lots of developers at MS do.

Related

How to run VS Code program on command prompt?

New to both VS Code and Visual Studio... When I run my C# program in Visual Studio, the command prompt opens and the program is run there. In VS Code however, the program is run in the integrated debug console.
Is there a way I can set VS Code to open up cmd prompt and run my program there, rather than the VS Code debug console?
Thanks.
Go to settings and search "Terminal: Explorer Kind". Then set it to external select external.

'psxevars command not found' when enabling Intel Fortran

I installed the non-commercial intel Fortran 2018 in Windows 10. According to the starting guide, I should run psxevars.bat. But when I typed 'psxevars' in cmd. It showed 'psxevars command not found'. So I used another way, double clicking it in windows. Then I try ifort in cmd. It doesn't work. It showed 'ifort command not found'. How can I make it work? Btw, I used the cmd in the product group from start menu.
First, make sure Visual Studio (e.g. Visual Studio Community 2015 version) is installed before installing Intel Parallel Studio.
After installing Intel Parallel Studio successfully, a "command line prompt" should be listed at the start menu like this:
There is no need to run psxevars.bat because the installing process has already done this for us.
Another situation might be that we try to use Intel tools in Windows command-line prompt through the cmd command. In this case, we need to run psxevars.bat. And do not forget to specify two arguments, arch and vs, as shown in below.
And notice that it only takes effects in this command-line window, i.e. the same running need to be done for every cmd command-line prompt.
an eternal way is to set the environment variable. Add directories containing Intel tool executables to the "PATH" environment variable, and other related things(libs, include).
On Windows, I recommend using Intel Parallel Studio with the Visual Studio IDE.

Debug VC++ app in command line

Is it possible to debug a vc++ application in command line? I mean, is there any windows dos debugging tool like gdb that I can use to debug a vc++ application in command line (DOS)?
Have you tried the .NET Framework Command-Line Debugger? If you have the Visual Studio IDE installed, open the command prompt from the VS Tools, and you're good to go.
http://msdn.microsoft.com/en-us/library/ms229861.aspx
And another option: http://msdn.microsoft.com/en-us/windows/hardware/gg463009.aspx

Build from command line in Codegear 2009 IDE

Is it possible to automagically generate a MAKEFILE from the Codegear 2009 IDE? Or build a project from the command line?
No, but depending on your objective, you may be able to do what you want. If you simply want to do a build from a command line, this is possible. Because CB2009 uses msbuild, you can drive a build which uses all the same options and settings as an IDE build. There is a rsvars.bat file which sets all the environment variables you need and a shortcut to this batch file installed in the start menu called "RAD Studio Command Prompt" Once those are set, you can then call:
msbuild yourProjectFile.cbproj
This can then be integrated into a make system, continuous integration tool, or other automation.

Env vars for Visual Studio command prompt

I'm doing an RDP into a machine that has just the CLR installed, and doesn't have Visual Studio on it. Can I somehow load all the Visual Studio-specific environment variables on to the regular command prompt and convert it into the VS command prompt so that I'm able to build my projects via command line?
I looked at the vcvarsall.bat file. That calls the appropriate processor-specific batch file. Couldn't get any inputs from there.
Short of installing all VS, or tracing thru all the various batch files to find out what's getting set, you may be able to simply capture the env vars that are set.
Open up a VS command prompt, and run set > vars.bat
Then open up vars.bat, and put a set command in front of each line.
Not sure how much this will help, since you're going to be missing all the utilities that come with Visual Studio, but it does answer your question.
I don't recommend trying to copy only what you need. You'll need other header files, libraries, dlls, etc... You can instead install VS express edition.
If you are trying to debug a problem you can use remote debugging in Visual Studio or use WinDbg on the computer.

Resources