From edcc39929d13782c720c8f7b42c53ad21c07bc39 Mon Sep 17 00:00:00 2001 From: jD91mZM2 <me@krake.one> Date: Tue, 16 Jun 2020 13:58:36 +0200 Subject: [PATCH] Fix unused import I added that assert, because I managed to get an error I couldn't reproduce --- src/ptrace.rs | 2 +- src/scheme/proc.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ptrace.rs b/src/ptrace.rs index 90ca718..d098d9e 100644 --- a/src/ptrace.rs +++ b/src/ptrace.rs @@ -13,7 +13,7 @@ use crate::{ } }, common::unique::Unique, - context::{self, signal, Context, ContextId, Status}, + context::{self, signal, Context, ContextId}, event, scheme::proc, sync::WaitCondition, diff --git a/src/scheme/proc.rs b/src/scheme/proc.rs index 64346ee..07f9d91 100644 --- a/src/scheme/proc.rs +++ b/src/scheme/proc.rs @@ -345,6 +345,7 @@ impl Scheme for ProcScheme { })?, RegsKind::Int => try_stop_context(info.pid, |context| match unsafe { ptrace::regs_for(&context) } { None => { + assert!(!context.running, "try_stop_context is broken, clearly"); println!("{}:{}: Couldn't read registers from stopped process", file!(), line!()); Err(Error::new(ENOTRECOVERABLE)) }, -- GitLab