In InitializeZerothFrame check for a CFA/AFA or error out
authorJason Molenda <jason@molenda.com>
Mon, 6 Feb 2023 22:45:41 +0000 (14:45 -0800)
committerJason Molenda <jason@molenda.com>
Mon, 6 Feb 2023 22:53:50 +0000 (14:53 -0800)
commit701030c3ecba0621ce5d325667fb75b73cf1532b
treedb8354d452232cada7cc778d035fb42e5334e229
parent96bd36498b34824e179bd7f39a0e4356730bad51
In InitializeZerothFrame check for a CFA/AFA or error out

There is a failure where we somehow get an invalid register
number being used to calculate the canonical frame address,
and this ends up with lldb crashing with a null deref because it
assumes that it is always able to find information about that
register.

This patch adds a check for a failure to get a register, and
declares the frame invalid in that case, with some additional
logging or an assert for debug builds.

Differential Revision: https://reviews.llvm.org/D143232
rdar://104428038
lldb/source/Target/RegisterContextUnwind.cpp