0

I have a program that I compiled with clang++ -Wall -g, and it runs when I just do ./a.out. It asks me for my input and then computes some stuff.

However, when I try debugging it with LLDB, the run command doesn't ask for an input. I just did:

lldb a.out

run

The run command gets stuck and doesn't take any input through cin.

What am I doing wrong?

ESCoder
  • 15,431
  • 2
  • 19
  • 42
henhao
  • 1
  • 2
  • What happens if you set a breakpoint to `main()` and start to single-step? – the busybee Apr 02 '20 at 05:42
  • This works in general, so there must be something either about your code or the terminal/console you are running in. There's not enough detail in your question to know what might be going on, however. One common mistake if you are using Xcode is that there's a little selector under the Xcode Debugger Console that toggles between "Debugger Output/Target Output/All Output". Make sure that hasn't gotten set to "Debugger Output" which explicitly filters out I/O from the target in the console. – Jim Ingham Apr 02 '20 at 18:01

0 Answers0