[lldb] Don't run code for CanJIT() while creating the ObjC runtime (#227555)
When libobjc lacks class_getMethodImplementation, the ObjC trampoline
handler calls CanJIT() to decide whether to warn. Without the _M
packet, CanJIT() allocated memory by calling mmap in the inferior.
Setting up that call unwinds the stack, which asks for the ObjC
runtime. The runtime isn't registered yet, so LLDB creates another one
and recurses until the stack overflows.
Ask the process plugin whether it can allocate memory instead of
trying it. ProcessGDBRemote probes the _M packet and otherwise checks
for an mmap symbol, neither of which runs code in the inferior.
rdar://188335027
GitOrigin-RevId: 30183cb96ab0fb33d4f7aebd5126e75b852f3ba3
7 files changed