0

I'm using Emacs and gdb to debug a c++ program that uses conio's getch. Something like the following:

#include <conio.h>

int main(){
  int c = getch();
  cout << (char) c;
}

If I place a breakpoint in the first line of the main, gdb hangs and nothing happens. I don't think a input file (run < input.txt) would work.

How should I debug it?

Tiago Dall'Oca
  • 329
  • 3
  • 15

1 Answers1

0

set new-console on will open a new terminal which you can type in and getch will work.

Other methods might work too, but I think that this one is fine.

Tiago Dall'Oca
  • 329
  • 3
  • 15