[lldb] Store StackFrameRecognizers in the target instead of a global list
authorRaphael Isemann <teemperor@gmail.com>
Fri, 17 Jul 2020 06:36:38 +0000 (08:36 +0200)
committerRaphael Isemann <teemperor@gmail.com>
Fri, 17 Jul 2020 07:26:27 +0000 (09:26 +0200)
commit1b7c9eae6dcad09c264e29e41a69bed0d34c2f5f
tree57241d42da54d2a003fc915567eac87ed92b871c
parentf5db2411c25399bf5e6e7258c9f7412dbee0b753
[lldb] Store StackFrameRecognizers in the target instead of a global list

Summary:

Currently the frame recognizers are stored in a global list (the list in the
StackFrameRecognizersManagerImpl singleton to be precise). All commands and
plugins that modify the list are just modifying that global list of recognizers
which is shared by all Target and Debugger instances.

This is clearly against the idea of LLDB being usable as a library and it also
leads to some very obscure errors as now multiple tests are sharing the used
frame recognizers. For example D83400 is currently failing as it reorders some
test_ functions which permanently changes the frame recognizers of all
debuggers/targets. As all frame recognizers are also initialized in a 'once'
guard, it's also impossible to every restore back the original frame recognizers
once they are deleted in a process.

This patch just moves the frame recognizers into the current target. This seems
the way everyone assumes the system works as for example the assert frame
recognizers is using the current target to find the function/so-name to look for
(which only works if the recognizers are stored in the target).

Reviewers: jingham, mib

Reviewed By: jingham, mib

Subscribers: MrHate, JDevlieghere

Differential Revision: https://reviews.llvm.org/D83757
lldb/include/lldb/Target/StackFrameRecognizer.h
lldb/include/lldb/Target/Target.h
lldb/include/lldb/lldb-forward.h
lldb/source/Commands/CommandObjectFrame.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
lldb/source/Target/AssertFrameRecognizer.cpp
lldb/source/Target/StackFrame.cpp
lldb/source/Target/StackFrameRecognizer.cpp
lldb/source/Target/Target.cpp
lldb/test/API/commands/frame/recognizer/TestFrameRecognizer.py
lldb/unittests/Target/StackFrameRecognizerTest.cpp