You do not see the result because stdout (FILE *) has an output buffer. It does not display any data until the buffer is full or "\ n" is encountered.
so call printf like this:
(gdb) call (int)printf("%d\n", 6) 6 $6 = 2
BTW, "$ 6 = 2", which is the result of printf.
iCoder
source share