For some reason your gdb doesn't support the tty command
[debug]> tty /dev/pts/0
[debug]Undefined command: "tty". Try "help".
Why do you use 7.12.50.xxxx? As far as I know these are development snapshots.
Can you try to install 7.12 or 7.12.1?
These are known to work correctly with codeblocks.