This is so annoying. You’ve written a Rust crate and now that you want to test it for the very first time, it doesn’t work! Ok, ok. You calm yours

Where everything went wrong... – traitshifter – Who are you today?

submited by
Style Pass
2024-04-22 11:00:09

This is so annoying. You’ve written a Rust crate and now that you want to test it for the very first time, it doesn’t work!

Ok, ok. You calm yourself down. Lets start from the beginning. You want to create so called minidumps. This is a file that contains information about a crashed program (like stacks of all threads, CPU registers, system info, etc.). The minidump consists of various sections, such as the minidump header (including time of day, versions and basically a table of contents), a thread section (including all threads of the process and their stacks), memory mappings and libraries, etc. [Just to give some context, as all of this is actually not really important.]

For this, you created a crate. One section gets written after the other, while information about the targeted process is retrieved from the system. You even created a nice, simple API. You hand in a process ID and an open file, where the minidump should be written to. like this:

Okay, maybe you could enhance your library error handling, a little. And by enhance, you mean “implement one in the first place”.

Leave a Comment