kernel: throw error when debugging invalid process

When debugging an invalid process (e.g. not yet run, terminated, etc.)
return an error rather than silently continuing.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2023-03-10 09:20:43 +08:00
parent 7b36f33ef9
commit ec97b3cdcf

View file

@ -2267,9 +2267,9 @@ impl SystemServices {
}
});
let new_process_state = match process_state {
ProcessState::Allocated => ProcessState::Allocated,
ProcessState::Free => ProcessState::Free,
ProcessState::Setup(thread_init) => ProcessState::Setup(thread_init),
ProcessState::Allocated | ProcessState::Free | ProcessState::Setup(_) => {
return Err(xous_kernel::Error::ProcessNotFound)
}
ProcessState::Ready(tids) => ProcessState::Debug(tids),
ProcessState::Exception(tids) => ProcessState::Exception(tids),
ProcessState::BlockedException(tids) => ProcessState::BlockedException(tids),