mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 21:21:09 +00:00
kgdb: core changes to support kdb
These are the minimum changes to the kgdb core in order to enable an API to connect a new front end (kdb) to the debug core. This patch introduces the dbg_kdb_mode variable controls where the user level I/O is routed. It will be routed to the gdbstub (kgdb) or to the kdb front end which is a simple shell available over the kgdboc connection. You can switch back and forth between kdb or the gdb stub mode of operation dynamically. From gdb stub mode you can blindly type "$3#33", or from the kdb mode you can enter "kgdb" to switch to the gdb stub. The logic in the debug core depends on kdb to look for the typical gdb connection sequences and return immediately with KGDB_PASS_EVENT if a gdb serial command sequence is detected. That should allow a reasonably seamless transition between kdb -> gdb without leaving the kernel exception state. The two gdb serial queries that kdb is responsible for detecting are the "?" and "qSupported" packets. CC: Ingo Molnar <mingo@elte.hu> Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Acked-by: Martin Hicks <mort@sgi.com>
This commit is contained in:
parent
67fc4e0cb9
commit
dcc7871128
9 changed files with 186 additions and 20 deletions
|
@ -887,6 +887,13 @@ int gdb_serial_stub(struct kgdb_state *ks)
|
|||
case 'Z': /* Break point set */
|
||||
gdb_cmd_break(ks);
|
||||
break;
|
||||
#ifdef CONFIG_KGDB_KDB
|
||||
case '3': /* Escape into back into kdb */
|
||||
if (remcom_in_buffer[1] == '\0') {
|
||||
gdb_cmd_detachkill(ks);
|
||||
return DBG_PASS_EVENT;
|
||||
}
|
||||
#endif
|
||||
case 'C': /* Exception passing */
|
||||
tmp = gdb_cmd_exception_pass(ks);
|
||||
if (tmp > 0)
|
||||
|
@ -932,3 +939,32 @@ kgdb_exit:
|
|||
error = 1;
|
||||
return error;
|
||||
}
|
||||
|
||||
int gdbstub_state(struct kgdb_state *ks, char *cmd)
|
||||
{
|
||||
int error;
|
||||
|
||||
switch (cmd[0]) {
|
||||
case 'e':
|
||||
error = kgdb_arch_handle_exception(ks->ex_vector,
|
||||
ks->signo,
|
||||
ks->err_code,
|
||||
remcom_in_buffer,
|
||||
remcom_out_buffer,
|
||||
ks->linux_regs);
|
||||
return error;
|
||||
case 's':
|
||||
case 'c':
|
||||
strcpy(remcom_in_buffer, cmd);
|
||||
return 0;
|
||||
case '?':
|
||||
gdb_cmd_status(ks);
|
||||
break;
|
||||
case '\0':
|
||||
strcpy(remcom_out_buffer, "");
|
||||
break;
|
||||
}
|
||||
dbg_io_ops->write_char('+');
|
||||
put_packet(remcom_out_buffer);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue