Enable checking global elf cache for unwinding.

The ART code can do unwinds while in signal handlers. Normally
this isn't a problem, but if something like fdtrack is also doing
unwinds, there is a chance that a fdtrack unwind will be interrupted
while doing an ART unwind. If this happens where both are using the
global elf cache, this can mean a deadlock because the fdtrack
code owns an elf lock that the ART code is waiting on in the
signal handler since they are both sharing elf objects through the
global cache.

In order to fix this deadlock condition, all usage of AndroidUnwinder
objects will now default to not even checking if the global elf
cache is enabled. For ART, this change will allow only the ART
unwinders to check the global elf cache if it gets enabled. This
way only ART will use the global elf cache.

The global elf cache is enabled by calling:

  unwindstack::Elf::SetCachingEnabled(true);

And is enabled by the ART UnwindHelper struct.

Bug: 434879811

FLAG: EXEMPT update

Test: treehugger
Change-Id: I1a34b25daf72514276e9d1a9a8e32a89bb5611cf
3 files changed