My test.c file:
#include<stdio.h>
int main() {
int myChar;
myChar = getchar();
printf("You entered: %c\n", myChar);
return 0;
}
compiled and run with cgdb:
$ gcc -g test.c
$ cgdb a.out
I input start, then input n, and I want to pass character 'A' to getchar().
cgdb shows:
(gdb) start
Temporary breakpoint 1 at [34m0x1169[m: file [32mtest.c[m, line 3.
Starting program: /home/test/code/a.out
Temporary breakpoint 1, [33mmain[m () at [32mtest.c[m:3
3 int main(){
(gdb) n
6 myChar = getchar();
(gdb) n
A
I got blocked at the getchar() when I use cgdb.
I input 'A' and Enter, but it didn't continue.
I don't have this problem with gdb.