简体   繁体   English

GDB调试器在Code :: blocks中不起作用

[英]GDB debugger doesn't work in Code::blocks

Information: 信息:
OS: Ubuntu 14.04 操作系统:Ubuntu 14.04
IDE: Code::blocks 13.12 IDE:代码::块13.12
Debugger: gdb 7.10 调试器:gdb 7.10

I'm new to code::blocks and was trying out the debugger, but it didn't work. 我对代码::: blocks不熟悉,正在尝试调试器,但是没有用。 So I'm here to ask you what I could do to find a solution to this problem. 所以我在这里问你如何才能找到解决该问题的方法。

When I click on 'step into' and the XTerm console opens with the message: 当我单击“进入”时,XTerm控制台将打开并显示以下消息:

warning: GDB: Failed to set controlling teminal: Operation not permitted 警告:GDB:无法设置控制端子:不允许操作

And the output is not to be seen anywhere. 输出不会在任何地方看到。

I found out there was no real problem, I only had to end the line that I was trying to see with a 'endl' 我发现没有真正的问题,只需要用“ endl”结束我想看到的行

What I was trying to execute in the debugging session, but couldn't see: 我试图在调试会话中执行的操作,但看不到:

 cout << "Hello World!";

What solved the problem, enabling me to see the output in the debugger: 解决问题的方法使我能够在调试器中查看输出:

 cout << "Hello World!" << endl;

Indeed, you need to flush your buffered streams (ie. fflush for FILE* , and .flush for std::stream -s). 确实,您需要刷新缓冲的流(即FILE* fflushstd::stream -s的.flush )。

But you don't need any IDE to run gdb . 但是您不需要任何IDE即可运行gdb You could run it in a plain terminal, try gdb or gdb -tui or gdb --args or in Emacs 您可以在普通终端中运行它,尝试使用gdbgdb -tuigdb --args或在Emacs中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM