我正在远程调试 Stellaris Launchpad。我使用 OpenOCD 连接到 Stellaris,然后将 GDB 连接到 openOCD 提供的服务器。我使用 Open On-Chip Debugger 0.10.0-dev-00002-g79fdeb3 (2015-07-09-23:28)。GDB 来自 arm-gcc-none-eabi,4_9-2015q1 版本。我像这样调用openOCD:
/usr/local/bin/openocd --file \
/usr/local/share/openocd/scripts/board/ek-lm4f120xl.cfg \
>> openocdLog.txt 2>&1 &
然后像这样的GDB:
arm-none-eabi-gdb proj//debug/exec -x gdb//gdb.script
gdb/gdb.script 包含:
set remotetimeout 10000
target extended-remote :3333
monitor reset halt
load
monitor reset init
问题是每当我点击 control+c GDB 就会断开连接。通常这会停止远程,但 GDB 只是断开连接:
(gdb) cont
Continuing.
^CError detected on fd 6
Remote communication error. Target disconnected.: Interrupted system call.
(gdb)
OpenOCD 有以下几点要说,这是 GDB 启动时的:
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1258). Workaround: increase "set remotetimeout" in GDB
这很奇怪,考虑到 gdb/gdb.script 文件将 remotetimeout 强制设置为一个非常大的数字。
当按下 control+c openOCD 时说:
Debug: 2602 5089 hla_interface.c:119 hl_interface_quit(): hl_interface_quit
那么,我该如何解决呢?按下 control+c 时,如何让 GDB 停止遥控器而不是断开连接?