[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 04/20] mcdstub: added header with defines specific to the mcd
|
From: |
Nicolas Eder |
|
Subject: |
[PATCH v3 04/20] mcdstub: added header with defines specific to the mcd tcp packet communication |
|
Date: |
Tue, 7 Nov 2023 14:03:07 +0100 |
---
include/mcdstub/mcd_shared_defines.h | 108 +++++++++++++++++++++++++++
1 file changed, 108 insertions(+)
create mode 100644 include/mcdstub/mcd_shared_defines.h
diff --git a/include/mcdstub/mcd_shared_defines.h
b/include/mcdstub/mcd_shared_defines.h
new file mode 100644
index 0000000000..fa1adb5c77
--- /dev/null
+++ b/include/mcdstub/mcd_shared_defines.h
@@ -0,0 +1,108 @@
+/*
+ *this file is shared between the mcd dll and the mcd stub.
+ *it has to be kept exectly the same!
+ */
+
+#ifndef MCD_SHARED_DEFINES
+#define MCD_SHARED_DEFINES
+
+/* default tcp port */
+#define MCD_DEFAULT_TCP_PORT "1235"
+
+/* tcp data characters */
+#define TCP_CHAR_OPEN_SERVER 'I'
+#define TCP_CHAR_OPEN_CORE 'i'
+#define TCP_CHAR_GO 'C'
+#define TCP_CHAR_STEP 'c'
+#define TCP_CHAR_BREAK 'b'
+#define TCP_CHAR_QUERY 'q'
+#define TCP_CHAR_CLOSE_SERVER 'D'
+#define TCP_CHAR_CLOSE_CORE 'd'
+#define TCP_CHAR_KILLQEMU 'k'
+#define TCP_CHAR_RESET 'r'
+#define TCP_CHAR_READ_REGISTER 'p'
+#define TCP_CHAR_WRITE_REGISTER 'P'
+#define TCP_CHAR_READ_MEMORY 'm'
+#define TCP_CHAR_WRITE_MEMORY 'M'
+#define TCP_CHAR_BREAKPOINT_INSERT 't'
+#define TCP_CHAR_BREAKPOINT_REMOVE 'T'
+
+/* tcp protocol chars */
+#define TCP_ACKNOWLEDGED '+'
+#define TCP_NOT_ACKNOWLEDGED '-'
+#define TCP_COMMAND_START '$'
+#define TCP_COMMAND_END '#'
+#define TCP_WAS_LAST '|'
+#define TCP_WAS_NOT_LAST '~'
+#define TCP_HANDSHAKE_SUCCESS "shaking your hand"
+#define TCP_EXECUTION_SUCCESS "success"
+#define TCP_EXECUTION_ERROR "error"
+
+/* tcp query arguments */
+#define QUERY_FIRST "f"
+#define QUERY_CONSEQUTIVE "c"
+#define QUERY_END_INDEX "!"
+
+#define QUERY_ARG_SYSTEM "system"
+#define QUERY_ARG_CORES "cores"
+#define QUERY_ARG_RESET "reset"
+#define QUERY_ARG_TRIGGER "trigger"
+#define QUERY_ARG_MEMORY "memory"
+#define QUERY_ARG_REGGROUP "reggroup"
+#define QUERY_ARG_REG "reg"
+#define QUERY_ARG_STATE "state"
+
+/* tcp query packet argument list */
+#define TCP_ARGUMENT_NAME "name"
+#define TCP_ARGUMENT_DATA "data"
+#define TCP_ARGUMENT_ID "id"
+#define TCP_ARGUMENT_TYPE "type"
+#define TCP_ARGUMENT_BITS_PER_MAU "bpm"
+#define TCP_ARGUMENT_INVARIANCE "i"
+#define TCP_ARGUMENT_ENDIAN "e"
+#define TCP_ARGUMENT_MIN "min"
+#define TCP_ARGUMENT_MAX "max"
+#define TCP_ARGUMENT_SUPPORTED_ACCESS_OPTIONS "sao"
+#define TCP_ARGUMENT_REGGROUPID "reggroupid"
+#define TCP_ARGUMENT_MEMSPACEID "memspaceid"
+#define TCP_ARGUMENT_SIZE "size"
+#define TCP_ARGUMENT_THREAD "thread"
+#define TCP_ARGUMENT_ADDRESS "address"
+#define TCP_ARGUMENT_STOP_STRING "stop_str"
+#define TCP_ARGUMENT_INFO_STRING "info_str"
+#define TCP_ARGUMENT_STATE "state"
+#define TCP_ARGUMENT_EVENT "event"
+#define TCP_ARGUMENT_DEVICE "device"
+#define TCP_ARGUMENT_CORE "core"
+#define TCP_ARGUMENT_AMOUNT_CORE "nr_cores"
+#define TCP_ARGUMENT_AMOUNT_TRIGGER "nr_trigger"
+#define TCP_ARGUMENT_OPTION "option"
+#define TCP_ARGUMENT_ACTION "action"
+#define TCP_ARGUMENT_OPCODE "opcode"
+
+/* for packets sent to qemu */
+#define ARGUMENT_SEPARATOR ';'
+#define NEGATIVE_FLAG 0
+#define POSITIVE_FLAG 1
+
+/* core states */
+#define CORE_STATE_RUNNING "running"
+#define CORE_STATE_HALTED "halted"
+#define CORE_STATE_DEBUG "debug"
+#define CORE_STATE_UNKNOWN "unknown"
+
+/* breakpoint types */
+#define MCD_BREAKPOINT_HW 1
+#define MCD_BREAKPOINT_READ 2
+#define MCD_BREAKPOINT_WRITE 3
+#define MCD_BREAKPOINT_RW 4
+
+/* trigger data */
+#define MCD_TRIG_ACT_BREAK "check_data_value"
+#define MCD_TRIG_OPT_VALUE "break_on_trigger"
+
+/* register mem space key words */
+#define MCD_GRP_KEYWORD "GPR"
+#define MCD_CP_KEYWORD "CP"
+
+#endif
--
2.34.1
- Re: [PATCH v3 05/20] mcdstub: tcp packet processing added, (continued)
- [PATCH v3 20/20] mcdstub: updated MAINTAINERS file and fully activated the mcdstub in the meson build system, Nicolas Eder, 2023/11/07
- [PATCH v3 18/20] mcdstub: read/write to memory added: This also includes various helper functions in the QEMU memory code, Nicolas Eder, 2023/11/07
- [PATCH v3 02/20] mcdstub gdbstub: new DebugClass and DebugState introduced. They are used to abstract the debugger details behind a QOM. This is currently used in the cpu_handle_guest_debug function, Nicolas Eder, 2023/11/07
- [PATCH v3 11/20] mcdstub: reset and trigger queries added, Nicolas Eder, 2023/11/07
- [PATCH v3 06/20] mcdstub: open/close server functions and trigger/reset data added. User for initial connection with an mcd client, Nicolas Eder, 2023/11/07
- [PATCH v3 12/20] mcdstub: missing parse_reg_xml function for parsing gdb register xml files added, Nicolas Eder, 2023/11/07
- [PATCH v3 13/20] mcdstub: added queries for memory spaces, register groups and registers, Nicolas Eder, 2023/11/07
- [PATCH v3 19/20] mcdstub: break/watchpoints added, Nicolas Eder, 2023/11/07
- [PATCH v3 14/20] mcdstub: missing handle_query_state function added, Nicolas Eder, 2023/11/07
- [PATCH v3 04/20] mcdstub: added header with defines specific to the mcd tcp packet communication,
Nicolas Eder <=
- [PATCH v3 16/20] mcdstub: function construct for resets added, Nicolas Eder, 2023/11/07
- [PATCH v3 15/20] mcdstub: added go, break and step functionality and all corresponding functions, Nicolas Eder, 2023/11/07
- [PATCH v3 03/20] gdbstub: moving code so that it can be easier accessed from outside the gdbstub: fromhex and tohex functions moved to a cutils header. GDBRegisterState moved to gdbstub.h, Nicolas Eder, 2023/11/07
- [PATCH v3 17/20] mcdstub: reading/writing registers added, Nicolas Eder, 2023/11/07
- Re: [PATCH v3 00/20] first version of mcdstub, Philippe Mathieu-Daudé, 2023/11/08
- Re: [PATCH v3 00/20] first version of mcdstub, Alex Bennée, 2023/11/29