[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 18/29] making step and go handlers core-specific
From: |
Nicolas Eder |
Subject: |
[PATCH v2 18/29] making step and go handlers core-specific |
Date: |
Fri, 6 Oct 2023 11:05:59 +0200 |
From: neder <nicolas.eder@lauterbach.com>
---
mcdstub/mcdstub.c | 26 ++++++++++++++++++++++----
mcdstub/mcdstub.h | 3 ++-
2 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/mcdstub/mcdstub.c b/mcdstub/mcdstub.c
index 4327703bca..8fc95d96a4 100644
--- a/mcdstub/mcdstub.c
+++ b/mcdstub/mcdstub.c
@@ -434,6 +434,8 @@ int mcd_handle_packet(const char *line_buf)
.handler = handle_vm_start,
};
go_cmd_desc.cmd = (char[2]) { TCP_CHAR_GO, '\0' };
+ strcpy(go_cmd_desc.schema,
+ (char[2]) { ARG_SCHEMA_CORENUM, '\0' });
cmd_parser = &go_cmd_desc;
}
break;
@@ -606,7 +608,9 @@ int mcd_handle_packet(const char *line_buf)
void handle_vm_start(GArray *params, void *user_ctx)
{
/* TODO: add partial restart with arguments and so on */
- mcd_vm_start();
+ uint32_t cpu_id = get_param(params, 0)->cpu_id;
+ CPUState *cpu = mcd_get_cpu(cpu_id);
+ mcd_cpu_start(cpu);
}
void handle_vm_step(GArray *params, void *user_ctx)
@@ -615,7 +619,7 @@ void handle_vm_step(GArray *params, void *user_ctx)
uint32_t cpu_id = get_param(params, 0)->cpu_id;
CPUState *cpu = mcd_get_cpu(cpu_id);
- int return_value = mcd_vm_sstep(cpu);
+ int return_value = mcd_cpu_sstep(cpu);
if (return_value != 0) {
g_assert_not_reached();
}
@@ -1619,11 +1623,25 @@ void mcd_vm_start(void)
}
}
-int mcd_vm_sstep(CPUState *cpu)
+void mcd_cpu_start(CPUState *cpu)
+{
+ if (!runstate_needs_reset() && !runstate_is_running() &&
+ !vm_prepare_start(false)) {
+ mcdserver_state.c_cpu = cpu;
+ qemu_clock_enable(QEMU_CLOCK_VIRTUAL, true);
+ cpu_resume(cpu);
+ }
+}
+
+int mcd_cpu_sstep(CPUState *cpu)
{
mcdserver_state.c_cpu = cpu;
cpu_single_step(cpu, mcdserver_state.sstep_flags);
- mcd_vm_start();
+ if (!runstate_needs_reset() && !runstate_is_running() &&
+ !vm_prepare_start(true)) {
+ qemu_clock_enable(QEMU_CLOCK_VIRTUAL, true);
+ cpu_resume(cpu);
+ }
return 0;
}
diff --git a/mcdstub/mcdstub.h b/mcdstub/mcdstub.h
index c2bdaee410..ab44252ba0 100644
--- a/mcdstub/mcdstub.h
+++ b/mcdstub/mcdstub.h
@@ -289,7 +289,8 @@ void handle_close_server(GArray *params, void *user_ctx);
void handle_close_core(GArray *params, void *user_ctx);
void handle_query_trigger(GArray *params, void *user_ctx);
void mcd_vm_start(void);
-int mcd_vm_sstep(CPUState *cpu);
+void mcd_cpu_start(CPUState *cpu);
+int mcd_cpu_sstep(CPUState *cpu);
void mcd_vm_stop(void);
void handle_query_reg_groups_f(GArray *params, void *user_ctx);
void handle_query_reg_groups_c(GArray *params, void *user_ctx);
--
2.34.1
- [PATCH v2 08/29] shared header file added, used for TCP packet data, (continued)
- [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
- [PATCH v2 16/29] deleting the mcdd startup option, Nicolas Eder, 2023/10/06
- [PATCH v2 15/29] adapting to the qemu coding style, Nicolas Eder, 2023/10/06
- [PATCH v2 18/29] making step and go handlers core-specific,
Nicolas Eder <=
- [PATCH v2 14/29] handler for single step added, Nicolas Eder, 2023/10/06
- [PATCH v2 13/29] handler for reading memory added, Nicolas Eder, 2023/10/06
- [PATCH v2 17/29] handler for breakpoints and watchpoints added, Nicolas Eder, 2023/10/06
- [PATCH v2 24/29] step and go handlers now propperly perform global operations, Nicolas Eder, 2023/10/06
- [PATCH v2 19/29] adding trigger ID handling for TRACE32, Nicolas Eder, 2023/10/06
- [PATCH v2 22/29] transitioning to unsinged integers in TCP packets and removing MCD-API-specific terms, Nicolas Eder, 2023/10/06
- [PATCH v2 21/29] switching between secure and non-secure memory added, Nicolas Eder, 2023/10/06
- [PATCH v2 23/29] moved all ARM code to the ARM mcdstub and added now commom header file, Nicolas Eder, 2023/10/06
- [PATCH v2 26/29] moved all mcd related header files into include/mcdstub, Nicolas Eder, 2023/10/06