2012-02-08 242 views
1

我刚试过在升级到Ubuntu 11.10后调试我的C++程序,并且它出现了我正在运行的gdb版本(7.3)因调试输出而中断。调试时GDB崩溃 - 无控制台输出?

会发生什么:

我打调试,控制台窗口弹出时,出现在顶部的消息:

warning: GDB: failed to set controlling terminal: Operation not permitted 

我没有得到任何来自性病::法院调用输出,甚至只是一个

std::cout << "hi" << std::endl; 

任何人都可以提供帮助吗?我试图谷歌主题,并提出了很多类似的问题,但没有涉及到这种特殊症状,以及如何解决它。我确定我有最新版本的GDB等。

附录:我使用Code :: Blocks作为我的ide。

一个全命令行输出重建我的项目给出了:

--------------清洁:调试中DungeonCrawlerCPP ------------ ---

Cleaned "DungeonCrawlerCPP - Debug" 

-------------- Build: Debug in DungeonCrawlerCPP --------------- 

g++ -Wall -fexceptions -g -fpermissive -std=gnu++0x -Iinclude -c /home/reedja/CPPProjects/DungeonCrawlerCPP/main.cpp -o obj/Debug/main.o 
g++ -Wall -fexceptions -g -fpermissive -std=gnu++0x -Iinclude -c /home/reedja/CPPProjects/DungeonCrawlerCPP/src/ActionableObject.cpp -o obj/Debug/src/ActionableObject.o 
/home/reedja/CPPProjects/DungeonCrawlerCPP/src/ActionableObject.cpp:1:9: warning: #pragma once in main file [enabled by default] 
g++ -Wall -fexceptions -g -fpermissive -std=gnu++0x -Iinclude -c /home/reedja/CPPProjects/DungeonCrawlerCPP/src/AppSettings.cpp -o obj/Debug/src/AppSettings.o 
/home/reedja/CPPProjects/DungeonCrawlerCPP/src/AppSettings.cpp:1:9: warning: #pragma once in main file [enabled by default] 
/home/reedja/CPPProjects/DungeonCrawlerCPP/src/AppSettings.cpp: In member function ‘void AppSettings::load(const char*)’: 
/home/reedja/CPPProjects/DungeonCrawlerCPP/src/AppSettings.cpp:98:23: warning: statement has no effect [-Wunused-value] 
/home/reedja/CPPProjects/DungeonCrawlerCPP/src/AppSettings.cpp:114:29: warning: statement has no effect [-Wunused-value] 
g++ -Wall -fexceptions -g -fpermissive -std=gnu++0x -Iinclude -c /home/reedja/CPPProjects/DungeonCrawlerCPP/src/Container.cpp -o obj/Debug/src/Container.o 
/home/reedja/CPPProjects/DungeonCrawlerCPP/src/Container.cpp:1:9: warning: #pragma once in main file [enabled by default] 
g++ -Wall -fexceptions -g -fpermissive -std=gnu++0x -Iinclude -c /home/reedja/CPPProjects/DungeonCrawlerCPP/src/Entity.cpp -o obj/Debug/src/Entity.o 
g++ -Wall -fexceptions -g -fpermissive -std=gnu++0x -Iinclude -c /home/reedja/CPPProjects/DungeonCrawlerCPP/src/Item.cpp -o obj/Debug/src/Item.o 
/home/reedja/CPPProjects/DungeonCrawlerCPP/src/Item.cpp:1:9: warning: #pragma once in main file [enabled by default] 
g++ -Wall -fexceptions -g -fpermissive -std=gnu++0x -Iinclude -c /home/reedja/CPPProjects/DungeonCrawlerCPP/src/Monster.cpp -o obj/Debug/src/Monster.o 
/home/reedja/CPPProjects/DungeonCrawlerCPP/src/Monster.cpp:1:9: warning: #pragma once in main file [enabled by default] 
g++ -Wall -fexceptions -g -fpermissive -std=gnu++0x -Iinclude -c /home/reedja/CPPProjects/DungeonCrawlerCPP/src/Player.cpp -o obj/Debug/src/Player.o 
/home/reedja/CPPProjects/DungeonCrawlerCPP/src/Player.cpp: In member function ‘void Player::attackMonster(std::string)’: 
/home/reedja/CPPProjects/DungeonCrawlerCPP/src/Player.cpp:36:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] 
g++ -Wall -fexceptions -g -fpermissive -std=gnu++0x -Iinclude -c /home/reedja/CPPProjects/DungeonCrawlerCPP/src/Room.cpp -o obj/Debug/src/Room.o 
/home/reedja/CPPProjects/DungeonCrawlerCPP/src/Room.cpp:1:9: warning: #pragma once in main file [enabled by default] 
g++ -Wall -fexceptions -g -fpermissive -std=gnu++0x -Iinclude -c /home/reedja/CPPProjects/DungeonCrawlerCPP/src/tinystr.cpp -o obj/Debug/src/tinystr.o 
g++ -Wall -fexceptions -g -fpermissive -std=gnu++0x -Iinclude -c /home/reedja/CPPProjects/DungeonCrawlerCPP/src/tinyxml.cpp -o obj/Debug/src/tinyxml.o 
g++ -Wall -fexceptions -g -fpermissive -std=gnu++0x -Iinclude -c /home/reedja/CPPProjects/DungeonCrawlerCPP/src/tinyxmlerror.cpp -o obj/Debug/src/tinyxmlerror.o 
g++ -Wall -fexceptions -g -fpermissive -std=gnu++0x -Iinclude -c /home/reedja/CPPProjects/DungeonCrawlerCPP/src/tinyxmlparser.cpp -o obj/Debug/src/tinyxmlparser.o 
g++ -o bin/Debug/DungeonCrawlerCPP obj/Debug/main.o obj/Debug/src/ActionableObject.o obj/Debug/src/AppSettings.o obj/Debug/src/Container.o obj/Debug/src/Entity.o obj/Debug/src/Item.o obj/Debug/src/Monster.o obj/Debug/src/Player.o obj/Debug/src/Room.o obj/Debug/src/tinystr.o obj/Debug/src/tinyxml.o obj/Debug/src/tinyxmlerror.o obj/Debug/src/tinyxmlparser.o  
Output size is 674.11 KB 
Process terminated with status 0 (0 minutes, 6 seconds) 
0 errors, 9 warnings 

如果帮助...

+0

凹凸 - 真的需要一些帮助,因为我不能正确调试与控制台输出= / – Jarob22 2012-02-09 09:00:39

回答

0

我找到了答案 - 由于某种原因ç:: B不设置全局-g为默认,所以我没有调试符号。我仍然得到奇怪的错误消息,但至少我现在得到控制台输出:)