Fix some warnings
This commit is contained in:
@@ -11,7 +11,7 @@ use crate::{
|
||||
core::commands::CoreCmd,
|
||||
decode::Instruction,
|
||||
exceptions::ExceptionType,
|
||||
gdb::{self, DebugCommand, StopReason},
|
||||
gdb::{self, DebugCommand, DebugStream, StopReason},
|
||||
instructions::find_and_exec,
|
||||
mem::MemConfig,
|
||||
};
|
||||
@@ -39,7 +39,7 @@ impl Core {
|
||||
loop {
|
||||
if let Ok(cmd) = self.command_stream.try_recv() {
|
||||
match cmd {
|
||||
CoreCmd::EnterDbgMode(dbg_stream) => {
|
||||
CoreCmd::EnterDbgMode(DebugStream(dbg_stream)) => {
|
||||
let _ = self.debug_loop(dbg_stream);
|
||||
}
|
||||
};
|
||||
@@ -57,7 +57,7 @@ impl Core {
|
||||
if let Ok(cmd) = self.command_stream.recv() {
|
||||
eprintln!("Recieved a command");
|
||||
match cmd {
|
||||
CoreCmd::EnterDbgMode(dbg_stream) => {
|
||||
CoreCmd::EnterDbgMode(DebugStream(dbg_stream)) => {
|
||||
let _ = self.debug_loop(dbg_stream);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
use std::sync::mpsc;
|
||||
|
||||
use crate::gdb;
|
||||
|
||||
pub enum CoreCmd {
|
||||
EnterDbgMode(mpsc::Receiver<gdb::DebugCommand>),
|
||||
EnterDbgMode(gdb::DebugStream),
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ pub(crate) enum DebugCommand {
|
||||
ExitDebugMode,
|
||||
}
|
||||
|
||||
pub struct DebugStream(pub(crate) mpsc::Receiver<DebugCommand>);
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub(crate) enum StopReason {
|
||||
Exception(ExceptionType),
|
||||
@@ -74,7 +76,7 @@ pub fn run_stub(cmd_sender: mpsc::Sender<CoreCmd>) {
|
||||
.expect("Couldnt set TCP stream to nonblocking");
|
||||
|
||||
cmd_sender
|
||||
.send(CoreCmd::EnterDbgMode(dbg_rx))
|
||||
.send(CoreCmd::EnterDbgMode(DebugStream(dbg_rx)))
|
||||
.expect("couldnt ask core to enter debug mode");
|
||||
|
||||
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)
|
||||
// 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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user