linux下如何远程调试busybox?

1. 交叉编译busybox

    1.1 使能选项CONFIG_STATI(静态链接)
    1.2 使能选项CONFIG_DEBUG(编译时加入调试信息)
    1.3 使能选项CONFIG_DEBUG_PESSIMIZE(禁止优化)

2. 在目标机上启动代理gdbserver
    $ gdbserver :<port> busybox_unstripped hwclock (如 $gdbserver :2222 busybox_unstripped hwclock)

3. 在宿主机上启动your-cross-gdb
    $ your-cross-gdb busybox_unstripped
    (gdb) target remote <ip>:<port>
    (gdb) b hwclock_main
    (gdb) c