Hello CB team,
We're using codeblocks 13.12 on Ubuntu 12.04 (32 bit). We're remote debugging a mipsel target with gdb 7.8.1 and when we select Debug->Stop debugger the local gdb process finishes but the remote executable continues to run. Here is the debugger log:
Selecting target:
Device R2
Adding source dir: /storage/work/project/project_trunk /emulator/proj.cb
Adding source dir: /storage/work/project/
Adding file: /storage/work/project/project_trunk/stb/derived.debug/run_device.sh
Changing directory to: /storage/work/project/project_trunk /emulator/proj.cb
Set variable: LD_LIBRARY_PATH=.:
[debug]Command-line: ./gdb-switcher -nx -fullname -quiet -args /storage/work/project/project_trunk/stb/derived.debug/run_device.sh
[debug]Working dir : /storage/work/project/project_trunk /emulator/proj.cb
Starting debugger: ./gdb-switcher -nx -fullname -quiet -args /storage/work/project/project_trunk/stb/derived.debug/run_device.sh
done
[debug]> set prompt >>>>>>cb_gdb:
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Connecting to remote target
Setting breakpoints
[debug]"/storage/work/project/project_trunk/stb/derived.debug/run_device.sh": not in executable format: File format not recognised
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.8.1
[debug]Copyright (C) 2014 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 "--host=i686-pc-linux-gnu --target=mipsel-linux-uclibc".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 7.8.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]No symbol table is loaded. Use the "file" command.
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source /usr/share/codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory /storage/work/project/project_trunk /emulator/proj.cb
[debug]Source directories searched: /storage/work/project/project_trunk /emulator/proj.cb:$cdir:$cwd
[debug]>>>>>>cb_gdb:
[debug]> directory /storage/work/project/
[debug]Source directories searched: /storage/work/project/project_trunk /emulator/proj.cb:$cdir:$cwd
[debug]>>>>>>cb_gdb:
[debug]> source ../../../project/project/config/device/config.gdb
[debug]>>>>>>cb_gdb:
[debug]> target remote tcp:10.1.1.50:1234
[debug]Remote debugging using tcp:10.1.1.50:1234
[debug]Reading symbols from /home/buildmaster/kernel/project/trunk/nfsroot/lib/ld-uClibc.so.0...(no debugging symbols found)...done.
[debug]Loaded symbols for /home/buildmaster/kernel/project/trunk/nfsroot/lib/ld-uClibc.so.0
[debug]0x77fe0eb0 in _start () from /home/buildmaster/kernel/project/trunk/nfsroot/lib/ld-uClibc.so.0
[debug]>>>>>>cb_gdb:
Connected
[debug]> continue
Reading symbols from /home/buildmaster/kernel/project/trunk/nfsroot/lib/ld-uClibc.so.0...(no debugging symbols found)...done.
In _start () (/home/buildmaster/kernel/project/trunk/nfsroot/lib/ld-uClibc.so.0)
[debug]> continue
[debug]Continuing.
[debug][New Thread 2448]
[debug]Child pid is 0, so we will terminate GDB directly
[debug]Cannot execute this command while the target is running.
[debug]Use the "interrupt" command to stop the target
[debug]and then try again.
Debugger finished with status 0
gdbserver hasn't exited on our remote target and the gdbserver socket is stuck in CLOSE_WAIT status.
# netstat -t
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 device.project.local:1234 mulcon.project.local:60406 CLOSE_WAIT
This worked fine with codeblocks version 10.05 with the same version of gdb, on the same OS and target. The connect with extended remote checkbox (in 13.12) is not selected.
With 10.05, when we click Debug->Stop debugger the remote executable is interrupted; when we click Debug->Stop debugger again, both the remote executable and gdbserver exits and there is no socket left in CLOSE_WAIT.
Can anyone help us solve this problem in 13.12?
Thanks.