mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
Merge branch 'main' of github.com:betrusted-io/xous-core into main
This commit is contained in:
commit
d50b620f33
3 changed files with 47 additions and 18 deletions
6
kernel/Cargo.lock
generated
6
kernel/Cargo.lock
generated
|
|
@ -1,5 +1,7 @@
|
||||||
# This file is automatically @generated by Cargo.
|
# This file is automatically @generated by Cargo.
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "addr2line"
|
name = "addr2line"
|
||||||
version = "0.15.2"
|
version = "0.15.2"
|
||||||
|
|
@ -207,7 +209,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gdbstub"
|
name = "gdbstub"
|
||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
source = "git+https://github.com/daniel5151/gdbstub.git?branch=feature/state-machine-recv-packet#3d424fff1b80712c7afb04b5058e4f7baa921997"
|
source = "git+https://github.com/daniel5151/gdbstub.git?rev=5c702d063baaf78e4ebed7842cc8b96195d119a8#5c702d063baaf78e4ebed7842cc8b96195d119a8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 0.1.10",
|
"cfg-if 0.1.10",
|
||||||
"log",
|
"log",
|
||||||
|
|
@ -219,7 +221,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gdbstub_arch"
|
name = "gdbstub_arch"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/daniel5151/gdbstub.git?branch=feature/state-machine-recv-packet#3d424fff1b80712c7afb04b5058e4f7baa921997"
|
source = "git+https://github.com/daniel5151/gdbstub.git?rev=5c702d063baaf78e4ebed7842cc8b96195d119a8#5c702d063baaf78e4ebed7842cc8b96195d119a8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gdbstub",
|
"gdbstub",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,9 @@ version = "0.8.2"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bitflags = "1.2.1"
|
bitflags = "1.2.1"
|
||||||
gdbstub = {git = "https://github.com/daniel5151/gdbstub.git", branch = "feature/state-machine-recv-packet", optional = true, default_features = false}
|
# gdbstub branch "dev/0.6"
|
||||||
gdbstub_arch = {git = "https://github.com/daniel5151/gdbstub.git", branch = "feature/state-machine-recv-packet", optional = true}
|
gdbstub = {git = "https://github.com/daniel5151/gdbstub.git", optional = true, default_features = false, rev = "5c702d063baaf78e4ebed7842cc8b96195d119a8"}
|
||||||
|
gdbstub_arch = {git = "https://github.com/daniel5151/gdbstub.git", optional = true, rev = "5c702d063baaf78e4ebed7842cc8b96195d119a8"}
|
||||||
sha3 = {default-features = false, version = "0.8.2"}
|
sha3 = {default-features = false, version = "0.8.2"}
|
||||||
stats_alloc = {version = "0.1.8", optional = true}
|
stats_alloc = {version = "0.1.8", optional = true}
|
||||||
xous-kernel = {package = "xous", path = "../xous-rs", features = ["forget-memory-messages"]}
|
xous-kernel = {package = "xous", path = "../xous-rs", features = ["forget-memory-messages"]}
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,9 @@ impl Target for XousTarget {
|
||||||
fn base_ops(&mut self) -> BaseOps<Self::Arch, Self::Error> {
|
fn base_ops(&mut self) -> BaseOps<Self::Arch, Self::Error> {
|
||||||
BaseOps::MultiThread(self)
|
BaseOps::MultiThread(self)
|
||||||
}
|
}
|
||||||
|
fn breakpoints(&mut self) -> Option<gdbstub::target::ext::breakpoints::BreakpointsOps<Self>> {
|
||||||
|
Some(self)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MultiThreadOps for XousTarget {
|
impl MultiThreadOps for XousTarget {
|
||||||
|
|
@ -64,8 +67,13 @@ impl MultiThreadOps for XousTarget {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_resume_action(&mut self, _tid: Tid, _action: ResumeAction) -> Result<(), Self::Error> {
|
fn set_resume_action(&mut self, _tid: Tid, action: ResumeAction) -> Result<(), Self::Error> {
|
||||||
Ok(())
|
match action {
|
||||||
|
ResumeAction::Step | ResumeAction::StepWithSignal(_) => {
|
||||||
|
Err("single-stepping resume action not supported")
|
||||||
|
}
|
||||||
|
ResumeAction::Continue | ResumeAction::ContinueWithSignal(_) => Ok(()),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_registers(
|
fn read_registers(
|
||||||
|
|
@ -75,8 +83,6 @@ impl MultiThreadOps for XousTarget {
|
||||||
) -> TargetResult<(), Self> {
|
) -> TargetResult<(), Self> {
|
||||||
crate::services::SystemServices::with(|system_services| {
|
crate::services::SystemServices::with(|system_services| {
|
||||||
let current_pid = system_services.current_pid();
|
let current_pid = system_services.current_pid();
|
||||||
// gprintln!("Getting registers for thread {}", tid);
|
|
||||||
|
|
||||||
// Actiavte the debugging process and iterate through it,
|
// Actiavte the debugging process and iterate through it,
|
||||||
// noting down each active thread.
|
// noting down each active thread.
|
||||||
let debugging_pid = self.pid.unwrap();
|
let debugging_pid = self.pid.unwrap();
|
||||||
|
|
@ -238,6 +244,26 @@ impl MultiThreadOps for XousTarget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl gdbstub::target::ext::breakpoints::Breakpoints for XousTarget {
|
||||||
|
fn hw_breakpoint(
|
||||||
|
&mut self,
|
||||||
|
) -> Option<gdbstub::target::ext::breakpoints::HwBreakpointOps<Self>> {
|
||||||
|
Some(self)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl gdbstub::target::ext::breakpoints::HwBreakpoint for XousTarget {
|
||||||
|
#[inline(never)]
|
||||||
|
fn add_hw_breakpoint(&mut self, _addr: u32, _kind: usize) -> TargetResult<bool, Self> {
|
||||||
|
Ok(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline(never)]
|
||||||
|
fn remove_hw_breakpoint(&mut self, _addr: u32, _kind: usize) -> TargetResult<bool, Self> {
|
||||||
|
Ok(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn handle(b: u8) -> bool {
|
pub fn handle(b: u8) -> bool {
|
||||||
if let Some(XousDebugState {
|
if let Some(XousDebugState {
|
||||||
mut target,
|
mut target,
|
||||||
|
|
@ -258,23 +284,23 @@ pub fn handle(b: u8) -> bool {
|
||||||
gdb
|
gdb
|
||||||
}
|
}
|
||||||
Ok((_, Some(_disconnect_reason))) => {
|
Ok((_, Some(_disconnect_reason))) => {
|
||||||
// match disconnect_reason {
|
|
||||||
// DisconnectReason::Disconnect => gprintln!("GDB Disconnected"),
|
|
||||||
// DisconnectReason::TargetExited(_) => gprintln!("Target exited"),
|
|
||||||
// DisconnectReason::TargetTerminated(_) => unreachable!(),
|
|
||||||
// DisconnectReason::Kill => gprintln!("GDB sent a kill command"),
|
|
||||||
// }
|
|
||||||
cleanup();
|
cleanup();
|
||||||
|
match _disconnect_reason {
|
||||||
|
DisconnectReason::Disconnect => println!("GDB Disconnected"),
|
||||||
|
DisconnectReason::TargetExited(_) => println!("Target exited"),
|
||||||
|
DisconnectReason::TargetTerminated(_) => unreachable!(),
|
||||||
|
DisconnectReason::Kill => println!("GDB sent a kill command"),
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Err(GdbStubError::TargetError(e)) => {
|
Err(GdbStubError::TargetError(e)) => {
|
||||||
println!("Target raised a fatal error: {}", e);
|
|
||||||
cleanup();
|
cleanup();
|
||||||
|
println!("Target raised a fatal error: {}", e);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("gdbstub internal error: {}", e);
|
|
||||||
cleanup();
|
cleanup();
|
||||||
|
println!("gdbstub internal error: {}", e);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Ok((gdb, None)) => gdb,
|
Ok((gdb, None)) => gdb,
|
||||||
|
|
@ -291,13 +317,13 @@ pub fn handle(b: u8) -> bool {
|
||||||
gdb
|
gdb
|
||||||
}
|
}
|
||||||
Ok((_, Some(disconnect_reason))) => {
|
Ok((_, Some(disconnect_reason))) => {
|
||||||
println!("client disconnected: {:?}", disconnect_reason);
|
|
||||||
cleanup();
|
cleanup();
|
||||||
|
println!("client disconnected: {:?}", disconnect_reason);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("deferred_stop_reason_error: {:?}", e);
|
|
||||||
cleanup();
|
cleanup();
|
||||||
|
println!("deferred_stop_reason_error: {:?}", e);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue