Author Topic: Code::Blocks kills apache on debugging attempt  (Read 2965 times)

mmmj

  • Guest
Code::Blocks kills apache on debugging attempt
« on: September 02, 2009, 10:43:33 am »
Hello,

I'm trying to debug an apache module using CodeBlocks/gdb so what I actually do is:

(in a terminal)
sudo /etc/init.d/apache2 stop
sudo /usr/sbin/apache2ctl -X -k start &

After this apache runs fine so far and I can open the website in a browser.
In order to debug it the normal steps would be:

sudo gdb
(gdb) file /usr/sbin/apache2
(gdb) shell cat /var/run/apache2.pid
12345
(gdb) attach 12345
.....(many loading log messages)...
0xb7f51430 in __kernel_vsyscall ()
(gdb) continue

and then the process keeps running fine.
However if I do it in CodeBlocks by setting Project->Set programs' arguments->Host application:/usr/sbin/apache2
and clicking Debug->Attach to process->12345 it loads, tells me:

In __kernel_vsyscall () ()
Debugger name and version: GNU gdb 6.8-debian
(and after clicking Debug/Continue or typing "continue" in debugger's command line)
Program exited with code 01.
Debugger finished with status 0

and the terminal where apache was started outputs:
Killed

The behaviour is the same with orig CodeBlocks 8.02 and CodeBlocks SVN 5731

Also if I try to set a breakpoint before hitting/typing continue, the debugger window says:
Error in re-setting breakpoint 2: No symbol table is loaded. Use the "file" command.

As this works without any problems in console(which offers not enough comfort) or with kdevelop(which I don't want to use) I guess it is related to CodeBlocks itself or the debugger plugin.

P.S. the compiler is set to "-g"

Did anybody encounter a similar problem or knows a solution to this?
Thanks in advance.