Fix rendezvous for rebase_exec=true case
authorEmre Kultursay <emrekultursay@google.com>
Mon, 27 Sep 2021 10:56:53 +0000 (12:56 +0200)
committerPavel Labath <pavel@labath.sk>
Mon, 27 Sep 2021 11:27:27 +0000 (13:27 +0200)
commitd5629b5d4d41ce71703105362f58dfcdbb6cc175
treeaa6200204c3b4c540c09db8245d733dbd957fb76
parent7424deb7433180ecb1c4722259f151c5c252be64
Fix rendezvous for rebase_exec=true case

When rebase_exec=true in DidAttach(), all modules are loaded
before the rendezvous breakpoint is set, which means the
LoadInterpreterModule() method is not called and m_interpreter_module
is not initialized.

This causes the very first rendezvous breakpoint hit with
m_initial_modules_added=false to accidentally unload the
module_sp that corresponds to the dynamic loader.

This bug (introduced in D92187) was causing the rendezvous
mechanism to not work in Android 28. The mechanism works
fine on older/newer versions of Android.

Test: Verified rendezvous on Android 28 and 29
Test: Added dlopen test

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D109797
lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
lldb/test/API/functionalities/load_after_attach/Makefile [new file with mode: 0644]
lldb/test/API/functionalities/load_after_attach/TestLoadAfterAttach.py [new file with mode: 0644]
lldb/test/API/functionalities/load_after_attach/b.cpp [new file with mode: 0644]
lldb/test/API/functionalities/load_after_attach/main.cpp [new file with mode: 0644]