Code::Blocks Forums

User forums => Help => Topic started by: tigertang on May 14, 2017, 06:11:37 pm

Title: My C::B's gdb debugger didn't work in ubuntu :(
Post by: tigertang on May 14, 2017, 06:11:37 pm
everytime i tried to set a breakpoint and debug, the terminal told me this:
Setting breakpoints
Debugger name and version: GNU gdb (Ubuntu 7.12.50.20170314-0ubuntu1) 7.12.50.20170314-git
Undefined command: "tty".  Try "help".
At /home/***/code/projectCpp/main.cpp:7

unfortuately, pressing f7 at this time...Oops!
It seems that debugger isn't willing to work anymore....
:(
:(
Please help me...
Thank you guys very much!
Title: Re: My C::B's gdb debugger didn't work in ubuntu :(
Post by: oBFusCATed on May 14, 2017, 11:14:59 pm
The information you've provided is not enough to understand where the problem lies, so we'll need a bit more.
Can you enable full logging in the settings -> debugger, reproduce the problem and then post the log using code tags or in some pastebin?
Title: Re: My C::B's gdb debugger didn't work in ubuntu :(
Post by: tigertang on May 15, 2017, 12:15:08 pm
Does this gives enough information? :o
https://pastebin.com/bMuM5ZUQ
Title: Re: My C::B's gdb debugger didn't work in ubuntu :(
Post by: oBFusCATed on May 15, 2017, 07:50:01 pm
For some reason your gdb doesn't support the tty command
Code
[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.
Title: Re: My C::B's gdb debugger didn't work in ubuntu :(
Post by: lioujheyu on August 08, 2017, 02:11:58 am
I have the same problem on Ubuntu 17.04 with the same gdb version(7.12.50~).
For unknown reason, tty command is no longer provided by this gdb. But tty command is actually the alias of "set inferior-tty"
(reference:
 https://sourceware.org/gdb/onlinedocs/gdb/Input_002fOutput.html (https://sourceware.org/gdb/onlinedocs/gdb/Input_002fOutput.html)).
So my solution to this issue is to replace "tty " with "set inferior-tty " in codeblocks' sorce file: trunk/src/plugins/debuggergdb/debuggergdb.cpp:924.
Title: Re: My C::B's gdb debugger didn't work in ubuntu :(
Post by: oBFusCATed on August 08, 2017, 09:09:51 am
This is an acknowledged bug in this version of gdb.
For some reason this ubuntu ships with a development version of gdb.
This should be fixed in later versions of gdb.

Please ask ubuntu developers to update the gdb package to a release version.