使用lldb -p pid 附加上unity进程, 然后找上面这行,加上断点命令,就可以了. 以下内容仅用作查找上面这一行的上下文使用
text:000000010187CE6F loc_10187CE6F: ; CODE XREF: __text:000000010187CD4Bj
__text:000000010187CE6F mov edi, [rbp-0BF4h]
__text:000000010187CE75 mov esi, 1
__text:000000010187CE7A xor edx, edx
__text:000000010187CE7C xor ecx, ecx
__text:000000010187CE7E call __ZN12SpritePacker25RebuildAtlasCacheIfNeededE19BuildTargetPlatformbNS_21SpritePackerExecutionEb ; SpritePacker::RebuildAtlasCacheIfNeeded(BuildTargetPlatform,bool,SpritePacker::SpritePackerExecution,bool)
__text:000000010187CE83 test al, al
__text:000000010187CE85 jz loc_10187D017
__text:000000010187CE8B call __Z15GetScriptMapperv ; GetScriptMapper(void)
__text:000000010187CE90 mov rbx, rax
__text:000000010187CE93 call __Z17GetPlayerSettingsv ; GetPlayerSettings(void)
__text:000000010187CE98 mov al, [rax+384h]
__text:000000010187CE9E mov [rbx+3Ch], al
__text:000000010187CEA1 mov eax, [rbp-1024h]
__text:000000010187CEA7 and eax, 10h
__text:000000010187CEAA mov [rbp-1008h], eax
__text:000000010187CEB0 shr eax, 4
__text:000000010187CEB3 mov r15d, [rbp-0BF4h]
__text:000000010187CEBA mov [rbp-1048h], r15d
__text:000000010187CEC1 and r15d, 0FFFFFFFEh
__text:000000010187CEC5 cmp r15d, 6
__text:000000010187CEC9 setz r12b
__text:000000010187CECD or r12b, al
__text:000000010187CED0 mov r13b, 1
__text:000000010187CED3 jnz short loc_10187CEE3
__text:000000010187CED5 mov rax, [rbp-1038h]
__text:000000010187CEDC cmp dword ptr [rax], 0
__text:000000010187CEDF setnz r13b
__text:000000010187CEE3
__text:000000010187CEE3 loc_10187CEE3: ; CODE XREF: __text:000000010187CED3j
__text:000000010187CEE3 mov edi, [rbp-1048h]
__text:000000010187CEE9 call __Z25CalculateEndianessOptions19BuildTargetPlatform ; CalculateEndianessOptions(BuildTargetPlatform)
__text:000000010187CEEE mov r14d, eax
__text:000000010187CEF1 mov edi, [rbp-1048h]
__text:000000010187CEF7 call __Z34DoesTargetPlatformSupportTypeTrees19BuildTargetPlatform ; DoesTargetPlatformSupportTypeTrees(BuildTargetPlatform)
__text:000000010187CEFC test al, al
__text:000000010187CEFE mov eax, 140h
__text:000000010187CF03 mov ecx, 4000140h
__text:000000010187CF08 cmovz eax, ecx
__text:000000010187CF0B test r12b, 1
__text:000000010187CF0F cmovz eax, ecx
__text:000000010187CF12 or eax, r14d <--这里下断点加上断点命令 register write eax 0x140
__text:000000010187CF15 mov ebx, eax
__text:000000010187CF17 or ebx, 80000h
__text:000000010187CF1D test r13b, r13b
__text:000000010187CF20 cmovnz ebx, eax
__text:000000010187CF23 call __Z17GetPlayerSettingsv ; GetPlayerSettings(void)
__text:000000010187CF28 cmp byte ptr [rax+15Bh], 0
__text:000000010187CF2F jz short loc_10187CF37
__text:000000010187CF31 or ebx, 400000h
__text:000000010187CF37
__text:000000010187CF37 loc_10187CF37: ; CODE XREF: __text:000000010187CF2Fj
__text:000000010187CF37 cmp r15d, 6
__text:000000010187CF3B jnz short loc_10187CF79
__text:000000010187CF3D mov eax, ebx
__text:000000010187CF3F and eax, 80000h
__text:000000010187CF44 jz short loc_10187CF79
__text:000000010187CF46 mov qword ptr [rsp+8], 0
__text:000000010187CF4F mov dword ptr [rsp], 0
__text:000000010187CF56 lea rdi, aFlagsKbuildres ; "!((flags & kBuildResourceImage) && IsWe"...
__text:000000010187CF5D lea rdx, asc_10342C675 ; "/Users/builduser/buildslave/unity/build"...
__text:000000010187CF64 xor esi, esi
__text:000000010187CF66 mov ecx, 5E6h
__text:000000010187CF6B mov r8d, 2
__text:000000010187CF71 xor r9d, r9d
__text:000000010187CF74 call __Z17DebugStringToFilePKciS0_iiiiPFvRK11CppLogEntryE ; DebugStringToFile(char const*,int,char const*,int,int,int,int,void (*)(CppLogEntry const&))
__text:000000010187CF79
__text:000000010187CF79 loc_10187CF79: ; CODE XREF: __text:000000010187CF3Bj
__text:000000010187CF79 ; __text:000000010187CF44j
__text:000000010187CF79 mov rax, [rbp+18h]
__text:000000010187CF7D mov ecx, ebx
__text:000000010187CF7F or ecx, 40000000h
__text:000000010187CF85 test ebx, 4000000h
__text:000000010187CF8B cmovz ecx, ebx
__text:000000010187CF8E cmp dword ptr [rbp-1008h], 0
__text:000000010187CF95 cmovz ecx, ebx
__text:000000010187CF98 mov [rbp-1064h], ecx
__text:000000010187CF9E mov rsi, [rbp-1020h]
__text:000000010187CFA5 mov rcx, [rsi+8]
__text:000000010187CFA9 sub rcx, [rsi]
__text:000000010187CFAC shr rcx, 4
__text:000000010187CFB0 mov [rbp-1050h], rcx
__text:000000010187CFB7 movzx ecx, r13b
__text:000000010187CFBB mov [rbp-1058h], rcx
__text:000000010187CFC2 movss xmm0, dword ptr [rax+4]
__text:000000010187CFC7 subss xmm0, dword ptr [rax]
__text:000000010187CFCB movss dword ptr [rbp-1010h], xmm0
__text:000000010187CFD3 lea rdi, [rbp-0CB8h]
__text:000000010187CFDA call __ZNSt6vectorI8UnityStrSaIS0_EEC2ERKS2_ ; std::vector>::vector(std::vector> const&)
__text:000000010187CFDF mov [rbp-1071h], r13b
__text:000000010187CFE6 mov [rbp-1072h], r12b
__text:000000010187CFED mov r14, [rbp-0CB8h]
__text:000000010187CFF4 mov r15, [rbp-0CB0h]
__text:000000010187CFFB cmp r15, r14
__text:000000010187CFFE jz loc_10187D1A1
__text:000000010187D004 xor r13d, r13d
__text:000000010187D007 xor r12d, r12d
__text:000000010187D00A jmp loc_10187D0F0