| 570 | } |
| 571 | |
| 572 | unsafe fn register_unwind_info(&mut self) -> Result<()> { |
| 573 | if self.unwind.len() == 0 { |
| 574 | return Ok(()); |
| 575 | } |
| 576 | #[cfg(has_host_compiler_backend)] |
| 577 | { |
| 578 | let text = self.text(); |
| 579 | let unwind_info = &self.mmap[self.unwind.clone()]; |
| 580 | let registration = unsafe { |
| 581 | crate::runtime::vm::UnwindRegistration::new( |
| 582 | text.as_ptr(), |
| 583 | unwind_info.as_ptr(), |
| 584 | unwind_info.len(), |
| 585 | ) |
| 586 | .context("failed to create unwind info registration")? |
| 587 | }; |
| 588 | self.unwind_registration = Some(registration); |
| 589 | return Ok(()); |
| 590 | } |
| 591 | #[cfg(not(has_host_compiler_backend))] |
| 592 | { |
| 593 | bail!("should not have unwind info for non-native backend") |
| 594 | } |
| 595 | } |
| 596 | |
| 597 | #[cfg(feature = "debug-builtins")] |
| 598 | fn register_debug_image(&mut self) -> Result<()> { |