[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 14/20] mcdstub: missing handle_query_state function added
From: |
Nicolas Eder |
Subject: |
[PATCH v3 14/20] mcdstub: missing handle_query_state function added |
Date: |
Tue, 7 Nov 2023 14:03:17 +0100 |
---
mcdstub/mcdstub.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/mcdstub/mcdstub.c b/mcdstub/mcdstub.c
index 56854c4c76..cd2f5db8e4 100644
--- a/mcdstub/mcdstub.c
+++ b/mcdstub/mcdstub.c
@@ -1466,3 +1466,32 @@ void handle_query_regs_c(GArray *params, void *user_ctx)
TCP_ARGUMENT_OPCODE, my_register.opcode);
mcd_put_strbuf();
}
+
+void handle_query_state(GArray *params, void *user_ctx)
+{
+ /*
+ * TODO: multicore support
+ * get state info
+ */
+ mcd_cpu_state_st state_info = mcdserver_state.cpu_state;
+ /* TODO: add event information */
+ uint32_t event = 0;
+ /* send data */
+ g_string_printf(mcdserver_state.str_buf,
+ "%s=%s.%s=%u.%s=%u.%s=%u.%s=%lu.%s=%s.%s=%s.",
+ TCP_ARGUMENT_STATE, state_info.state,
+ TCP_ARGUMENT_EVENT, event, TCP_ARGUMENT_THREAD, 0,
+ TCP_ARGUMENT_TYPE, state_info.bp_type,
+ TCP_ARGUMENT_ADDRESS, state_info.bp_address,
+ TCP_ARGUMENT_STOP_STRING, state_info.stop_str,
+ TCP_ARGUMENT_INFO_STRING, state_info.info_str);
+ mcd_put_strbuf();
+
+ /* reset debug info after first query */
+ if (strcmp(state_info.state, CORE_STATE_DEBUG) == 0) {
+ mcdserver_state.cpu_state.stop_str = "";
+ mcdserver_state.cpu_state.info_str = "";
+ mcdserver_state.cpu_state.bp_type = 0;
+ mcdserver_state.cpu_state.bp_address = 0;
+ }
+}
--
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 <=
- [PATCH v3 04/20] mcdstub: added header with defines specific to the mcd tcp packet communication, Nicolas Eder, 2023/11/07
- [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