Hi ,
I am new in open-wrt environment. I am trying to setup open-wrt gdb , for debugging the openwrt packages.
I am Not able to use gdb for debugging openwrt packages. Please help me in this regard.
I had installed openwrt compiled gdb version and the binary of my sample program which is "not stripped" on my router .
Now trying to debug the binary using Ubuntu:
I am following below step:
i)Ubuntu and router are connected statistically using LAN cable.
ii) running below command on router:
root@OpenWrt:/usr# gdbserver :2000 helloworld
Process helloworld created; pid = 10938
Listening on port 2000
Remote debugging from host 10.63.84.60
ii)running below on Ubuntu:
root@LMint:/home/siballa/openwrt/openwrt/puneeth_qsdk/qsdk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin# ./mips-openwrt-linux-uclibc-gdb
GNU gdb (Linaro GDB) 7.2-2011.03-0
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 "--host=i686-linux-gnu --target=mips-openwrt-linux-uclibc".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>.
(gdb) target remote 10.63.84.67:2000
Remote debugging using 10.63.84.67:2000
warning: Can not parse XML target description; XML support was disabled at compile time
0x77beef60 in ?? ()
(gdb) b main
No symbol table is loaded. Use the "file" command.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) run
The "remote" target does not support "run". Try "help target" or "continue".
(gdb)
I am getting error "No symbol table is loaded. Use the "file" command." while setting breakpoint.
I had tried compiling helloworld program with below option , in order to include symbol table:
1.in menuconfig enable gdb
---------------------------------
Advanced configuration options (for developers) → Toolchain Options → Build gdb
and gdbserver
Development → gdbserver
2.Add debugging to a package
--------------------------------
Add CFLAGS to the package Makefile and recompile it.
TARGET_CFLAGS += -ggdb3
OR
Alternatively recompile the package with CONFIG_DEBUG set
make package/busybox/{clean,compile} V=99 CONFIG_DEBUG=y
OR
enable debug info in menuconfig
Global build settings > Compile packages with debugging info