Skip to content

Commit

Permalink
Integrate frame remapping into symbolicate_jvm
Browse files Browse the repository at this point in the history
  • Loading branch information
loewenheim committed Feb 23, 2024
1 parent 846b13c commit a4fa954
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 2 additions & 0 deletions crates/symbolicator-proguard/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,6 @@ pub struct JvmModule {
pub struct CompletedJvmSymbolicationResponse {
/// The exceptions after remapping.
pub exceptions: Vec<JvmException>,
/// The stacktraces after remapping.
pub stacktraces: Vec<JvmStacktrace>,
}
19 changes: 18 additions & 1 deletion crates/symbolicator-proguard/src/symbolication.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::interface::{
CompletedJvmSymbolicationResponse, JvmException, JvmFrame, SymbolicateJvmStacktraces,
CompletedJvmSymbolicationResponse, JvmException, JvmFrame, JvmStacktrace,
SymbolicateJvmStacktraces,
};
use crate::ProguardService;

Expand All @@ -14,6 +15,7 @@ impl ProguardService {
scope,
sources,
exceptions,
stacktraces,
modules,
..
} = request;
Expand All @@ -40,8 +42,23 @@ impl ProguardService {
.push(Self::map_exception(&mappers, &raw_exception).unwrap_or(raw_exception));
}

let mut remapped_stacktraces = Vec::with_capacity(stacktraces.len());

for raw_stacktrace in stacktraces {
let remapped_frames = raw_stacktrace
.frames
.iter()
.flat_map(|frame| Self::map_frame(&mappers, frame).into_iter())
.collect();

remapped_stacktraces.push(JvmStacktrace {
frames: remapped_frames,
});
}

CompletedJvmSymbolicationResponse {
exceptions: remapped_exceptions,
stacktraces: remapped_stacktraces,
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/symbolicator-proguard/tests/integration/proguard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async fn test_remap_exception() {
apply_source_context: false,
};

let CompletedJvmSymbolicationResponse { exceptions } =
let CompletedJvmSymbolicationResponse { exceptions, .. } =
symbolication.symbolicate_jvm(request).await;

let remapped_exception = JvmException {
Expand Down

0 comments on commit a4fa954

Please sign in to comment.