Fix some warnings
This commit is contained in:
@@ -11,7 +11,7 @@ use crate::{
|
|||||||
core::commands::CoreCmd,
|
core::commands::CoreCmd,
|
||||||
decode::Instruction,
|
decode::Instruction,
|
||||||
exceptions::ExceptionType,
|
exceptions::ExceptionType,
|
||||||
gdb::{self, DebugCommand, StopReason},
|
gdb::{self, DebugCommand, DebugStream, StopReason},
|
||||||
instructions::find_and_exec,
|
instructions::find_and_exec,
|
||||||
mem::MemConfig,
|
mem::MemConfig,
|
||||||
};
|
};
|
||||||
@@ -39,7 +39,7 @@ impl Core {
|
|||||||
loop {
|
loop {
|
||||||
if let Ok(cmd) = self.command_stream.try_recv() {
|
if let Ok(cmd) = self.command_stream.try_recv() {
|
||||||
match cmd {
|
match cmd {
|
||||||
CoreCmd::EnterDbgMode(dbg_stream) => {
|
CoreCmd::EnterDbgMode(DebugStream(dbg_stream)) => {
|
||||||
let _ = self.debug_loop(dbg_stream);
|
let _ = self.debug_loop(dbg_stream);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -57,7 +57,7 @@ impl Core {
|
|||||||
if let Ok(cmd) = self.command_stream.recv() {
|
if let Ok(cmd) = self.command_stream.recv() {
|
||||||
eprintln!("Recieved a command");
|
eprintln!("Recieved a command");
|
||||||
match cmd {
|
match cmd {
|
||||||
CoreCmd::EnterDbgMode(dbg_stream) => {
|
CoreCmd::EnterDbgMode(DebugStream(dbg_stream)) => {
|
||||||
let _ = self.debug_loop(dbg_stream);
|
let _ = self.debug_loop(dbg_stream);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
use std::sync::mpsc;
|
|
||||||
|
|
||||||
use crate::gdb;
|
use crate::gdb;
|
||||||
|
|
||||||
pub enum CoreCmd {
|
pub enum CoreCmd {
|
||||||
EnterDbgMode(mpsc::Receiver<gdb::DebugCommand>),
|
EnterDbgMode(gdb::DebugStream),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ pub(crate) enum DebugCommand {
|
|||||||
ExitDebugMode,
|
ExitDebugMode,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct DebugStream(pub(crate) mpsc::Receiver<DebugCommand>);
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
pub(crate) enum StopReason {
|
pub(crate) enum StopReason {
|
||||||
Exception(ExceptionType),
|
Exception(ExceptionType),
|
||||||
@@ -74,7 +76,7 @@ pub fn run_stub(cmd_sender: mpsc::Sender<CoreCmd>) {
|
|||||||
.expect("Couldnt set TCP stream to nonblocking");
|
.expect("Couldnt set TCP stream to nonblocking");
|
||||||
|
|
||||||
cmd_sender
|
cmd_sender
|
||||||
.send(CoreCmd::EnterDbgMode(dbg_rx))
|
.send(CoreCmd::EnterDbgMode(DebugStream(dbg_rx)))
|
||||||
.expect("couldnt ask core to enter debug mode");
|
.expect("couldnt ask core to enter debug mode");
|
||||||
|
|
||||||
handle_gdb_connection(stream, dbg_tx).expect("failure during connection");
|
handle_gdb_connection(stream, dbg_tx).expect("failure during connection");
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
// This file is part of TRVE (https://gitea.taitep.se/taitep/trve)
|
// This file is part of TRVE (https://gitea.taitep.se/taitep/trve)
|
||||||
// See LICENSE file in the project root for full license text.
|
// See LICENSE file in the project root for full license text.
|
||||||
|
|
||||||
use std::{env, path::PathBuf, sync::Arc, time::Duration};
|
use std::{path::PathBuf, sync::Arc, time::Duration};
|
||||||
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user