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.
Hi oBFusCATed, thanks for your reply.
Yes, it works from the command line. Here is a transcript of when running gdb from the command line, with the same command line parameters codeblocks is using.
$ /usr/local/bin/mipsel-linux-uclibc-gdb -nx -fullname -quiet -args /storage/work/project/project_trunk/stb/derived.debug/run_device.sh
"/storage/work/project/project_trunk/stb/derived.debug/run_device.sh": not in executable format: File format not recognised
(gdb) set sysroot ~/kernel/project/trunk/nfsroot
(gdb) file ../../stb/derived.debug/app_.elf
Reading symbols from ../../stb/derived.debug/app_.elf...done.
(gdb) target remote 10.1.1.50:1234
Remote debugging using 10.1.1.50:1234
Reading symbols from /home/buildmaster/kernel/project/trunk/nfsroot/lib/ld-uClibc.so.0...(no debugging symbols found)...done.
Loaded symbols for /home/buildmaster/kernel/project/trunk/nfsroot/lib/ld-uClibc.so.0
0x77fe0eb0 in _start ()
from /home/buildmaster/kernel/project/trunk/nfsroot/lib/ld-uClibc.so.0
(gdb) c
Continuing.
[New Thread 695]
^Cwarning: GDB can't find the start of the function at 0x76b5b084.
GDB is unable to find the start of the function at 0x76b5b084
and thus can't determine the size of that function's stack frame.
This means that GDB may be unable to access that stack frame, or
the frames below it.
This problem is most likely caused by an invalid program counter or
stack pointer.
However, if you think GDB should simply search farther back
from 0x76b5b084 for code which looks like the beginning of a
function, you can increase the range of the search using the `set
heuristic-fence-post' command.
Program received signal SIGINT, Interrupt.
warning: GDB can't find the start of the function at 0x76b5b084.
0x76b5b084 in ?? ()
from /home/buildmaster/kernel/project/trunk/nfsroot/lib/libc.so.0
(gdb) quit
A debugging session is active.
Inferior 1 [process 560] will be killed.
Quit anyway? (y or n) y
We provided a debugger log in the previous post, is this is not a "full" debugger log in codeblocks? Is there a way of getting more information?