Merge PtraceDumper and MinidumpWriter#155
Merged
gabrielesvelto merged 1 commit intorust-minidump:mainfrom Jul 28, 2025
Merged
Conversation
Collaborator
Author
|
Needless to say, this is a breaking change in the API (albeit not a huge one) |
Reorganizes a bunch of code and also updates some things to use emerging Rust
best-practices.
- Change use statements to use blocks
- Prefer to use `super::` rather than `crate::` where applicable
- Use mod.rs in a directory instead of <modname>.rs when a module has
submodules
- Move error type definitions closer to where they are used
- Most error types are pretty specific to a tight scope, so put them there
- Exception is the MinidumpWriter's error type - There's so much code that
it's better to put it in its own module
- Merge PtraceDumper and MinidumpWriter
- The split between them has been blurry for a while
- Merge them and their error types together
- A nice thing about the split was that `MinidumpWriter` had a bit of a
"builder config" behavior for `PtraceDumper`. Let's keep that!
- There is now a `MinidumpWriterConfig` that is explicitly a fluent API used
to configure `MinidumperWriter`
- Change functions that were tightly coupled to `MinidumpWriter` to just be
impls on it
- Update tests to accept new structure
Fixes rust-minidump#154
21bb451 to
c35af12
Compare
gabrielesvelto
approved these changes
Jul 25, 2025
Contributor
gabrielesvelto
left a comment
There was a problem hiding this comment.
This is looking very good, I think it makes the overall structure easier to follow and sheds some legacy we had inherited from Breakpad and didn't make sense anymore in the current code. However I'd like to hear @Jake-Shadle 's opinion on this given it's a breaking change in terms of API.
| } else { | ||
| Err(DumperError::PtraceDetachError(child, e)) | ||
| impl MinidumpWriterConfig { | ||
| pub fn new(process_id: Pid, blamed_thread: Pid) -> Self { |
Contributor
There was a problem hiding this comment.
Just a thought for the future: we do this in pretty much all our crates but we should really have a separate Tid types for threads. Obviously something for a follow-up.
Contributor
|
Thanks @Jake-Shadle! I'm merging it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merges PtraceDumper and MinidumpWriter
While I'm at it, also reorganize a bunch of code and update some things to use emerging Rust best-practices.
super::rather thancrate::where applicableMinidumpWriterhad a bit of a "builder config" behavior forPtraceDumper. Let's keep that!MinidumpWriterConfigthat is explicitly a fluent API used to configureMinidumperWriterMinidumpWriterto just be impls on itFixes #154