Skip to content

Commit

Permalink
Emit a MODULE record for PE files (#814)
Browse files Browse the repository at this point in the history
PE files reference their corresponding debug file via name and DebugId.
We can put these in a CfiCache `MODULE` entry to be able to backfill a missing DebugFile/DebugId in
a minidump.
  • Loading branch information
Swatinem authored Sep 22, 2023
1 parent 480e680 commit e96f555
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 21 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

**Internal**

- Emit a MODULE record for PE files ([#814](https://github.com/getsentry/symbolic/pull/814))

## 12.4.1

**Fixes**
Expand All @@ -13,6 +19,7 @@
- `discover_sourcemaps_location` returns source mapping URLs without query parameters or fragments ([#809](https://github.com/getsentry/symbolic/pull/809))

**Internal**

- Updated `gimli`, `goblin`, `indexmap`, and `minidump` dependencies ([#811](https://github.com/getsentry/symbolic/pull/811))
- `Cargo.lock` is now included in the repository ([#811](https://github.com/getsentry/symbolic/pull/811))

Expand Down
51 changes: 30 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions symbolic-cfi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,19 @@ impl CfiCache<'static> {
pub fn from_object(object: &Object<'_>) -> Result<Self, CfiError> {
let mut buffer = vec![];
write_preamble(&mut buffer, CFICACHE_LATEST_VERSION)?;

if let Object::Pe(pe) = object {
let debug_file = pe.debug_file_name();
if let Some(debug_file) = debug_file {
writeln!(
buffer,
"MODULE windows {} {} {debug_file}",
object.arch().name(),
object.debug_id().breakpad(),
)?;
}
}

AsciiCfiWriter::new(&mut buffer).process(object)?;

let byteview = ByteView::from_vec(buffer);
Expand Down

0 comments on commit e96f555

Please sign in to comment.