openocd 连接GDB,使用远程串行通信协议,连接断开之后 GDB没有退出
- User
openocd 连接GDB,使用远程串行通信协议,连接断开之后 GDB没有退出
- Assistant
这是因为GDB启动时没有设置断开连接后自动退出的选项。要解决这个问题,可以在GDB中使用
set disconnect-command命令来设置断开连接后执行的命令。以下是示例命令:
code(gdb) set disconnect-command "quit"执行以上命令后,当连接断开时,GDB将自动执行"quit"命令退出。
你也可以将该命令添加到
.gdbinit文件中,以便每次启动GDB时自动执行。希望能帮助到你!
- User
翻译:Make sure that the remote architecture state has been initialized, because doing so might reallocate rs->buf. Any function which calls getpkt also needs to be mindful of changes to rs->buf, but this call limits the number of places which run into trouble.
- Assistant
确保远程架构状态已经初始化,因为这样可能重新分配rs->buf的内存空间。任何调用getpkt函数的函数也需要注意对rs->buf的更改,但此调用限制了可能出错的位置数量。
- User
翻译:Read a packet from the remote machine, with error checking, and store it in *BUF. Resize *BUF if necessary to hold the result. If FOREVER, wait forever rather than timing out; this is used (in synchronous mode) to wait for a target that is is executing user code to stop. If FOREVER == 0, this function is allowed to time out gracefully and return an indication of this to the caller. Otherwise return the number of bytes read. If EXPECTING_NOTIF, consider receiving a notification enough reason to return to the caller. *IS_NOTIF is an output boolean that indicates whether *BUF holds a notification or not (a regular packet).
- Assistant
从远程机器读取一个数据包,并进行错误检查,将其存储在BUF中。如果需要,调整BUF的大小以容纳结果。如果FOREVER为真,就会一直等待而不会超时;这在同步模式下用于等待执行用户代码的目标停止。如果FOREVER为0,该函数可以优雅地超时并向调用者返回指示。否则,返回读取的字节数。如果EXPECTING_NOTIF为真,在接收到通知后,就直接返回给调用者。IS_NOTIF是一个输出布尔值,用于指示BUF是否保存了一个通知(notification)还是一个普通的数据包(regular packet)。