Both sides previous revisionPrevious revisionNext revision | Previous revision |
gdbs:protocol [2025/05/26 16:34] – lars | gdbs:protocol [2025/05/31 07:21] (current) – [replies] lars |
---|
</code> | </code> |
| |
The remote protocol is specified in [[https://sourceware.org/gdb/current/onlinedocs/gdb.html/Remote-Protocol.html|Appendix E]] of the [[https://sourceware.org/gdb/current/onlinedocs/gdb.html/index.html|gdb documentation]] | The remote protocol is specified in [[https://sourceware.org/gdb/current/onlinedocs/gdb.html/Remote-Protocol.html|Appendix E]] of the [[https://sourceware.org/gdb/current/onlinedocs/gdb.html/index.html|gdb documentation]]. Wherever appropriate large parts of that documentation have been copied here. |
| |
The protocol is used over a serial byte data stream. Examples are a serial port (UART/COM Port) or a TCP port. The data is exchanged over this channel in [[packets|packets]]. In this communication the gdb sends commands and the gdb server sends replies. | The protocol is used over a serial byte data stream. Examples are a serial port (UART/COM Port) or a TCP port. The data is exchanged over this channel in [[packets|packets]]. In this communication the gdb sends commands and the gdb server sends replies. |
| |
===== commands ===== | In the documentation format strings everything [inside of square brackets] is optional and can be missing. |
| |
* '!' [[cmd_exclamation_mark|Enable extended mode]] | ===== signals ===== |
| |
| [[signals|include/gdb/signals.h]] |
| |
| ===== commands ===== |
| |
| * '!' [[cmd_exclamation_mark|Enable extended mode]] **must be supported** |
* '?' [[cmd_question_mark|question mark]] | * '?' [[cmd_question_mark|question mark]] |
* 'A' [[cmd_uc_a|A]] | * 'A' [[cmd_uc_a|A]] |
* 'bc' [[cmd_bc|backward continue]] | * 'bc' [[cmd_bc|backward continue]] |
* 'bs' [[cmd_bs|backward single step]] | * 'bs' [[cmd_bs|backward single step]] |
* 'c' [[cmd_lc_c|continue]] | * 'c' [[cmd_lc_c|continue]] **must be supported** |
* 'C' [[cmd_uc_c|continue with signal]] | * 'C' [[cmd_uc_c|continue with signal]] |
* 'd' [[cmd_lc_d|toggle debug flag]] **don't use** | * 'd' [[cmd_lc_d|toggle debug flag]] **don't use** |
* 'D' [[cmd_uc_d|detach]] | * 'D' [[cmd_uc_d|detach]] |
* 'F' [[cmd_uc_f|file i/o]] | * 'F' [[cmd_uc_f|file i/o]] |
* 'g' [[cmd_lc_g|read general register]] | * 'g' [[cmd_lc_g|read general register]] **must be supported** |
* 'G' [[cmd_uc_g|write general register]] | * 'G' [[cmd_uc_g|write general register]] **must be supported** |
* 'H' [[cmd_uc_h|select thread]] | * 'H' [[cmd_uc_h|select thread]] |
* 'i' [[cmd_lc_i|single clock step]] | * 'i' [[cmd_lc_i|single clock step]] |
* 'I' [[cmd_uc_i|signal cycle step]] | * 'I' [[cmd_uc_i|signal cycle step]] |
* 'k' [[cmd_lc_k|kill]] | * 'k' [[cmd_lc_k|kill]] |
* 'm' [[cmd_lc_m|read memory]] | * 'm' [[cmd_lc_m|read memory]] **must be supported** |
* 'M' [[cmd_uc_m|write memory]] | * 'M' [[cmd_uc_m|write memory]] **must be supported** |
* 'p' [[cmd_lc_p|read register]] | * 'p' [[cmd_lc_p|read register]] |
* 'P' [[cmd_uc_p|write register]] | * 'P' [[cmd_uc_p|write register]] |
* 'r' [[cmd_lc_r|reset]] **don't use** | * 'r' [[cmd_lc_r|reset]] **don't use** |
* 'R' [[cmd_uc_r|restart program being debugged]] | * 'R' [[cmd_uc_r|restart program being debugged]] |
* 's' [[cmd_lc_s|single step]] | * 's' [[cmd_lc_s|single step]] **must be supported** |
* 'S' [[cmd_uc_s|signal single step]] | * 'S' [[cmd_uc_s|signal single step]] |
* 't' [[cmd_lc_t|search backwards]] | * 't' [[cmd_lc_t|search backwards]] |
* 'T' [[cmd_uc_t|is thread alive]] | * 'T' [[cmd_uc_t|is thread alive]] |
* 'vAttach' [[cmd_vattach|attach to a new process]] | * 'vAttach' [[cmd_vattach|attach to a new process]] |
* 'vCont' [[cmd_vcont|continue trhead]] | * 'vCont' [[cmd_vcont|continue trhead]] **must be supported** |
* 'vCont?' [[cmd_vcont_qm|request supported actions of 'vCont']] | * 'vCont?' [[cmd_vcont_qm|request supported actions of 'vCont']] |
* 'vCtrlC' [[cmd_vctrl|interrupt remote target]] | * 'vCtrlC' [[cmd_vctrl|interrupt remote target]] |
| |
===== replies ===== | ===== replies ===== |
* [[reply_empty|empty]] | * "" [[reply_empty|empty]] |
* [[reply_e_xx|Error Hex]] | * "E" [[reply_e_xx|Error Hex]] |
* [[reply_e_text|Error text]] | * "E" [[reply_e_text|Error text]] |
* [[reply_stop_uc_s|stopped because of Signal]] | * "S" [[reply_stop_uc_s|stopped because of Signal]] |
* [[reply_stop_uc_t|stopped because of Signal + infos]] | * "T" [[reply_stop_uc_t|stopped because of Signal + infos]] |
* [[reply_stop_lc_w|thread exited]] | * "w" [[reply_stop_lc_w|thread exited]] |
* [[reply_stop_uc_w|process exited]] | * "W" [[reply_stop_uc_w|process exited]] |
* [[reply_stop_uc_x|process terminated]] | * "X" [[reply_stop_uc_x|process terminated]] |
* [[reply_stop_uc_n|no more threads]] | * "N" [[reply_stop_uc_n|no more threads]] |
* [[reply_stop_uc_o|console output]] | * "O" [[reply_stop_uc_o|console output]] |
* [[reply_stop_uc_f|host function call]] | * "F" [[reply_stop_uc_f|host function call]] |
* [[notification_stop|notification stop]] | * [[notification_stop|notification stop]] |
| |
| IDE | Integrated Development environment | | | IDE | Integrated Development environment | |
| MCU | Micro Controller Unit | | | MCU | Micro Controller Unit | |
| | addressable memory units | TODO | |