Clang added a new feature to the ObjC compiler that will translate method
authorJim Ingham <jingham@apple.com>
Thu, 23 Jan 2020 20:35:25 +0000 (12:35 -0800)
committerJim Ingham <jingham@apple.com>
Thu, 23 Jan 2020 20:41:14 +0000 (12:41 -0800)
commit29c7e6c8c97f6b1186f012d614e9a1100e8c06cb
tree9f451a35df147fcc8e3e10e2629a55f65bd259cf
parent6672a4f5b64f6b5a17cba63b421fcf313003b5b8
Clang added a new feature to the ObjC compiler that will translate method
calls to commonly un-overridden methods into a function that checks whether
the method is overridden anywhere and if not directly dispatches to the
NSObject implementation.

That means if you do override any of these methods, "step-in" will not step
into your code, since we hit the wrapper function, which has no debug info,
and immediately step out again.

Add code to recognize these functions as "trampolines" and a thread plan that
will get us from the function to the user code, if overridden.

<rdar://problem/54404114>

Differential Revision: https://reviews.llvm.org/D73225
lldb/include/lldb/Target/ThreadPlan.h
lldb/include/lldb/Target/ThreadPlanStepInRange.h
lldb/packages/Python/lldbsuite/test/lang/objc/direct-dispatch-step/Makefile [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/lang/objc/direct-dispatch-step/TestObjCDirectDispatchStepping.py [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/lang/objc/direct-dispatch-step/stepping-tests.m [new file with mode: 0644]
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h