Skip to content

Commit d3ced1f

Browse files
authored
Merge pull request #9773 from jasonmolenda/cp/141727563-initialize-cputype-in-test-corefile-61
[lldb][Mach-O] Initialize cputype/cpusubtype in test corefiles (llvm#120518)
2 parents 10942e8 + 283ec08 commit d3ced1f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lldb/test/API/macosx/lc-note/firmware-corefile/create-empty-corefile.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,14 @@ void add_lc_segment(std::vector<std::vector<uint8_t>> &loadcmds,
189189

190190
std::string get_uuid_from_binary(const char *fn, cpu_type_t &cputype,
191191
cpu_subtype_t &cpusubtype) {
192+
// We may be given a file, set reasonable values.
193+
#if defined(__x86_64__)
194+
cputype = CPU_TYPE_X86;
195+
cpusubtype = CPU_SUBTYPE_X86_ALL;
196+
#else
197+
cputype = CPU_TYPE_ARM64;
198+
cpusubtype = CPU_SUBTYPE_ARM64_ALL;
199+
#endif
192200
if (strlen(fn) == 0)
193201
return {};
194202

0 commit comments

Comments
 (0)