1

Information:
OS: Ubuntu 14.04
IDE: Code::blocks 13.12
Debugger: gdb 7.10

I'm new to code::blocks and was trying out the debugger, but it didn't work. 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:

warning: GDB: Failed to set controlling teminal: Operation not permitted

And the output is not to be seen anywhere.

8
  • Why do you think it didn't work? Have you tried to set breakpoints? What do you expect to see? Commented Sep 10, 2015 at 19:05
  • I think it didn't work because nothing of what the program should output can be seen in the console, but if run the program normally then I can read the expected output. The breakpoint changes nothing and the program should output the classic "Hello World!". Commented Sep 10, 2015 at 19:37
  • 1
    UPDATE: if there is an endl after the last cout, then I can see every the correct output. So I'd say that the problem is solved :D Commented Sep 10, 2015 at 20:07
  • @Sven If you have solved your problem, you should either delete this useless content, or consider to write an answer for your question yourself. Commented Sep 10, 2015 at 22:50
  • @πάνταῥεῖ Do you find the way I edited the question ok? I decided the leave the post so that other people with the same dumb problem will find the solution. Commented Sep 11, 2015 at 12:10

2 Answers 2

2

I found out there was no real problem, I only had to end the line that I was trying to see with a '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;
Sign up to request clarification or add additional context in comments.

Comments

0

Indeed, you need to flush your buffered streams (ie. fflush for FILE*, and .flush for std::stream-s).

But you don't need any IDE to run gdb. You could run it in a plain terminal, try gdb or gdb -tui or gdb --args or in Emacs

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.