gdb_main: Implemented vKill as it's required for GDB 11+
This commit is contained in:
parent
2378e8614e
commit
4ba77a60ca
|
@ -67,6 +67,7 @@ static target *last_target;
|
||||||
static void handle_q_packet(char *packet, size_t len);
|
static void handle_q_packet(char *packet, size_t len);
|
||||||
static void handle_v_packet(char *packet, size_t len);
|
static void handle_v_packet(char *packet, size_t len);
|
||||||
static void handle_z_packet(char *packet, size_t len);
|
static void handle_z_packet(char *packet, size_t len);
|
||||||
|
static void handle_kill_target(void);
|
||||||
|
|
||||||
static void gdb_target_destroy_callback(struct target_controller *tc, target *t)
|
static void gdb_target_destroy_callback(struct target_controller *tc, target *t)
|
||||||
{
|
{
|
||||||
|
@ -294,12 +295,7 @@ int gdb_main_loop(struct target_controller *tc, bool in_syscall)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'k': /* Kill the target */
|
case 'k': /* Kill the target */
|
||||||
if(cur_target) {
|
handle_kill_target();
|
||||||
target_reset(cur_target);
|
|
||||||
target_detach(cur_target);
|
|
||||||
last_target = cur_target;
|
|
||||||
cur_target = NULL;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'r': /* Reset the target system */
|
case 'r': /* Reset the target system */
|
||||||
|
@ -494,6 +490,16 @@ static const cmd_executer q_commands[]=
|
||||||
{NULL, NULL},
|
{NULL, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void handle_kill_target(void)
|
||||||
|
{
|
||||||
|
if (cur_target) {
|
||||||
|
target_reset(cur_target);
|
||||||
|
target_detach(cur_target);
|
||||||
|
last_target = cur_target;
|
||||||
|
cur_target = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void handle_q_packet(char *packet, const size_t length)
|
static void handle_q_packet(char *packet, const size_t length)
|
||||||
{
|
{
|
||||||
if (exec_command(packet, length, q_commands))
|
if (exec_command(packet, length, q_commands))
|
||||||
|
@ -527,6 +533,11 @@ static void handle_v_packet(char *packet, const size_t plen)
|
||||||
} else
|
} else
|
||||||
gdb_putpacketz("E01");
|
gdb_putpacketz("E01");
|
||||||
|
|
||||||
|
} else if (!strncmp(packet, "vKill;", 6)) {
|
||||||
|
/* Kill the target - we don't actually care about the PID that follows "vKill;" */
|
||||||
|
handle_kill_target();
|
||||||
|
gdb_putpacketz("OK");
|
||||||
|
|
||||||
} else if (!strncmp(packet, "vRun", 4)) {
|
} else if (!strncmp(packet, "vRun", 4)) {
|
||||||
/* Parse command line for get_cmdline semihosting call */
|
/* Parse command line for get_cmdline semihosting call */
|
||||||
char cmdline[83];
|
char cmdline[83];
|
||||||
|
|
Loading…
Reference in New Issue