I apologize in advance if this is not to correct forum for these issues and would appreciate notification of the correct place.
Thank you.
While using newly installed Code::Blocks at obfuscated's suggestion
SVN7712
Path: .
URL: http://svn.berlios.de/svnroot/repos/codeblocks/branches/wxpropgrid_debugger
Repository Root: http://svn.berlios.de/svnroot/repos/codeblocks
Repository UUID: 98b59c6a-2706-0410-b7d6-d2fa1a1880c9
Revision: 7712
Node Kind: directory
Schedule: normal
Last Changed Author: tpetrov
Last Changed Rev: 7712
Last Changed Date: 2012-01-22 19:36:42 -0500 (Sun, 22 Jan 2012)
I ran into the following problems:
Settings -> Debugger -> Common
Option: Display Debugger's Log
When checked does not display Debugger's Log in Logs & Others panel.
This was still the result after saving settings, exiting and restarting codeblocks
Right click on any tab in Logs & Others panel.
Popup menu -> Toggle -> Options do not include Debugger(Debug) as in my current working
Code::Blocks configuration (/trunk/SVN7494)
After compiling and installing Code::Blocks(DebugSVN7712), I loaded a project compiled while
using Code::Blocks(trunk/SVN7494).
I set a break point in the source code and ran the code using the Debug -> Start option.
The code did not break as expected. Was required to Build -> Clean/Debug -> Start before
a break would occur.
As a side note, the debugger did stop somewhere(there was no arrow indicator as usual) and
the buttons in the Debugger toolbar could be clicked on but no action occurred.
After starting the program with no breakpoints set, I attempted to add breakpoints.
The following is what was displayed in the Debug tab:
[quote]
[color=green][debug]Child process (pid:8988) doesn't exists
[debug]Code::Blocks is trying to interrupt process with pid: 8983; child pid: 8988 gdb pid: 8983
Continuing...
[/quote]
[/color]
The above was displayed each time I attempted to add a breakpoint while the program was running.
I tried to use the Break Debugger option in the Debugger Toolbar and this was displayed in the
Debugger tab:
[debug]Child process (pid:8988) doesn't exists
[debug]Code::Blocks is trying to interrupt process with pid: 8983; child pid: 8988 gdb pid: 8983
Continuing...
After all of the above, I was not able to exit out of Debugging Mode. I was required to
use the System Monitor to kill the gdb/program processes.
Start Page info
svn build rev 7712 (2012-01-23 00:36:42) gcc 4.4.4 Linux/unicode - 64 bit
Running CentOS 5.7
Configured Code::Blocks with the following:
../configure --prefix=<non-default-path>/build --with-contrib-plugins=all,-NassiShneiderman,-byogames,-spellchecker CC=gcc44 CXX=g++44
Compilation went fine after removing NassiShneiderman and spellchecker options.
gcc44 --v
Using built-in specs.
Target: x86_64-redhat-linux6E
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --disable-gnu-unique-object --enable-languages=c,c++,fortran --disable-libgcj --with-mpfr=/builddir/build/BUILD/gcc-4.4.4-20100726/obj-x86_64-redhat-linux6E/mpfr-install/ --with-ppl=/builddir/build/BUILD/gcc-4.4.4-20100726/obj-x86_64-redhat-linux6E/ppl-install --with-cloog=/builddir/build/BUILD/gcc-4.4.4-20100726/obj-x86_64-redhat-linux6E/cloog-install --with-tune=generic --with-arch_32=i586 --build=x86_64-redhat-linux6E
Thread model: posix
gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC)
g++44 --v
Using built-in specs.
Target: x86_64-redhat-linux6E
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --disable-gnu-unique-object --enable-languages=c,c++,fortran --disable-libgcj --with-mpfr=/builddir/build/BUILD/gcc-4.4.4-20100726/obj-x86_64-redhat-linux6E/mpfr-install/ --with-ppl=/builddir/build/BUILD/gcc-4.4.4-20100726/obj-x86_64-redhat-linux6E/ppl-install --with-cloog=/builddir/build/BUILD/gcc-4.4.4-20100726/obj-x86_64-redhat-linux6E/cloog-install --with-tune=generic --with-arch_32=i586 --build=x86_64-redhat-linux6E
Thread model: posix
wx-config --selected-config
[color=blue]gtk2-unicode-release-2.8[/color]
wx-config --version
[color=blue]2.8.12[/color]
wx-config --cppflags
[color=blue]-I/usr/local/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__[/color]
wx-config --libs
[color=blue]-L/usr/local/lib -pthread -L/usr/lib64 -lwx_gtk2u-2.8 [/color]
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: /scratch/mccarty/Dem3D/Dem3dPre/
Adding source dir: /scratch/mccarty/Dem3D/Dem3dPre/
Adding file: /scratch/mccarty/Dem3D/Dem3dPre/bin/Debug/Dem3dPreDebug-2012-01-24
Changing directory to: /scratch/mccarty/Dem3D/Dem3dPre/.
[debug]LD_LIBRARY_PATH=.:/opt/intel/Compiler/11.0/081/lib/intel64:/opt/intel/Compiler/11.0/081/mkl/lib/em64t:.:/philo/filesystems/maxwell/release/passage_flow/bin/LINUX/mpi/lib:/usr/lib:/usr/bin:/usr/lib/pkgconfig:/lib:/usr/local/lib/wx:/usr/local/lib:/scratch/mccarty/boost/build/lib:/usr/local/cuda/lib64
[debug]Command-line: /usr/bin/gdb -nx -fullname -quiet -args /scratch/mccarty/Dem3D/Dem3dPre/bin/Debug/Dem3dPreDebug-2012-01-24
[debug]Working dir : /scratch/mccarty/Dem3D/Dem3dPre
Starting debugger: /usr/bin/gdb -nx -fullname -quiet -args /scratch/mccarty/Dem3D/Dem3dPre/bin/Debug/Dem3dPreDebug-2012-01-24
done
[debug]Reading symbols from /scratch/mccarty/Dem3D/Dem3dPre/bin/Debug/Dem3dPreDebug-2012-01-24...
[debug]> set prompt >>>>>>cb_gdb:
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
[debug]done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.1
[debug]Copyright (C) 2010 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law. Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "x86_64-unknown-linux-gnu".
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 7.1
[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source /scratch/mccarty/codeblocksSVNDebug/wxpropgrid_debugger/build/share/codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory /scratch/mccarty/Dem3D/Dem3dPre/
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]warning: no loadable sections found in added symbol-file system-supplied DSO at 0x2aaaaaaab000
[debug][Thread debugging using libthread_db enabled]
Program started with no breakpoints.
At this point I opened a source file and tried to add a breakpoint. The following message was displayed.
[debug]Code::Blocks is trying to interrupt process with pid: 21664; child pid: 0 gdb pid: 21664
Continuing...
After adding the break point with the above message displayed, I tried to open a file from within my program.
The following was displayed.
[debug]Quit
[debug]>>>>>>cb_gdb
I hope this is enough information.
The program is being developed on the above mentioned system using the wxWidgets-2.9.2 API.
The program runs fine with no problems when not trying to debug at run-time, meaning that if I set breakpoints before
starting the program it will break properly. However, I have run into situations where the program quits running if
I remove set breakpoints while the program is running. The program will lock up or it will crash abruptly.
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:
warning: GDB: Failed to set controlling terminal: Operation not permitted
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:
Code::Blocks is trying to interrupt process with pid: 21664; child pid: 0 gdb pid: 21664
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:
warning: GDB: Failed to set controlling terminal: Operation not permitted"
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:
warning: GDB: Failed to set controlling terminal: Operation not permitted
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.
Can you try to use the native gcc (4.1.2)?
I am now really confused. I am talking about my problems with the gdb-7.x debugger. Why are you asking me to use gcc-4.1.2?
What does the compiler version have to do with the debugger version?
Also, the problems I encountered went away when I downgraded back to gdb-6.8. I am not the only person who has encountered the console window connection problem.
https://www.google.com/#sclient=psy-ab&hl=en&source=hp&q=warning:+GDB%3A+Failed+to+set+controlling+terminal%3A+Operation+not+permitted&pbx=1&oq=warning:+GDB%3A+Failed+to+set+controlling+terminal%3A+Operation+not+permitted&aq=f&aqi=g2g-v1g-j1&aql=&gs_sm=12&gs_upl=495l495l0l2912l1l1l0l0l0l0l118l118l0.1l1l0&bav=on.2,or.r_gc.r_pw.,cf.osb&fp=ae73f10212a66505&biw=1218&bih=829
OK, I quit :)
Edit: To prove that I'm right please paste the line
Code::Blocks is trying to interrupt process with pid: 21664; child pid: 0 gdb pid: 21664
When using gdb 6.8, you'll see that the 0 in the middle is not zero.
About the compiler: Because you're using some self compiled compiler or compiler compiled by someone else. And I wanted to remove one uncertainty.
I am using the rpm of gcc-4.4.
About the message:
It has great meaning if you know how to read it :)
It is a debug message, telling you/me what C::B is doing. In this case it is telling to which process C::B is sending SIGINT. SIGINT is the same as Ctrl+C in terminal.
And in order to insert a new breakpoint, C::B has to stop the execution of the debuggee and then it can insert breakpoints then it will resume it.
Unfortunately this is not very reliable, because there are many different ways to do it, depending on the version of gdb and os.
Newer gdb's are supposed to interrupt the process, when they receive the SIGINT, older ones work only when the debuggee receives the SIGINT signal.
Unfortunately for some programs newer gdbs don't print the pid information during startup and we don't know the debuggee's PID, thus C::B falls back to sending signal directly to GDB.
And for some unknown reason, you newer gdb's fail to interrupt the debuggee, when they receive the SIGINT.
I guess you can try to ask the gdb devs in #gdb.
So given this line:
Code::Blocks is trying to interrupt process with pid: 21664; child pid: 0 gdb pid: 21664
CB is sending a SIGINT to gdb(pid 21664) to interrupt child(pid 0)[that does not exist] and is failing?
Why then would your gdb-7.4/7.3/7.1 work and mine does not? I really cannot expect you to answer this question, but if you know it would help.
Do you have SELinux enabled? If you have, can you try without it?
No clue.
p.s. please post the line from gdb-6.8!
Assuming you want the gdb start-up message when running gdb-6.8, here it is:
in Debugger tab
Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: /scratch/mccarty/Dem3D/Dem3dPre/
Adding source dir: /
Adding file: bin/Debug/Dem3dPreDebug-2012-02-17
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.8
Child process PID: 29653
As an added measure, here is what is displayed in Debugger tab when using gdb-7.4 for me.
Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: /scratch/mccarty/Dem3D/Dem3dPre/
Adding source dir: /
Adding file: bin/Debug/Dem3dPreDebug-2012-02-17
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.4
In Debugger[debug] tab
LD_LIBRARY_PATH=.:/usr/lib:/scratch/mccarty/boost_1_35_0/libs:/opt/intel/Compiler/11.0/081/lib/intel64:/opt/intel/Compiler/11.0/081/mkl/lib/em64t:.:/philo/filesystems/maxwell/release/passage_flow/bin/LINUX/mpi/lib:/usr/lib:/usr/bin:/usr/lib/pkgconfig:/lib:/usr/local/lib/wx:/usr/local/lib:/scratch/mccarty/boost/build/lib:/usr/local/cuda/lib64
Command-line: /scratch/mccarty/gdb-6.8/build/bin/gdb -nx -fullname -quiet -args ../debug/demppDbg
Working dir : /scratch/mccarty/dempp/trunk/
> set prompt >>>>>>cb_gdb:
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set disassembly-flavor intel
>>>>>>cb_gdb:
> source /scratch/mccarty/codeblocksSVN/trunk/build/share/codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> set backtrace limit 0
>>>>>>cb_gdb:>>>>>>cb_gdb:
> cd ../debug
>>>>>>cb_gdb:
> directory /scratch/mccarty/dempp/trunk/
>>>>>>cb_gdb:
> directory /
>>>>>>cb_gdb:
> run
And here is what is displayed in Debugger(debug) tab using gdb-7.4
LD_LIBRARY_PATH=.:/opt/intel/Compiler/11.0/081/lib/intel64:/opt/intel/Compiler/11.0/081/mkl/lib/em64t:.:/philo/filesystems/maxwell/release/passage_flow/bin/LINUX/mpi/lib:/usr/lib:/usr/bin:/usr/lib/pkgconfig:/lib:/usr/local/lib/wx:/usr/local/lib:/scratch/mccarty/boost/build/lib:/usr/local/cuda/lib64
Command-line: /scratch/mccarty/gdb-7.4/build/bin/gdb -nx -fullname -quiet -args bin/Debug/Dem3dPreDebug-2012-02-17
Working dir : /scratch/mccarty/Dem3D/Dem3dPre/
> set prompt >>>>>>cb_gdb:
Reading symbols from /scratch/mccarty/Dem3D/Dem3dPre/bin/Debug/Dem3dPreDebug-2012-02-17...
done.
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb (GDB) 7.4
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set disassembly-flavor intel
>>>>>>cb_gdb:
> source /scratch/mccarty/codeblocksSVN/trunk/build/share/codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> set backtrace limit 0
>>>>>>cb_gdb:>>>>>>cb_gdb:
> directory /scratch/mccarty/Dem3D/Dem3dPre/
>>>>>>cb_gdb:
> directory /
>>>>>>cb_gdb:
> break "/scratch/mccarty/Dem3D/Dem3dPre/code/objects/model/PreprocessorModelClass.cpp:253"
Breakpoint 1 at 0x46c4a5: file /scratch/mccarty/Dem3D/Dem3dPre/code/objects/model/PreprocessorModelClass.cpp, line 253.
>>>>>>cb_gdb:
> run
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".