The Debug does not show output on the terminal - debugging

When I try to debug the Hello World in Microsoft Visual Studio Code, it did not print "Hello World" on the Terminal. How can I to fix it?

Have a look at the Debug console tab next to Terminal.

Related

Interpreting F# files with Mono

After installing F# on OS X with Homebrew, In Haskell (with GHC), it's possible run code on an interpreter. I was wondering if there is a way to run files without compiling them first in F#? Maybe with fsharpi?
Just to clarify, I do not mean the REPL itself, but running an app without intermediary files.
You can use fsharpi which is an interactive mode for F#. You can just start fsharpi and then type F# code in the console that starts:
> 1 + 1;;
val it : int = 2
You can also write your code in a fsx file and pass it to fsharpi to have it executed. Say you have demo.fsx with:
printfn "Hello world"
You can then run fsharpi demo.fsx and it should print hello world for you!
Some people use F# from command line in this way, but it gets more productive if you setup your favorite editor to use F# - then you can type code directly in the editor and send it to F# Interactive using some command. There are good plugins for Atom, Emacs, vim, Sublime and others - see the links here.
PS: It is worth adding that F# Interactive does not actually interpret the code. It compiles it on the fly and runs it, so it has the same performance profile as compiling the code in the usual way.

Ruby debugger fails on STDIN.gets user input

I believe you can easily reproduce the issue.
Just take a fresh RubyMine (7.1) — either Mac or Windows version, Ruby 2.2, create simple script:
puts "Hi, i'm gonna break your debugger :)"
user_input = gets
puts "Here should be breakpoint"
Put the breakpoint on the 3-rd line and run Debug session (RubyMine uses ruby-debug-ide gem).
When you type something in RubyMine console window for the script to read in gets — program doesn't eat your input saying:
Could not execute statement: current stack frame is unavailable. Pause
the process to use console interpreter
What's going on here and how can you debug such Ruby scripts?
This appears to be a RubyMine quirk. If you disable the console prompt by clicking on the 'Show Console Prompt' icon in the debug pane this should start working as you expect
See attached Screenshot if you are struggling to find the 'Show Console Prompt'enter image description here

debugging go with gdb - log.Println stops gdb

When I debug with gdb and hit a line with log.Println("WhatEver")
gdb is just on a new blank line. How do I get back to gdb?
Thanks

Why does SciTe open a DOS window on questions that require user input?

The SciTE editor will run Ruby programs for me if I press F5. But when I try to run a program that requires user input (using "gets"), it doesn't work. A black window with a blinking cursor pops up, but when I try to type in it, nothing happens. Running the same programs from the windows command line works fine.
I use the Scite editor version 2.27 and Ruby 1.9.2-p290.
Am I doing something wrong? What can I do to fix this?
ETA: Turns out the DOS window does nothing, and if I minimize it, I can type right into the output window. Modified question: How do I make the DOS window stop popping up?
It's 'normal'
Some problems you have (I think) and the solutions:
Your output is not displayd before the script ends. So you don't know what happens. Solution: STDOUT.flush
Your input is not expected in the DOS-windows, but in the output pane. Solution:Enter your answer in the output pane.
You get a DOS windows. Solution: Rename your script from 'XYZ.rb' to 'XYZ.rbw' (see the 'w').
My test script:
puts "In scite: Please answer in Output pane"
puts "User input:"
STDOUT.flush
input = STDIN.gets
puts "You entered #{input.inspect}"

How to debug/execute a Ocaml program step by step?

I am wondering if it is possible to debug/execute a Ocaml program step by step, for instance like debugging C++ programs in Visual Studio. In other words, I would like to run a Ocaml program line by line, also it would be great if we could "watch" the value of some variables.
By the way, I am using Emacs as editor.
Could anyone help? Thank you very much
Edit-1: As sepp2k suggested, I am trying to run camldebug under Emacs. I have a problem in the beginning: the web page mentions "The Caml debugger is started under Emacs by the command M-x camldebug, with argument the name of the executable file progname to debug." Actually I have only 3 choices:
M-x camldebug
M-x camldebug-mode
M-x camldebug-step
Edit-2: When I type M-x camldebug, enter, it shows Symbol's value as variable is void: caml-mode-map which does not allow me to enter the executable file.
Could anyone help? Thank you!
You can step through the code using the debugger ocamldebug, which can be run in emacs.
The documentation is telling you to supply the executable file's name to camldebug. You can do this by M-x camldebug, then press enter, and then type in the path of the executable when emacs prompts you for it.

Resources