Skip to content

Commit ec0ee82

Browse files
committed
build_error: document observed cases where DWARF reconstruction failed
1 parent 4fc9caf commit ec0ee82

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/binary_analysis/build_error.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ pub fn build_error_detection<'tcx, 'obj>(cx: &AnalysisCtxt<'tcx>, file: &File<'o
114114
}
115115

116116
let result: Result<_, super::dwarf::Error> = try {
117+
// Try to recover line information from DWARF. This may not succeed if LLVM
118+
// merged code from multiple call sites.
119+
//
120+
// If this happens there's no easy way to determine which inlined call sites
121+
// triggered this. We *could* attempt some more advanced heuristics, e.g.
122+
// reconstruct the control flow from assembly and then find the predecessor
123+
// blocks that lead to this, but there'll be no way of determining for sure.
117124
let loc = loader.locate(section.index(), offset)?.ok_or(
118125
super::dwarf::Error::UnexpectedDwarf("cannot find line number info"),
119126
)?;

0 commit comments

Comments
 (0)