TUI付のGDB
mingw-get.exeで取得したGDBでTUIを使おうとすると TUI mode not allowed と言われてしまうので、TUI付のGDBをインストールする。はずだったが。。。
ftp://sourceware.org/pub/gdb/releases/ で7.3.1をダウンロード。
./configure --enable-tui
make && make install
こうすればTUIが使えるものと思ったが、どうも違うらしい。
GDBのソースを見ると、TUIを使える条件は
/* Only if TUI is the top level interpreter. Also don't try to setup curses (and print funny control characters) if we're not outputting to a terminal. */
- TUIがtop level interpreter
- GDBの出力が端末になっている
調べてみたら、1つ目の条件はOK。2つ目が成立していないみたい。でもGDBのメッセージはちゃんと画面に出てきている。この画面は"terminal"じゃない、ということ???以下でそれが分かるはず。
#include <stdio.h> #include <io.h> int main(void) { if (isatty(fileno(stdout))) printf("isatty\n"); else printf("not isatty\n"); return 0; }
not isatty
はい、端末だと思われてません。msysを使っているせいだった。でもmsys使いたい・・・。msysを端末だと思ってもらうにはどうすれば良いか?