vmm: Implement GDB event handler to enable --gdb flag

This commit adds event fds and the event handler to send/receive
requests and responses from the GDB thread. It also adds `--gdb` flag to
enable GDB stub feature.

Signed-off-by: Akira Moroo <retrage01@gmail.com>
This commit is contained in:
Akira Moroo
2022-02-20 12:51:34 +09:00
committed by Rob Bradford
parent 23bb629241
commit 2451c4d833
6 changed files with 217 additions and 5 deletions
+2 -2
View File
@@ -488,7 +488,7 @@ impl run_blocking::BlockingEventLoop for GdbEventLoop {
}
}
pub fn gdb_thread(mut gdbstub: GdbStub, path: &str) {
pub fn gdb_thread(mut gdbstub: GdbStub, path: &std::path::Path) {
let listener = match UnixListener::bind(path) {
Ok(s) => s,
Err(e) => {
@@ -496,7 +496,7 @@ pub fn gdb_thread(mut gdbstub: GdbStub, path: &str) {
return;
}
};
info!("Waiting for a GDB connection on {}...", path);
info!("Waiting for a GDB connection on {}...", path.display());
let (stream, addr) = match listener.accept() {
Ok(v) => v,