KSCrash icon indicating copy to clipboard operation
KSCrash copied to clipboard

Macros may be misused.

Open ShowHandAce opened this issue 5 years ago • 2 comments

In KSCrashReportSinkQuincyHockey.m file, line237. Did you mean CPU_SUBTYPE_ARM64_V8? Does the subType CPU_SUBTYPE_ARM_V8 exist in the CPU architecture of arm64? Looking forward to your reply~ Best wishes~

ShowHandAce avatar Aug 06 '19 09:08 ShowHandAce

I think it should be CPU_SUBTYPE_ARM64_V8, then I found a sample code here:

case CPU_TYPE_ARM64:
	if (bootarg_no64exec) return 0;

	switch (hostsubtype) {
		case CPU_SUBTYPE_ARM64_V8:
			switch (execsubtype) {
			case CPU_SUBTYPE_ARM64_V8:
				return 9;
			case CPU_SUBTYPE_ARM64_ALL:
				return 8;
			}
			break;

	break;

Reference: https://opensource.apple.com/source/xnu/xnu-4570.41.2/bsd/dev/arm/kern_machdep.c

ZhiyuWong avatar Aug 08 '19 11:08 ZhiyuWong

@ZhiyuWong I thought the same.But for now I have another question. In usr/include/mach-o/arch.h I found a func named NXGetArchInfoFromCpuType().With cputype and cpusubtype this func returns NXArchInfo,which we can get the architecture name by arch_info->name. Why the author do not use this func? Does the func have any problems I have not realized?

Reference:https://opensource.apple.com/source/cctools/cctools-921/libmacho/arch.c

ShowHandAce avatar Aug 14 '19 07:08 ShowHandAce