[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 04/29] queries for resets and triggers added
From: |
Nicolas Eder |
Subject: |
[PATCH v2 04/29] queries for resets and triggers added |
Date: |
Fri, 6 Oct 2023 11:05:45 +0200 |
From: neder <nicolas.eder@lauterbach.com>
---
mcdstub/internals.h | 9 +++++++++
mcdstub/mcdstub.c | 19 ++++++++++++++++++-
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/mcdstub/internals.h b/mcdstub/internals.h
index 5af705a12a..ce3bffe7e6 100644
--- a/mcdstub/internals.h
+++ b/mcdstub/internals.h
@@ -11,6 +11,14 @@
#define MAX_PACKET_LENGTH 1024
+// trigger defines
+#define MCD_TRIG_TYPE_IP 0x00000001
+#define MCD_TRIG_TYPE_READ 0x00000002
+#define MCD_TRIG_TYPE_WRITE 0x00000004
+#define MCD_TRIG_TYPE_RW 0x00000008
+#define MCD_TRIG_OPT_DATA_IS_CONDITION 0x00000008
+#define MCD_TRIG_ACTION_DBG_DEBUG 0x00000001
+
/*
* lookuptable for transmitted signals
*/
@@ -180,6 +188,7 @@ CPUState *find_cpu(uint32_t thread_id);
void handle_core_open(GArray *params, void *user_ctx);
void handle_query_reset(GArray *params, void *user_ctx);
void handle_detach(GArray *params, void *user_ctx);
+void handle_query_trigger(GArray *params, void *user_ctx);
void mcd_continue(void);
/* sycall handling */
diff --git a/mcdstub/mcdstub.c b/mcdstub/mcdstub.c
index 75b38d910a..1d066c8169 100644
--- a/mcdstub/mcdstub.c
+++ b/mcdstub/mcdstub.c
@@ -57,6 +57,10 @@ static const MCDCmdParseEntry mcd_gen_query_table[] = {
.handler = handle_query_reset,
.cmd = "reset",
},
+ {
+ .handler = handle_query_trigger,
+ .cmd = "trigger",
+ },
};
void mcd_init_mcdserver_state(void)
@@ -991,7 +995,8 @@ void handle_core_open(GArray *params, void *user_ctx) {
void handle_query_reset(GArray *params, void *user_ctx) {
// resetting has to be done over a monitor (look ar Rcmd) so we tell MCD
that we can reset but this still need to be implemented
// we only support one reset over this monitor and that would be a fully
"system_restart"
- mcd_put_packet("info_rst=\"results in a full system restart\"");
+
mcd_put_packet("nr=\"3\",info=\"0,full_system_reset;1,gpr_reset;2,memory_reset;\"");
+ // TODO: we still need to implement the gpr and memory reset here!
}
void handle_detach(GArray *params, void *user_ctx) {
@@ -1022,6 +1027,18 @@ void handle_detach(GArray *params, void *user_ctx) {
}
}
+void handle_query_trigger(GArray *params, void *user_ctx) {
+ // set the type, option and action bitmask and send it
+
+ uint32_t type = (MCD_TRIG_TYPE_IP | MCD_TRIG_TYPE_READ |
MCD_TRIG_TYPE_WRITE | MCD_TRIG_TYPE_RW);
+ uint32_t option = (MCD_TRIG_OPT_DATA_IS_CONDITION);
+ uint32_t action = (MCD_TRIG_ACTION_DBG_DEBUG);
+ uint32_t nr_trigger = 4;
+
+ g_string_append_printf(mcdserver_state.str_buf,
"nr=\"%d\",info=\"%d;%d;%d;\"", nr_trigger, type, option, action);
+ mcd_put_strbuf();
+}
+
void mcd_continue(void)
{
if (!runstate_needs_reset()) {
--
2.34.1
- [PATCH v2 00/29] first version of mcdstub, Nicolas Eder, 2023/10/06
- [PATCH v2 02/29] TCP chardev added, handshake with TRACE32 working, Nicolas Eder, 2023/10/06
- [PATCH v2 01/29] mcdstub initial commit, mcdstub file structure added, Nicolas Eder, 2023/10/06
- [PATCH v2 04/29] queries for resets and triggers added,
Nicolas Eder <=
- [PATCH v2 06/29] query for registers added, Nicolas Eder, 2023/10/06
- [PATCH v2 03/29] TCP packet handling added, Nicolas Eder, 2023/10/06
- [PATCH v2 08/29] shared header file added, used for TCP packet data, Nicolas Eder, 2023/10/06
- [PATCH v2 05/29] queries for memory spaces and register groups added, Nicolas Eder, 2023/10/06
- [PATCH v2 09/29] memory and register query data now stored per core, Nicolas Eder, 2023/10/06
- [PATCH v2 07/29] query data preparation improved, Nicolas Eder, 2023/10/06
- [PATCH v2 10/29] handler for resets added, Nicolas Eder, 2023/10/06
- [PATCH v2 11/29] query for the VM state added, Nicolas Eder, 2023/10/06
- [PATCH v2 12/29] handler for reading registers added, Nicolas Eder, 2023/10/06