24

I'm using Code-Blocks IDE in my Ubuntu 12.10.But when I'm trying to debug any project, I got the following warning:

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

What should I do now ?

galoget
  • 2,963
  • Search in the settings of CodeBlocks if you can change the terminal type. – Lucio Mar 26 '13 at 16:59
  • 1
    On a side note, if your current instruction arrow is not showing this error is NOT the cause. I spent hours trying to get the current instruction arrow to show thinking that this warning was causing it and not finding anything on google searches. In my case it was because I was using the wrong debugging format in nasm, I switched to using dwarf instead and it worked. –  Dec 29 '15 at 16:41
  • https://rr-project.org/ – Daniel Donnelly May 17 '21 at 16:34

5 Answers5

7

I had a similar problem on Ubuntu 16.04 using GDB 7.11 via XTerm. To solve it I simply modified the permissions on the local .gdbinit file by issuing chmod +x /path/to/file/.gdbinit which resolved the issue.

christner
  • 175
3
  1. Install or verify that gnome terminal is installed on your PC

  2. Switch to gnome-terminal. under Settings -> Environment -> Terminal to launch, I use this:

    gnome-terminal --disable-factory --hide-menubar -t $TITLE -x
    

You will still get the error but the debugger works completely.

muru
  • 197,895
  • 55
  • 485
  • 740
1

I had the same Problem with Ubuntu 10.04, QTCreator 2.5.2 and gdb 7.1 coming with ubuntu.

I could solve my problems with an upgrade to the current version 7.5 of gdb and using this instead the 7.1 installed by ubuntu.

You can download the latest and compile it by yourself:

  • Check for the latest gdb-*.tar.gz file here, and adapt the commands below if necessary.

wget http://ftp.gnu.org/gnu/gdb/gdb-7.6.2.tar.gz
tar xvfz gdb-7.6.2.tar.gz
cd gdb-7.6.2
./configure
make
cp gdb/gdb /usr/local/bin

Take care about that the /usr/local/bin is at the beginning of the PATH you are using while running QtCreator.

You can place the following line into your .profile:

export PATH=$PATH:/usr/local/bin 
kiri
  • 28,246
  • 16
  • 81
  • 118
yan160523
  • 11
  • 1
1

I had the same problem using KDBG on Debian jessie to debug assembling program but it was only because I didn't have the right to execute the file (copy)

a simple chmod +x /path/to/file solved the problem

alinux
  • 19
1

Had the same problem using Debug in kdevelop with my C code. Disdabled the "Use External Terminal" option under Run/Configure Launches and it works like a charm.

Peter H
  • 11
  • 1