Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kill debugee on debugger exit #62

Merged
merged 2 commits into from Jul 30, 2020
Merged

Conversation

JJendryka
Copy link
Contributor

Closes #48. If debugee was launched by debugger it is killed when debugger exits.

Copy link
Member

@nbaksalyar nbaksalyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

@@ -141,6 +143,12 @@ impl LinuxTarget {
})
.collect())
}

/// Kill debuggee when debugger exits.
fn kill_on_exit(&self) -> Result<(), Box<dyn std::error::Error>> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be a pub fn for the case when a user wants to use this option after attach, but it's unclear whether this should be a function call, or a configuration parameter like target.attach(pid, Config { kill_on_exit: true, ... }). Let's leave it as it is now & create an issue for future reference.

@nbaksalyar nbaksalyar merged commit 34ac757 into headcrab-rs:master Jul 30, 2020
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use PTRACE_O_EXITKILL on Linux
2 participants