Author Topic: error when running gdb  (Read 29345 times)

Offline hagai_sela

  • Single posting newcomer
  • *
  • Posts: 8
error when running gdb
« on: November 01, 2009, 09:52:10 pm »
Hi,
I just upgraded to ubuntu 9.10, and I am getting this error when I start the debugger:
"warning: GDB: failed to set controlling terminal: operation not permitted"
I am using the binary build (8.02).

Thanks,
Hagai.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9528
Re: error when running gdb
« Reply #1 on: November 02, 2009, 09:38:46 am »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline hagai_sela

  • Single posting newcomer
  • *
  • Posts: 8
Re: error when running gdb
« Reply #2 on: November 02, 2009, 09:52:06 am »
I did use google before, nothing seemed to be relevant.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9528
Re: error when running gdb
« Reply #3 on: November 02, 2009, 10:47:33 am »
I did use google before, nothing seemed to be relevant.
It is as it marks this as a gdb issue. So asking here is asking in the wrong forum. Sorry.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline AdamParent

  • Single posting newcomer
  • *
  • Posts: 3
Re: error when running gdb
« Reply #4 on: February 09, 2010, 08:22:59 am »
Interesting.

I have the same problem and did a lot of searching via google.  A couple folks had this exact problem when using Netbeans.

To correct the problem it appears they changed a NetBeans setting.  Specifically, they changed the "console type:" setting from "external terminal" to "output window" and the problem disappeared.

So now I'm wondering if there is an analogous setting in Code::Blocks?  I'm pretty new to this application and haven't been able to find such a setting.  I also wondered if this might be a command you pass to gdb somehow but haven't found any likely candidates.

V/R
Adam

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12224
    • Travis build status
Re: error when running gdb
« Reply #5 on: February 09, 2010, 09:07:42 am »
You can change your app's type to GUI based and then the debugger plugin won't show a terminal.
Also the whole output of your program will go to the debugger's log panes.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: error when running gdb
« Reply #6 on: February 09, 2010, 10:15:01 am »
And what's more: it seems you can safely ignore this warning, because debugging works as expected here (debian unstable/experimantal 64-bit) with this warning.

Offline AdamParent

  • Single posting newcomer
  • *
  • Posts: 3
Re: error when running gdb
« Reply #7 on: February 09, 2010, 09:04:12 pm »
Cool.

Thanks for the help.

To change the application type to GUI I used Project->Properties...->Build Targets tab.  I then selected "GUI application" in the Type: dropdown box.

I noticed I also had to go to Settings->Compiler and debugger...  Then I selected the "Debugger settings" on the left panel and checked the "Display debugger's log" check box.

A "Debugger (debug)" tab appeared at the bottom of the workspace and my output appeared there.

It also looks like I can keep using a terminal and simply ignore the warning as suggested by jens.  I have noticed, however, that my application doesn't exit debug mode quite the same as it does when I do a normal "Run."  When I run the program (simple Hello World) as a console application through the "Run" command, I get the message, "Press ENTER to continue."  After you hit enter the terminal window closes.  When I run the application using "Debug / Continue", the console appears, my output flashes on the screen, and the console quickly closes without the previous prompt.  Its probably worth mentioning that I have checked the "Pause when execution ends" check box under Projects->Properties->Build targets tab

I'm not sure if that is a bug or not.  Does Code::Blocks open and close the console or does gdb?  In any event the "problem" is easy enough to deal with by simply setting a breakpoint on the return call in main().

I'm using Code::Blocks 8.02 on Ubuntu 9.10 with gdb 7.0.

Thanks again for the help.

BTW... I'm just getting back into programming after a ~10 year hiatus.  I've tried a couple of the other linux open source based IDEs including KDevelop, Anjuta and Eclipse.  So far Code::Blocks has been the easiest to get up and running.  Thanks for the cool app.

V/R
Adam

Offline tjareson

  • Single posting newcomer
  • *
  • Posts: 2
Re: error when running gdb
« Reply #8 on: August 24, 2012, 02:11:58 am »
I know that this conversation is quite old, but I just recognized that I have exactly the same behaviour:
same error message and also windows closing after ending the application immediately when I have started that by debugging.

I'm using code:blocks 10.05 and GDB 7.1 on an Ubuntu 10.04 LTS.

Has anyone found out more about the background of this strange message than to simply ignoring it?


kind regards
Tjareson

Offline polisbul

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: error when running gdb
« Reply #9 on: January 03, 2013, 12:42:51 pm »
Same for me.
any news?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12224
    • Travis build status
Re: error when running gdb
« Reply #10 on: January 03, 2013, 01:01:37 pm »
Same for me.
any news?
Just ignore as others do. This not your problem.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]