[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 24/29] step and go handlers now propperly perform global opera
|
From: |
Nicolas Eder |
|
Subject: |
[PATCH v2 24/29] step and go handlers now propperly perform global operations |
|
Date: |
Fri, 6 Oct 2023 11:06:05 +0200 |
From: neder <nicolas.eder@lauterbach.com>
---
mcdstub/mcd_shared_defines.h | 2 ++
mcdstub/mcdstub.c | 35 +++++++++++++++++++++--------------
2 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/mcdstub/mcd_shared_defines.h b/mcdstub/mcd_shared_defines.h
index 5cfda4121d..5fbd732252 100644
--- a/mcdstub/mcd_shared_defines.h
+++ b/mcdstub/mcd_shared_defines.h
@@ -78,6 +78,8 @@
/* for packets sent to qemu */
#define ARGUMENT_SEPARATOR ';'
+#define NEGATIVE_FLAG 0
+#define POSITIVE_FLAG 1
/* core states */
#define CORE_STATE_RUNNING "running"
diff --git a/mcdstub/mcdstub.c b/mcdstub/mcdstub.c
index b19ca471ea..7613ed2c4a 100644
--- a/mcdstub/mcdstub.c
+++ b/mcdstub/mcdstub.c
@@ -435,7 +435,7 @@ int mcd_handle_packet(const char *line_buf)
};
go_cmd_desc.cmd = (char[2]) { TCP_CHAR_GO, '\0' };
strcpy(go_cmd_desc.schema,
- (char[2]) { ARG_SCHEMA_CORENUM, '\0' });
+ (char[3]) { ARG_SCHEMA_INT, ARG_SCHEMA_CORENUM, '\0' });
cmd_parser = &go_cmd_desc;
}
break;
@@ -446,7 +446,7 @@ int mcd_handle_packet(const char *line_buf)
};
step_cmd_desc.cmd = (char[2]) { TCP_CHAR_STEP, '\0' };
strcpy(step_cmd_desc.schema,
- (char[2]) { ARG_SCHEMA_CORENUM, '\0' });
+ (char[3]) { ARG_SCHEMA_INT, ARG_SCHEMA_CORENUM, '\0' });
cmd_parser = &step_cmd_desc;
}
break;
@@ -608,28 +608,35 @@ 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 */
- uint32_t cpu_id = get_param(params, 0)->cpu_id;
- CPUState *cpu = mcd_get_cpu(cpu_id);
- mcd_cpu_start(cpu);
+ uint32_t global = get_param(params, 0)->data_uint32_t;
+ if (global == 1) {
+ mcd_vm_start();
+ } else{
+ uint32_t cpu_id = get_param(params, 1)->cpu_id;
+ CPUState *cpu = mcd_get_cpu(cpu_id);
+ mcd_cpu_start(cpu);
+ }
}
void handle_vm_step(GArray *params, void *user_ctx)
{
- /* TODO: add partial restart with arguments and so on */
- uint32_t cpu_id = get_param(params, 0)->cpu_id;
-
- CPUState *cpu = mcd_get_cpu(cpu_id);
- int return_value = mcd_cpu_sstep(cpu);
- if (return_value != 0) {
- g_assert_not_reached();
+ uint32_t global = get_param(params, 0)->data_uint32_t;
+ if (global == 1) {
+ /* TODO: add multicore support */
+ } else{
+ uint32_t cpu_id = get_param(params, 1)->cpu_id;
+ CPUState *cpu = mcd_get_cpu(cpu_id);
+ int return_value = mcd_cpu_sstep(cpu);
+ if (return_value != 0) {
+ g_assert_not_reached();
+ }
}
}
void handle_vm_stop(GArray *params, void *user_ctx)
{
- /* TODO: add partial stop with arguments and so on */
+ /* TODO: add core dependant break option */
mcd_vm_stop();
}
--
2.34.1
- [PATCH v2 10/29] handler for resets added, (continued)
- [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, 2023/10/06
- [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 <=
- [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
- [PATCH v2 25/29] Doxygen documentation added, Nicolas Eder, 2023/10/06
- [PATCH v2 20/29] cp register read/write added, Nicolas Eder, 2023/10/06
- [PATCH v2 28/29] added description to out-commented gdb function, Nicolas Eder, 2023/10/06