Skip to content

Commit d98210b

Browse files
committed
Fix macOS FindProcessImpl()
1 parent eb52809 commit d98210b

File tree

1 file changed

+15
-10
lines changed
  • lldb/source/Host/macosx/objcxx

1 file changed

+15
-10
lines changed

lldb/source/Host/macosx/objcxx/Host.mm

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,9 @@ DataExtractor data(arg_data.GetBytes(), arg_data_size,
595595
const llvm::Triple::ArchType triple_arch = triple.getArch();
596596
const bool check_for_ios_simulator =
597597
(triple_arch == llvm::Triple::x86 ||
598-
triple_arch == llvm::Triple::x86_64);
598+
triple_arch == llvm::Triple::x86_64 ||
599+
triple_arch == llvm::Triple::aarch64);
600+
599601
const char *cstr = data.GetCStr(&offset);
600602
if (cstr) {
601603
process_info.GetExecutableFile().SetFile(cstr, FileSpec::Style::native);
@@ -621,22 +623,25 @@ DataExtractor data(arg_data.GetBytes(), arg_data_size,
621623
}
622624

623625
Environment &proc_env = process_info.GetEnvironment();
626+
bool is_simulator = false;
624627
while ((cstr = data.GetCStr(&offset))) {
625628
if (cstr[0] == '\0')
626629
break;
627630

628-
if (check_for_ios_simulator) {
629-
if (strncmp(cstr, "SIMULATOR_UDID=", strlen("SIMULATOR_UDID=")) ==
630-
0)
631-
process_info.GetArchitecture().GetTriple().setOS(
632-
llvm::Triple::IOS);
633-
else
634-
process_info.GetArchitecture().GetTriple().setOS(
635-
llvm::Triple::MacOSX);
636-
}
631+
if (check_for_ios_simulator &&
632+
strncmp(cstr, "SIMULATOR_UDID=", strlen("SIMULATOR_UDID=")) ==
633+
0)
634+
is_simulator = true;
637635

638636
proc_env.insert(cstr);
639637
}
638+
llvm::Triple &triple = process_info.GetArchitecture().GetTriple();
639+
if (is_simulator) {
640+
triple.setOS(llvm::Triple::IOS);
641+
triple.setEnvironment(llvm::Triple::Simulator);
642+
} else {
643+
triple.setOS(llvm::Triple::MacOSX);
644+
}
640645
return true;
641646
}
642647
}

0 commit comments

Comments
 (0)