[target] Change target create's behavior wrt loading dependent files.
authorJonas Devlieghere <jonas@devlieghere.com>
Thu, 20 Sep 2018 09:09:13 +0000 (09:09 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Thu, 20 Sep 2018 09:09:13 +0000 (09:09 +0000)
commit26ba928214273cba2d1fb951bd395e6fa74896bb
tree88afdd595361559a6de9bdf21298f6310c6adf95
parentf9a07e9f8debaf28d289d1fc0403f9f06043d977
[target] Change target create's behavior wrt loading dependent files.

When creating a target, lldb loads all dependent files (i.e. libs in
LC_LOAD_DYLIB for Mach-O). This can be confusing, especially when two
versions of the same library end up in the shared cache. It's possible
to change this behavior, by specifying  target create -d <target> these
dependents are not loaded.

This patch changes the default behavior to only load dependent files
only when the target is an executable. When creating a target for a
library, it is now no longer necessary to pass -d. The user can still
override this behavior by specifying the -d option to change this
behavior.

rdar://problem/43721382

Differential revision: https://reviews.llvm.org/D51934

llvm-svn: 342634
lldb/packages/Python/lldbsuite/test/functionalities/target_create_deps/Makefile [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/functionalities/target_create_deps/TestTargetCreateDeps.py [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/functionalities/target_create_deps/a.cpp [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/functionalities/target_create_deps/a.mk [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/functionalities/target_create_deps/main.cpp [new file with mode: 0644]
lldb/source/Commands/CommandObjectTarget.cpp