Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Problems discovered in branches/wxpropgrid_debugger SVN7712

<< < (3/5) > >>

mmccarty12:

--- Quote from: oBFusCATed on January 24, 2012, 09:02:23 pm ---You can set the debugger in the toolchain executables for the compiler.

p.s. I've not tried gdb-7.4, so there might be some problems with it.

--- End quote ---

In SVN7713, I went to Settings -> Compiler and Debugger -> Toolchain Executables -> Additional Paths.
I added the path to the local build of gdb 7.4.
I ran the debugger on my code. In the Debugger log, it showed that gdb 7.1 was running.

I went to Settings -> Compiler and Debugger -> Toolchain Executables -> Debugger.
I put in the full path to the gdb flavor I want to use.
I ran the debugger on my code. In the Debugger log, it showed that gdb 7.1 was running.

I went to Settings -> Compiler and Debugger -> Toolchain Executables -> Additional Paths.
I removed the path added earlier.
I ran the debugger on my code. In the Debugger log, it showed that gdb 7.1 was running.

Jenna:
It might work, if you rename either the older or newer version of gdb (I suggest the older) and put the path to the 7.4 version in additional paths.

mmccarty12:
Hello, again. 

I finally figured out what was going on with not being able to stop program execution during run-time.  But first some background as to the REAL cause of the problem.  Running a console application from Code::Blocks, CB, of course, opens an xterm by default.  As stated earlier, I was running gdb-7.1 when I first posted this as a problem.  Per obfuscated's suggestion I upgraded to 7.4, he said 7.3, but I didn't figure that would be a problem.  The problem was still occurring.  Prior to several software and system package upgrades, I had been running CB:7494, gcc/g++-4.1, gdb-6.8.  I upgraded to gcc/g++-4.4, this resolved some issues I was having with C++-0x/C++-11.  Since I was doing this, I also upgraded everything I could, including gdb.  I upgraded to gdb-7.1.  That is when my debugging issues started. 

I finally paid attention to what was being output in the console window, and the debugging log in CB.  In the console window I was receiving the following warning: "warning: GDB: Failed to set controlling terminal: Operation not permitted".

Thus began a search on Google for related problems.  As it turns out, this problem is a gdb problem, or a problem related to gdb being called from the IDE.  It has to do with the way TTY is assigned to gdb when it is called from the IDEs.  When I switched my debugger back to gdb-6.8, I no longer got the warning message in my output console/debugger's log, and I could put breaks into the code while the program was running.

The gdb people know about the problems, but there is nothing active on what is going to be done to fix the problem.  If you are having this same problem, I suggest downgrading your gdb to 6.8.  It seems that the 7.0 updates introduced as many bugs as it was intended to fix.

oBFusCATed:

--- Quote from: mmccarty12 on February 15, 2012, 07:23:13 pm ---Thus began a search on Google for related problems.  As it turns out, this problem is a gdb problem, or a problem related to gdb being called from the IDE.  It has to do with the way TTY is assigned to gdb when it is called from the IDEs.  When I switched my debugger back to gdb-6.8, I no longer got the warning message in my output console/debugger's log, and I could put breaks into the code while the program was running.

--- End quote ---
This is a warning and it is not really a problem. I don't know why you've decided that it is causing you troubles. Any link with explanation?
I'm seeing this warning all day long and I've no problems with debugging.
I'm using gcc 4.1.2+gdb-7.4 on centos and everything works as expected.

mmccarty12:
Obfuscated,

First off, I don't like warnings of any type.  When there are none displayed, anywhere, I know that my program is working as programmed, not necessarily the way I want it to, but at the least it is working the way I coded it.  From the first time I actually paid attention to the fact that the warning existed, it annoyed me.

As stated above, I was using CB-SVN Rev 7494 with gcc/g++4.4 and gdb-6.8.
While using this configuration, I was able to do the following:
While the program was running, I was able to insert new break points that were recognized immediately, and the program would stop at that break point when the program came to that point, as is supposed to happen.

While the program was running, I was able to click on the Stop Debugging button or select the Stop Debugging option from the Debug menu option and the program would "break" wherever it happened to be in its run.

Console programs would not display any warnings of this sort:

--- Quote ---warning: GDB: Failed to set controlling terminal: Operation not permitted
--- End quote ---
The debug window in CD would not show the above message when opening any non-console program.

Console programs would shut down the console window and the debugger when the program had exited.

GDB would stop automatically when the program was stopped by any method.

After upgrading to CB7713, gdb-7.1:
I was no longer able to insert break points while the program was running.  The Debug window would display the message:

--- Quote ---Code::Blocks is trying to interrupt process with pid: 21664; child pid: 0 gdb pid: 21664
--- End quote ---

I was forced to stop the program and restart.
 
I was no longer able to use the Stop Debugging button nor the Debug->Stop Debugging menu option to stop the program.  I was forced to close the program from the program close options.  There were times when CB would crash if this was not done in the proper order.

Console programs displayed the following warning at console window open:

--- Code: ---warning: GDB: Failed to set controlling terminal: Operation not permitted"
--- End code ---
  The debug window in CB displayed the same message, even though a console window was not being opened.

Console programs would not shut down the console window and the debugger when the program had exited.  It was necessary to close the window using the window close options and shut down the debugger using the Stop Debugging button or the Debug->Stop Debugging menu option.

GDB would not stop automatically when the program was stopped by any method.  It was necessary to manually shut down gdb using the Stop Debugging button or the Debug->Stop Debugging menu option.

I came here, believing the problem was in the debugging plugin, to which you gave your reply below.  I did as you suggested and upgraded gdb, not to gdb-7.3 as you said, but to gdb-7.4.  The problems still persisted, which has led to the continuing conversation here. 

I down-graded gdb to gdb-7.0, then gdb-6.8.  The problems went away with gdb-6.8.  Something was changed, I assume drastically, that has caused the functionality that is in the debugger plugin to no longer work as intended, at least in my case.
If you enter:

--- Code: ---warning: GDB: Failed to set controlling terminal: Operation not permitted
--- End code ---
into Google, you will find many people with the same problem and no solutions.  There are many threads mentioning the problem, of the fifty or so threads that I did read, none, whatsoever, had a solution, regardless of OS, IDE, compiler. 

As you are the "<debugger plugin maintainer>", and responded to this thread, I thought you felt accused of doing something wrong and came here to let you know it was not you that caused the problems I encountered, it was the developers of gdb. 

I do not claim to know why I am having the issues described above when trying to use gdb-7.x, but I have now found a solution to the problem, and came here to let others know what I have discovered.  I do believe that is the purpose of a forum like this.  To have a question asked and answered.  I asked a question, you and jens both responded which gave me avenues to try, for which I am thankful.  Ultimately, through the advice of both of you, I found a solution that was satisfactory to me and felt that it was necessary to let others know what I found and what I did to resolve the problem.  Maybe not all individuals are as anal retentive and OCD as myself and do not care.  For those who are, here you go, MY solution. 

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version