| 604 | } |
| 605 | |
| 606 | pub fn set_debug_info(&mut self, path: PathBuf) -> anyhow::Result<()> { |
| 607 | tracing::info!("Using debug info from: {}", path.display()); |
| 608 | let file = |
| 609 | std::fs::read(&path).with_context(|| format!("failed to read `{}`", path.display()))?; |
| 610 | self.debug_info.add_file(&file, 0).map_err(|e| { |
| 611 | anyhow::format_err!("error setting debug info for `{}`: {e}", path.display()) |
| 612 | })?; |
| 613 | self.elf_path = Some(path); |
| 614 | Ok(()) |
| 615 | } |
| 616 | |
| 617 | fn get_active_exception(&mut self, cpu: &mut Cpu) -> u64 { |
| 618 | cpu.read_reg(self.xpsr) & 0x1ff |