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

Resolve symbols #46

Merged
merged 8 commits into from Jul 26, 2020
Merged

Resolve symbols #46

merged 8 commits into from Jul 26, 2020

Conversation

bjorn3
Copy link
Contributor

@bjorn3 bjorn3 commented Jul 25, 2020

Fixes #44
Based on #34

src/lib.rs Outdated
@@ -1,5 +1,8 @@
//! Headcrab, a modern Rust debugging library.

#[macro_use]
extern crate rental;
Copy link
Member

Choose a reason for hiding this comment

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

This crate seems to be archived & not maintained anymore and the author recommends to explore other solutions: https://github.com/jpernst/rental

As it seems, in this PR it's only used for safe borrowing of Mmap - I wonder if we can do the same with contained unsafe code? What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't know it was archived.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have extracted the actual debuginfo parsing into ParsedDwarf::new keeping Dwarf::new as a thin wrapper that only handles the self-referential part. I have also written some unsafe code as replacement for rental. I am currently waiting on a review over at the t-lang/wg-unsafe-code-guidelines stream of the rust-lang zulip.

Copy link
Member

Choose a reason for hiding this comment

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

Thank you!

some unsafe code as replacement for rental

This can be submitted as a separate issue/PR, if it would be easier for you.
I'm going to review the rest of the code now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I got a review, so I pushed it.

@bjorn3 bjorn3 mentioned this pull request Jul 26, 2020
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.

Looking good! That's a great addition, thanks 👍

@@ -9,7 +9,7 @@ static BIN_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/testees/hell

#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
#[test]
fn read_memory() -> Result<(), Box<dyn std::error::Error>> {
fn read_regs() -> 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.

Good catch :)

@nbaksalyar nbaksalyar merged commit 4c70439 into headcrab-rs:master Jul 26, 2020
@bjorn3 bjorn3 deleted the resolve_symbols branch July 26, 2020 20:49
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.

Map addr<->symbol name
2 participants