mirror of
https://github.com/urbit/ares.git
synced 2024-12-23 21:31:57 +03:00
main: add stop_for_debug feature to stop Ares when it starts for a debugger to attach
This commit is contained in:
parent
f092c482ee
commit
820b1ac57a
@ -55,3 +55,4 @@ check_acyclic = []
|
||||
check_forwarding = []
|
||||
check_junior = []
|
||||
sham_hints = []
|
||||
stop_for_debug = []
|
||||
|
@ -5,10 +5,13 @@ use std::io;
|
||||
|
||||
fn main() -> io::Result<()> {
|
||||
// debug
|
||||
// eprintln!("serf: pid {}", std::process::id());
|
||||
// if unsafe { libc::kill(std::process::id() as i32, libc::SIGSTOP) } != 0 {
|
||||
// panic!("Could not stop ourselves.");
|
||||
// };
|
||||
#[cfg(feature = "stop_for_debug")]
|
||||
{
|
||||
eprintln!("serf: pid {}", std::process::id());
|
||||
if unsafe { libc::kill(std::process::id() as i32, libc::SIGSTOP) } != 0 {
|
||||
panic!("Could not stop ourselves.");
|
||||
};
|
||||
}
|
||||
|
||||
let filename = env::args().nth(1).expect("Must provide input filename");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user