Skip to content

Commit

Permalink
Add dsymutil binary for x86_64.
Browse files Browse the repository at this point in the history
  • Loading branch information
WINSDK committed Apr 19, 2024
1 parent e910701 commit fbc50f5
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 18 deletions.
File renamed without changes.
Binary file added debugvault/bin/dsymutil_x86_64
Binary file not shown.
41 changes: 24 additions & 17 deletions debugvault/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ impl Index {
let mut this = Self::default();

let dwarf = match obj {
object::File::MachO32(_) => macho_dwarf(obj, path)?,
object::File::MachO64(_) => macho_dwarf(obj, path)?,
#[cfg(target_os = "macos")]
object::File::MachO32(_) | object::File::MachO64(_) => macho_dwarf(obj, path)?,
_ => dwarf::Dwarf::parse(obj)?,
};

Expand Down Expand Up @@ -310,21 +310,28 @@ pub fn macho_dwarf(obj: &object::File, path: &Path) -> Result<Dwarf, dwarf::Erro
.join(path.file_name().unwrap());

if !opt_dsym.is_file() {
let dsymutil_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("bin/dsymutil");
assert!(dsymutil_path.exists(), "dsymutil somehow missing");

log::PROGRESS.set("Running dsymutil.", 1);
let exit_status =
Command::new(dsymutil_path).arg("--linker=parallel").arg(path).spawn()?.wait()?;
log::PROGRESS.step();

if !exit_status.success() {
log::complex!(
w "[macho::dwarf] ",
y "Generating dSym failed with exit code ",
g exit_status.code().unwrap_or(1).to_string(),
y "."
);
#[cfg(target_arch = "x86_64")]
let dsymutil_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("bin/dsymutil_x86_64");
#[cfg(target_arch = "aarch64")]
let dsymutil_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("bin/dsymutil_aarch64");

if dsymutil_path.exists() {
log::PROGRESS.set("Running dsymutil.", 1);
let exit_status = Command::new(dsymutil_path)
.arg("--linker=parallel")
.arg(path)
.spawn()?
.wait()?;
log::PROGRESS.step();

if !exit_status.success() {
log::complex!(
w "[macho::dwarf] ",
y "Generating dSym failed with exit code ",
g exit_status.code().unwrap_or(1).to_string(),
y "."
);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion gui/src/widgets/text_edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl TextEditState {
ctx.data_mut(|d| d.insert_persisted(id, self));
}

/// The the currently selected range of characters.
/// The currently selected range of characters.
pub fn ccursor_range(&self) -> Option<CCursorRange> {
self.ccursor_range
.or_else(|| self.cursor_range.map(|cursor_range| cursor_range.as_ccursor_range()))
Expand Down

0 comments on commit fbc50f5

Please sign in to comment.