Here it is:
LD_LIBRARY_PATH=.:
Command-line: /usr/bin/gdb -nx -fullname -quiet -args ../mangos-server/bin/mangosd
Working dir : /home/tobias/Entwicklung/mangos/origin/builddir/
Reading symbols from /home/tobias/Entwicklung/mangos/origin/mangos-server/bin/mangosd...
> set prompt >>>>>>cb_gdb:
Queued:[tty /dev/pts/4]
done.
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 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-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 print elements -1
>>>>>>cb_gdb:
> set disassembly-flavor intel
>>>>>>cb_gdb:
> catch throw
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source /usr/share/codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> cd ../mangos-server/bin
>>>>>>cb_gdb:
> directory /home/tobias/Entwicklung/mangos/origin/builddir/
>>>>>>cb_gdb:
> directory /home/tobias/Entwicklung/mangos/origin/
>>>>>>cb_gdb:
> tty /dev/pts/4
>>>>>>cb_gdb:
> run
[Thread debugging using libthread_db enabled]
[New Thread 0x7ffff541b700 (LWP 25750)]
[Thread 0x7ffff541b700 (LWP 25750) exited]
Afterwards there is silence.. as long as I don't start to send SIGINTs manually.
Tried it on my other x86 machine btw. Same problem here, so really seems to be some specific problem with this application :-/
Can you try to rebuild C::B debugger's branch with this patch applied:
Index: src/plugins/debuggergdb/debuggergdb.cpp
===================================================================
--- src/plugins/debuggergdb/debuggergdb.cpp (revision 6974)
+++ src/plugins/debuggergdb/debuggergdb.cpp (working copy)
@@ -1570,7 +1570,8 @@
// m_Process is PipedProcess I/O; m_Pid is debugger pid
if (m_pProcess && m_Pid && !IsStopped())
{
- long pid = m_State.GetDriver()->GetChildPID();
+ long childPid = m_State.GetDriver()->GetChildPID();
+ long pid = childPid;
#ifndef __WXMSW__
if (pid <= 0)
pid = m_Pid; // try poking gdb directly
@@ -1578,7 +1579,11 @@
if (pid <= 0) // look out for the "fake" PIDs (killall)
cbMessageBox(_("Unable to stop the debug process!"), _("Error"), wxOK | wxICON_WARNING);
else
+ {
+ DebugLog(wxString::Format(_("Code::Blocks is trying to interrupt process with pid: %ld; child pid: %ld gdb pid: %ld"),
+ pid, childPid, m_Pid));
wxKill(pid, wxSIGINT);
+ }
#else
// windows gdb can interrupt the running process too. yay!
if ( (pid <=0)
After you've applied the patch and recompiled (remember to execute ./update).
You should see info in the debugger's debug log what C::B is trying to interrupt.
Another option is to build C::B with debug info (install -dbg package if there is such) and debug C::B itself with gdb.
You should put breakpoint in DebuggerGDB::DoBreak.
After trying to Debug the Version of the packet-manager, which gave me only a <value optimized out> here my result with your patch:
Code::Blocks is trying to interrupt process with pid: 13748; child pid: 13748 gdb pid: 13736
Edit: Hmm ok. This seems to be the Problem: There is no process with this pid running :-/
Edit 2: Hmm Ok, strange. I started my app and breaked at main. The main thread has PID 14386. But later, if I want to set a breakpoint in main he want's to interrupt PID 14389 wich is not exsisting. Those things are too high for me, I guess :-/. Probably it really has to do with the mechanism you mentioned. All other threads in this example have 14392-14398, so probably there has been anything in between.
Ok, I'll try that.
I tried to get it work in Eclipse CDT in the meantime. The suprising thing: Same Problem there O.o I start to believe that it really has not to with codeblocks but with the architecture of this application...
Edit:
>>>>>>cb_gdb:
> catch fork
catch vfork
Catchpoint 2 (fork)
>>>>>>cb_gdb:Catchpoint 3 (vfork)
Oh no, sry. This is just the initialisation. No breaks or other logs occured. Tried it also with DDD in the meanwhile, where it works.
GDB Log from cb:
LD_LIBRARY_PATH=.:
Command-line: /usr/bin/gdb -nx -fullname -quiet -args ../mangos-server/bin/mangosd
Working dir : /home/tobias/Entwicklung/mangos/origin/builddir/
Reading symbols from /home/tobias/Entwicklung/mangos/origin/mangos-server/bin/mangosd...
> set prompt >>>>>>cb_gdb:
Queued:[tty /dev/pts/11]
done.
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 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-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 print elements -1
>>>>>>cb_gdb:
> set disassembly-flavor intel
>>>>>>cb_gdb:
> catch throw
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source /home/tobias/Entwicklung/codeblocks/branches/wxpropgrid_debugger/binbin/share/codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> catch fork
catch vfork
Catchpoint 2 (fork)
>>>>>>cb_gdb:Catchpoint 3 (vfork)
> cd ../mangos-server/bin
>>>>>>cb_gdb:
> directory /home/tobias/Entwicklung/mangos/origin/builddir/
>>>>>>cb_gdb:
> directory /home/tobias/Entwicklung/mangos/origin/
>>>>>>cb_gdb:
> tty /dev/pts/11
>>>>>>cb_gdb:>>>>>>cb_gdb:
> run
[Thread debugging using libthread_db enabled]
[New Thread 0x7ffff541b700 (LWP 31862)]
[Thread 0x7ffff541b700 (LWP 31862) exited]
Code::Blocks is trying to interrupt process with pid: 31862; child pid: 31862 gdb pid: 31853
GDB-log from DDD:
GNU DDD 3.3.12 (x86_64-pc-linux-gnu), by Dorothea Lütkehaus and Andreas Zeller.
Copyright © 1995-1999 Technische Universität Braunschweig, Germany.
Copyright © 1999-2001 Universität Passau, Germany.
Copyright © 2001 Universität des Saarlandes, Germany.
Copyright © 2001-2004 Free Software Foundation, Inc.
(gdb) file /home/tobias/Entwicklung/mangos/origin/mangos-server/bin/mangosd
(gdb) run
[Thread debugging using libthread_db enabled]
^C[New Thread 0x7ffff541b700 (LWP 32194)]
[Thread 0x7ffff541b700 (LWP 32194) exited]
[New Thread 0x7ffff541b700 (LWP 32195)]
[New Thread 0x7ffff4a0d700 (LWP 32196)]
[New Thread 0x7ffff420c700 (LWP 32197)]
[New Thread 0x7fffefc64700 (LWP 32198)]
[New Thread 0x7fffef463700 (LWP 32199)]
[New Thread 0x7fffeec62700 (LWP 32200)]
[New Thread 0x7fffee461700 (LWP 32201)]
Program received signal SIGINT, Interrupt.
0x00007ffff5e02285 in pthread_join () from /lib/libpthread.so.0
(gdb)