OSDN Git Service

[lldb] Only set the executable module for a target once
authorRaphael Isemann <teemperor@gmail.com>
Fri, 17 Jul 2020 06:03:07 +0000 (08:03 +0200)
committerRaphael Isemann <teemperor@gmail.com>
Fri, 17 Jul 2020 06:35:38 +0000 (08:35 +0200)
commit16926115ed28d1370bca1085dfb1b20c842b0ffb
treee21d15c5cb7e257bf11ff43d2e8d8a9f251682c4
parent6bba95831e480656124a5fbcd84f4f2a31e6c0b6
[lldb] Only set the executable module for a target once

Summary:

When we try to find the executable module for our target we don't check
if we already have an executable module set. This causes that when debugging
a program that dlopens another executable, LLDB will take that other executable
as the new executable of the target (which causes that future launches of the
target will launch the dlopen'd executable instead of the original executable).

This just adds a check that we only set the executable when we haven't already
found one.

Fixes rdar://63443099

Reviewers: jasonmolenda, jingham, teemperor

Reviewed By: jasonmolenda, teemperor

Subscribers: jingham, JDevlieghere

Differential Revision: https://reviews.llvm.org/D80724
lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
lldb/test/API/functionalities/dlopen_other_executable/Makefile [new file with mode: 0644]
lldb/test/API/functionalities/dlopen_other_executable/TestDlopenOtherExecutable.py [new file with mode: 0644]
lldb/test/API/functionalities/dlopen_other_executable/main.c [new file with mode: 0644]
lldb/test/API/functionalities/dlopen_other_executable/other.c [new file with mode: 0644]