Commit Graph

433 Commits

Author SHA1 Message Date
Jonas Devlieghere
ac4a5c15fe [CMake] Print Python version on Windows
Trying to figure out what's causing the Windows bot to fail.

llvm-svn: 367125
2019-07-26 16:15:19 +00:00
Jonas Devlieghere
447ef83068 [CMake] Loosen Python version check and ignore patch version
Some versions of macOS report a different patch version for the system
provided interpreter and libraries.

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

llvm-svn: 367115
2019-07-26 14:26:33 +00:00
Stefan Granitz
c8916258d5 [lldb][CMake] Fix framework-enabled build detail for Xcode
If debugserver or any other framework tool gets built first, its post-build copy operation was using 'Resources' as the file name instead of the destination directory. It was not a problem with Ninja, because here the framework structure was alreaady created at configuration time. With this fix, both generators are happy.

llvm-svn: 367005
2019-07-25 10:47:49 +00:00
Stefan Granitz
7e6f355b3e [lldb] Remove Xcode project legacy
Summary: Since D65109 removed the manually maintained Xcode project, there's a few things we don't need anymore. Anything here we should keep or anything more to remove?

Reviewers: JDevlieghere, jasonmolenda, clayborg, jingham, lanza, teemperor

Subscribers: mgorny, lldb-commits, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D65155

llvm-svn: 366879
2019-07-24 09:20:14 +00:00
Saleem Abdulrasool
e97f2f33e7 build: allow the user to specify llvm-tblgen
This follows the same pattern as Clang and permits the user to specify
the tablegen to use via `-DLLVM_TABLEGEN=`.  This allows for
cross-compiling LLDB for a foreign target (e.g. Windows ARM64 on Windows
X64).  The LLVM dependency for LLDB in that case must be a Windows ARM64
build which cannot cross-compile llvm-tblgen due to the way that Visual
Studio works.  Instead, permit the user to have a separate tablegen
build which can be used during the build.

llvm-svn: 366639
2019-07-20 17:59:08 +00:00
Stefan Granitz
fc0d766511 [CMake] Align debugserver with lldb-server on Darwin
Summary: Make debugserver a tool like lldb-server, so it can be included/excluded via `LLDB_TOOL_DEBUGSERVER_BUILD`. This replaces the old `LLDB_NO_DEBUGSERVER` flag. Doing the same for darwin-debug while I am here.

Reviewers: xiaobai, JDevlieghere, davide

Reviewed By: xiaobai, JDevlieghere

Subscribers: mgorny, lldb-commits, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D64994

llvm-svn: 366631
2019-07-20 11:18:31 +00:00
Stefan Granitz
6454a20b72 [CMake] Polish folders in generated Xcode project
Summary: Group plugins by subfolder. Move liblldb-resource-headers to `lldb misc`. Avoid install-distribution related targets in IDE-enabled builds.

Reviewers: jingham, mib, stella.stamenova

Subscribers: mgorny, lldb-commits, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D64865

llvm-svn: 366459
2019-07-18 16:44:45 +00:00
Stefan Granitz
0c4948455d [CMake] Always build debugserver on Darwin and allow tests to use the system's one
Summary:
We can always build debugserver, but we can't always sign it to be useable for testing. `LLDB_USE_SYSTEM_DEBUGSERVER` should only tell whether or not the system debugserver should be used for testing.
The old behavior complicated the logic around debugserver a lot. The new logic sorts out most of it.

Please note that this patch is in early stage and needs some more testing. It should not affect platfroms other than Darwin. It builds on Davide's approach to validate the code-signing identity at configuration time.

What do you think?

Reviewers: xiaobai, JDevlieghere, davide, compnerd, friss, labath, mgorny, jasonmolenda

Reviewed By: JDevlieghere

Subscribers: lldb-commits, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D64806

llvm-svn: 366433
2019-07-18 13:30:37 +00:00
Adrian McCarthy
3628a8fae9 [NFC] Clarify a Cmake status message regarding Python on LLDBConfig
llvm-svn: 366383
2019-07-17 22:36:26 +00:00
Jonas Devlieghere
e37750b934 [CMake] Remove duplicated logic to find Python when doing a standalone build
I'm pretty sure there's no need to have this logic living in
LLDBStandalone. It doesn't appear anything in LLVM depends on this, and
We always go through LLDBConfig.cmake which has the canonical way to
find the Python libs and interpreter for LLDB.

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

llvm-svn: 366363
2019-07-17 19:36:20 +00:00
Jonas Devlieghere
ca12cb9482 [CMake] Use LLVM_DIR and Clang_DIR for standalone builds.
When doing a standalone build, without setting LLDB_PATH_TO_LLVM_BUILD
or LLDB_PATH_TO_CLANG_BUILD, you get the following error.

```
CMake Error at cmake/modules/LLDBStandalone.cmake:23 (find_package):
  Could not find a package configuration file provided by "LLVM" with any of
  the following names:

    LLVMConfig.cmake
    llvm-config.cmake

  Add the installation prefix of "LLVM" to CMAKE_PREFIX_PATH or set
  "LLVM_DIR" to a directory containing one of the above files.  If "LLVM"
  provides a separate development package or SDK, be sure it has been
  installed.
```

This suggests setting LLVM_DIR to LLVM's install directory. However,
LLDBStandalone.cmake takes LLDB_PATH_TO_LLVM_BUILD as its hint. As
someone who isn't familiar with the standalone process, this is rather
confusing. This patch removes LLDB_PATH_TO_LLVM_BUILD and
LLDB_PATH_TO_CLANG_BUILD and instead use LLVM_DIR and Clang_DIR
respectively.

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

llvm-svn: 366362
2019-07-17 19:24:15 +00:00
Stefan Granitz
ee24b40b9e [CMake] Avoid liblldb genex when figuring out the copy destination for framework tools
This genex created an order-only dependency to liblldb for every framework tool. It reduced build throughput in the first half of the compilation and pulled in unnecessary build units, e.g. debugserver required ~900 build units. With this change debugserver is (again) down at 52 build units!

llvm-svn: 366350
2019-07-17 17:14:40 +00:00
Jonas Devlieghere
7f24757b8e [CMake] Move standalone check so we don't have to reconfigure LLDB
By moving the standalone check into the main CMake file, the whole file
is ignored in a regular (non-standalone) build. This means that you can
make changes to LLDBStandalone.cmake without having to reconfigure a
build in a different directory. This matters when you share one source
repository with different build directories (e.g. release-assert, debug,
standalone).

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

llvm-svn: 366346
2019-07-17 16:47:02 +00:00
Nathan Lanza
98a48794ec Don't require python exe and lib versions to match while crosscompiling
Summary:
While cross compiling, the python executable is used to run a handful
of scripts while the libraries are linked and headers are included.
Theoretically it's possible for the versions to match completely, but
requiring the build to match 2.7.10 to 2.7.15 is unnecessary.

Subscribers: mgorny

Differential Revision: https://reviews.llvm.org/D64822

llvm-svn: 366285
2019-07-16 23:54:17 +00:00
Reid Kleckner
1d58c1d9d6 Fix LLDB Windows build Python version logic after r366243
llvm-svn: 366247
2019-07-16 18:46:51 +00:00
Jonas Devlieghere
5826ab6b0c [CMake] Fail when Python interpreter doesn't match Python libraries version
Because of how CMake finds the Python libraries and interpreter, it's
possible to end up with a discrepancy between the two. For example,
you'd end up using a Python 3 interpreter to run the test suite while
LLDB was built and linked against Python 2.

This patch adds a fatal error to CMake so we find out at configuration
time, instead of finding out at test time.

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

llvm-svn: 366243
2019-07-16 18:27:12 +00:00
Stefan Granitz
e8ced86deb [CMake] Add Apple-lldb-Xcode.cmake cache that avoids install options
llvm-svn: 366226
2019-07-16 16:57:45 +00:00
Jonas Devlieghere
497bb44fc4 Make Python version setting actually effective
This needs to be outside the if to actually work. Also, this adjusts the
list of versions to match LLVM.

Patch by: Christian Biesinger

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

llvm-svn: 365988
2019-07-13 03:30:55 +00:00
Raphael Isemann
6f4fb4e7ad [lldb] Let table gen create command option initializers.
Summary:
We currently have man large arrays containing initializers for our command options.
These tables are tricky maintain as we don't have any good place to check them for consistency and
it's also hard to read (`nullptr, {}, 0` is not very descriptive).

This patch fixes this by letting table gen generate those tables. This way we can have a more readable
syntax for this (especially for all the default arguments) and we can let TableCheck check them
for consistency (e.g. an option with an optional argument can't have `eArgTypeNone`, naming of flags', etc.).

Also refactoring the related data structures can now be done without changing the hundred of option initializers.

For example, this line:
```
{LLDB_OPT_SET_ALL, false, "hide-aliases",         'a', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Hide aliases in the command list."},
```
becomes this:
```
  def hide_aliases : Option<"hide-aliases", "a">, Desc<"Hide aliases in the command list.">;
```

For now I just moved a few initializers to the new format to demonstrate the change. I'll slowly migrate the other
option initializers tables  in separate patches.

Reviewers: JDevlieghere, davide, sgraenitz

Reviewed By: JDevlieghere

Subscribers: jingham, xiaobai, labath, mgorny, abidh, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D64365

llvm-svn: 365908
2019-07-12 15:30:55 +00:00
Nico Weber
d24faac011 Add Python 3.6 and 3.7 to the version list
Python 3.6 and 3.7 have been released.

Differential Revision: https://reviews.llvm.org/D64444

Patch from Christian Biesinger <cbiesinger@google.com>!

llvm-svn: 365688
2019-07-10 19:18:38 +00:00
Stefan Granitz
bf223dff7e [CMake][NFC] Remove dead code lldb_append_link_flags() from AddLLDB.cmake
llvm-svn: 365651
2019-07-10 16:02:46 +00:00
Stefan Granitz
86d3c9fd1f [CMake][NFC] Polish comments in AddLLDB.cmake
llvm-svn: 365650
2019-07-10 16:00:03 +00:00
Stefan Granitz
f554ce7f92 [CMake] Add Apple-lldb-Linux.cmake cache
llvm-svn: 365649
2019-07-10 15:59:56 +00:00
Stefan Granitz
839e305eb1 [CMake] Polish Apple-lldb caches
llvm-svn: 365648
2019-07-10 15:59:50 +00:00
Stefan Granitz
110f97632e [CMake] install-distribution for LLDB on Darwin
Summary:
There's a number of requirements for installing LLDB on macOS that are untypical for LLVM projects: use special install-prefix for LLDB.framework, ship headers and tools as framework resources, patch RPATHs, externalize debug-info to dSYM's and strip binaries with `-ST`. For some of it we could use `llvm_externalize_debuginfo()` in the past and just add special cases. However, this complicates the code for all projects and comes with the major drawback, that it adds all these actions at build-time, i.e. dSYM creation and stripping take a lot of time and don't make sense at build-time.

LLVM's distribution mechanism (https://llvm.org/docs/BuildingADistribution.html) appears to be the natural candidate to install LLDB. Based on D64399 (enable in standalone builds), this patch integrates framework installation with the distribution mechanism and adds custom stripping flags and dSYM creation at install-time. Unlike the abandoned D61952, it leaves build-tree binaries untouched, so there's no side-effects on testing. Potential install-order issues must be handled externally.

Please let me know what you think, while I run a few more tests and add remarks+documentation.

Reviewers: xiaobai, compnerd, JDevlieghere, davide, labath, mgorny

Reviewed By: xiaobai, JDevlieghere

Subscribers: lldb-commits, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D64408

llvm-svn: 365617
2019-07-10 11:09:29 +00:00
Stefan Granitz
05adc0f317 [CMake] Distribution builds for LLDB standalone
Summary:
Enable `distribution` and `install-distribution` targets in LLDB standalone and pre-populate the cache accordingly on macOS.
Documentation for distribution builds is here: https://llvm.org/docs/BuildingADistribution.html

Reviewers: xiaobai, mgorny, JDevlieghere, davide, compnerd

Reviewed By: xiaobai, JDevlieghere

Subscribers: lldb-commits, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D64399

llvm-svn: 365616
2019-07-10 11:09:11 +00:00
Stefan Granitz
685911ffce [CMake] Remove extra lldb-framework target
Summary: The custom lldb-framework target was meant to encapsulate all build steps that LLDB.framework needs on top of the ordinaly liblldb. In the end all of it happens in post-build steps, so we can do the same with liblldb and cut down another source of confusion.

Reviewers: xiaobai, JDevlieghere

Reviewed By: xiaobai, JDevlieghere

Subscribers: mgorny, lldb-commits, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D64397

llvm-svn: 365615
2019-07-10 11:09:01 +00:00
Stefan Granitz
e5b868d6a3 [CMake] Polish a comment
llvm-svn: 365459
2019-07-09 10:29:07 +00:00
Stefan Granitz
e9298dc902 [CMake] Don't initialize LLVM_INSTALL_TOOLCHAIN_ONLY in Apple-lldb-base cache
llvm-svn: 365458
2019-07-09 10:29:00 +00:00
Stefan Granitz
189355f3ee [CMake] Remove old lldb_setup_framework_rpaths_in_tool()
llvm-svn: 365457
2019-07-09 10:28:53 +00:00
Stefan Granitz
1665dd6346 [CMake] Avoid libcxxabi dependency when building LLDB from the monorepo on macOS
libc++abi became mandatory to link the libc++ binaries. LLDB only needs the build artifacts and not the linked output (we don't ship `libc++.dylib` and/or `libc++.a`). Disable the respective link steps to avoid the dependency to libc++abi.

<rdar://problem/51980716>

llvm-svn: 365038
2019-07-03 13:21:48 +00:00
Jason Molenda
37aeca39ba Update cmake build setup so lldb doesn't link against the DebugSymbols
framework on macOS, in line with the source/xcode project changes in
r364243.
<rdar://problem/49458356> 

llvm-svn: 364979
2019-07-02 23:36:39 +00:00
Stefan Granitz
f2ffa7320e Specify log level for CMake messages (less stderr)
Summary:
Specify message levels in CMake. Prefer STATUS (stdout).

As the default message mode (i.e. level) is NOTICE in CMake, more then necessary messages get printed to stderr. Some tools,  noticably ccmake treat this as an error and require additional confirmation and re-running CMake's configuration step.

This commit specifies a mode (either STATUS or WARNING or FATAL_ERROR)  instead of the default.

* I used `csearch -f 'llvm-project/.+(CMakeLists\.txt|cmake)' -l 'message\("'` to find all locations.
* Reviewers were chosen by the most common authors of specific files. If there are more suitable reviewers for these CMake changes, please let me know.

Patch by: Christoph Siedentop

Reviewers: zturner, beanz, xiaobai, kbobyrev, lebedev.ri, sgraenitz

Reviewed By: sgraenitz

Subscribers: mgorny, lebedev.ri, #sanitizers, lldb-commits, llvm-commits

Tags: #sanitizers, #lldb, #llvm

Differential Revision: https://reviews.llvm.org/D63370

llvm-svn: 363821
2019-06-19 15:25:32 +00:00
Stefan Granitz
a0781b6e3a [CMake] Fix generated Xcode-project ignoring output directory setting for LLDB.framework
Other generators honor the `LIBRARY_OUTPUT_DIRECTORY` target property, but apparently Xcode doesn't. So we call `set_output_directory()` as `llvm_add_library()` would do and this works.
Note that `LIBRARY_OUTPUT_DIRECTORY` is still necessary, because it's used to store and read the target's absolute build directory (while `LLDB_FRAMEWORK_BUILD_DIR` is relative!).

llvm-svn: 363280
2019-06-13 17:35:50 +00:00
Stefan Granitz
8f30e322ab [CMake] Add fallbacks for copying clang-resource-headers to LLDB.framework in standalone builds
llvm-svn: 363271
2019-06-13 15:07:56 +00:00
Adrian McCarthy
a4198c22dc NFC: Fix typo in a cmake message
llvm-svn: 362845
2019-06-07 21:14:01 +00:00
Stefan Granitz
c769462438 [CMake] Add configuration dirs as potential locations for llvm-lit and llvm-tblgen in standalone builds
Summary:
If the provided LLVM build-tree used a multi-configuration generator like Xcode, `LLVM_TOOLS_BINARY_DIR` will have a generator-specific placeholder to express `CMAKE_CFG_INTDIR`. Thus `llvm-lit` and `llvm-tblgen` won't be found.
D62878 exports the actual configuration types so we can fix the path and add them to the search paths for `find_program()`.

Reviewers: xiaobai, labath, stella.stamenova

Reviewed By: xiaobai, stella.stamenova

Subscribers: mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D62879

llvm-svn: 362589
2019-06-05 08:31:50 +00:00
Stefan Granitz
e4ad1b7bbe [CMake] Move and add settings to Apple-lldb-base cache script
llvm-svn: 362500
2019-06-04 14:21:48 +00:00
Stefan Granitz
5dc9036746 [CMake] LLDB.framework tools handling
Summary:
Modify the way LLDB.framework tools are collected. This allows for better fine-tuning of the install behavior downstream. Each target calls `lldb_add_to_framework()` individually. When entering the function, the target exists and we can tweak its very own post-build and install steps. This was not possible with the old `LLDB_FRAMEWORK_TOOLS` approach.

No function change otherwise.
This is a reduced follow-up from the proposal in D61952.

Reviewers: xiaobai, compnerd, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: clayborg, friss, ki.stfu, mgorny, lldb-commits, labath, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D62472

llvm-svn: 361946
2019-05-29 11:26:06 +00:00
Saleem Abdulrasool
99e040b3c9 build: only search for the needed python type
Windows has different types of runtime libraries which are ABI
incompatible with one another.  This requires that the debug build of
lldb link against the debug build of python.  Adjust the python search
to search for only the required type of python.  This permits building a
release build of lldb against just the release build of python.

llvm-svn: 361915
2019-05-29 02:26:29 +00:00
Stefan Granitz
a3388e5f9e [CMake] Folder structure for generated Xcode project to cover more targets
llvm-svn: 361799
2019-05-28 09:29:05 +00:00
Stefan Granitz
fd0779181f [CMake] Add first CMake cache files
Summary:
CMake cache scripts pre-populate the CMakeCache in a build directory with commonly used settings.
The CMake invocation from D61952 could look like this:

```
cmake -G Ninja -C /path/to/llvm-project/lldb/cmake/caches/Apple-lldb-osx.cmake -DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi;lldb" ../llvm-project/llvm
```

Options specified on the command line will override options in the cache files (as long as caches don't use `FORCE`).
What do you think? (This is a first proposal and not set in stone.)

Reviewers: xiaobai, compnerd, JDevlieghere, aprantl, labath

Subscribers: mgorny, lldb-commits, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D61956

llvm-svn: 361069
2019-05-17 19:19:41 +00:00
Pavel Labath
56f9afaf6b [CMake] Correctly reinstate LLDB_CAN_USE_LLDB_SERVER
r360631 introduced a "syntax error" which meant that cmake was still not
honoring the value of LLDB_CAN_USE_LLDB_SERVER variable. The correct
syntax for seting an internal cache variable is "set(VAR value CACHE
INTERNAL)", but the patch omitted the "CACHE" keyword. The "syntax
error" is in quotes because without the CACHE keyword this is still
valid syntax for setting the value of LLDB_CAN_USE_LLDB_SERVER to "1
INTERNAL".

There doesn't seem to be a need for this to be a cache variable so I'm
reverting this variable to a plain one, as it was before r360621.

This will hopefully fix the windows build.

llvm-svn: 360652
2019-05-14 08:18:06 +00:00
Jonas Devlieghere
1d8b2a0661 [CMake] Reinstate LLDB_CAN_USE_LLDB_SERVER
We cannot manipulate the LLDB_TOOL_LLDB_SERVER_BUILD directly from
LLDBConfig.cmake because this would set the variable before the option
is defined in AddLLVM.cmake. Instead, we need to use the
LLDB_CAN_USE_LLDB_SERVER variable to conditionally add the lldb-server
subdirectory. This should ensure the variable doesn't get cleared.

llvm-svn: 360631
2019-05-13 22:55:11 +00:00
Jonas Devlieghere
aeeeb37e37 [CMake] Simplify lldb-server handling
We can piggyback off the existing add_lldb_tool_subdirectory to decide
whether or not lldb-server should be built.

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

llvm-svn: 360621
2019-05-13 21:25:02 +00:00
Alex Langford
babcbaf971 [CMake] Fix subtle CMake bug
CMake specifies that the DEPENDS field of add_custom_target is for files
and output of add_custom_command. In order to add a target dependency,
add_dependencies should be used.

llvm-svn: 359490
2019-04-29 19:44:43 +00:00
Frederic Riss
8ecb7bbe2b [CMake] Remove Apple-specific version logic.
We were using the LLDB-Info.plist as the canonical holder of the
version number, but there is really no good reason to do this. If
anything the plist should be generated using the information provided
to CMake.

For now just remove the logic extracting the version from the plist
and rely on LLDB_VERSION_STRING.

llvm-svn: 358604
2019-04-17 18:23:22 +00:00
Davide Italiano
6df6895d90 [tools] Make vscode and lldb-instr optional.
Summary:
Saves some build times, and they're not part of the usual
developer workflow.

Reviewers: JDevlieghere, friss

Subscribers: mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D60780

llvm-svn: 358528
2019-04-16 21:15:28 +00:00
Alex Langford
7e7f79ccb1 [CMake] Don't explicitly use LLVM_LIBRARY_DIR in standalone builds
Summary:
This line is unnecessary because add_llvm_executable will handle
linking the correct LLVM libraries for you. LLDB standalone builds are totally
fine without this.

In the best case, having this line here is harmless. In the worst case it can
cause link issues.

If you build lldb-server for android using the standalone build, this line
will cause LLVM_LIBRARY_DIR to be the first place you look for libraries.
This is an issue because if you built libc++, it will try to link against
that one instead of the one from the android NDK.  Meanwhile, the LLVM libraries
you're linking against were linked against the libc++ from the NDK.

Ideally, we would take advantage of the AFTER option for link_directories(), but
that was not available in LLDB's minimum supported version of CMake (CMake 3.4.3).

Differential Revision: https://reviews.llvm.org/D60180

llvm-svn: 357817
2019-04-05 21:01:50 +00:00
Jonas Devlieghere
ae1cc995e3 [Cmake] Unify python variables
FindPythonInterp and FindPythonLibs do two things, they set some
variables (PYTHON_LIBRARIES, PYTHON_INCLUDE_DIRS) and update the cached
variables (PYTHON_LIBRARY, PYTHON_INCLUDE_DIR) which are also used to
specify a custom python installation.

I believe the canonical way to do this is to use the PYTHON_LIBRARIES
and PYTHON_INCLUDE_DIRS variables instead of the cached ones. However,
since the cached variables are accessible from the cache and GUI, this
is a lot less confusing when you're trying to debug why a variable did
or didn't get the value you expected. Furthermore, as far as I can tell,
the implementation uses the cached variables to set their LIBRARIES/DIRS
counterparts. This is also the reason this works today even though we
mix-and-match.

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

llvm-svn: 357282
2019-03-29 17:35:42 +00:00
Alex Langford
b4a3b29d16 [CMake] Set LLVM_DEFAULT_EXTERNAL_LIT in standalone build correctly on windows
LLVM installed llvm-lit with a .py suffix on windows. Let's match that
behavior here.

llvm-svn: 356412
2019-03-18 21:32:31 +00:00
Pavel Labath
1de5a2ef96 Fix a typo in FindLibEdit.cmake
The package name is LibEdit, so we should use that name in the call to
find_package_handle_standard_args. Failing to do so results in the
standard_args (such as the one telling us whether REQUIRED was used in
the find_package invocation) not being handled.

llvm-svn: 356263
2019-03-15 14:03:52 +00:00
Stefan Granitz
02e88490c1 Revert "[CMake] Avoid clang-tablegen-targets dependency when building sphinx docs (experimental)"
This reverts commit 511066858d.
This turned out unnecessary to fix the bot.

llvm-svn: 355931
2019-03-12 15:54:35 +00:00
Jonas Devlieghere
511066858d [CMake] Avoid clang-tablegen-targets dependency when building sphinx docs (experimental)
Proposal to fix bot
http://lab.llvm.org:8011/builders/lldb-sphinx-docs/builds/1564/steps/cmake-configure/logs/stdio

Patch by: Stefan Gränitz

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

llvm-svn: 355887
2019-03-12 00:49:10 +00:00
Shoaib Meenai
5be71faf4b [build] Rename clang-headers to clang-resource-headers
Summary:
The current install-clang-headers target installs clang's resource
directory headers. This is different from the install-llvm-headers
target, which installs LLVM's API headers. We want to introduce the
corresponding target to clang, and the natural name for that new target
would be install-clang-headers. Rename the existing target to
install-clang-resource-headers to free up the install-clang-headers name
for the new target, following the discussion on cfe-dev [1].

I didn't find any bots on zorg referencing install-clang-headers. I'll
send out another PSA to cfe-dev to accompany this rename.

[1] http://lists.llvm.org/pipermail/cfe-dev/2019-February/061365.html

Reviewers: beanz, phosek, tstellar, rnk, dim, serge-sans-paille

Subscribers: mgorny, javed.absar, jdoerfert, #sanitizers, openmp-commits, lldb-commits, cfe-commits, llvm-commits

Tags: #clang, #sanitizers, #lldb, #openmp, #llvm

Differential Revision: https://reviews.llvm.org/D58791

llvm-svn: 355340
2019-03-04 21:19:53 +00:00
Pavel Labath
5d4d168c3c [cmake] Move LLDB_DISABLE_LIBEDIT handling code into a central place
This was previously scattered between the main CMakeLists.txt file and
LLDBGenerateConfig.cmake and LLDBConfig.cmake. This caused the some of
the code to be executed in incorrect order. Specifically, the check for
el_winsertstr was done before libedit_LIBRARIES was computed, and so it
always failed on the first run.

Moving it the two checks to a central place makes sure this doesn't
happen again and improves the overall readability.

llvm-svn: 355103
2019-02-28 16:04:54 +00:00
Stefan Granitz
db85fdd115 [CMake] Fix RPATH handling for LLDB.framework
Summary:
Generator expressions are not supported in the `BUILD_RPATH` target property.
`BUILD_RPATH` is only supported in 3.8+ https://cliutils.gitlab.io/modern-cmake/chapters/intro/newcmake.html
`LLDB_FRAMEWORK_INSTALL_DIR` should not overwrite, but rather add an install RPATH (and it should be the first)

Reviewers: xiaobai, lanza

Reviewed By: xiaobai

Subscribers: mgorny

Differential Revision: https://reviews.llvm.org/D57989

llvm-svn: 354037
2019-02-14 17:34:39 +00:00
Michal Gorny
e47f89cb2c [lldb] [cmake] Use install directories for LLVM_* variables
Restore the previous behavior of using install directories for
LLVM_MAIN_INCLUDE_DIR, LLVM_LIBRARY_DIR and LLVM_BINARY_DIR.  The update
from llvm-config to CMake has changed the values of those values to use
LLVM_BUILD_* which is plain wrong and breaks stand-alone builds.
Instead, use the CMake counterparts of the values returned
by llvm-config.

Differential Revision: https://reviews.llvm.org/D57995

llvm-svn: 353925
2019-02-13 08:34:46 +00:00
Stefan Granitz
f4283858fa [CMake] Accept entitlements for code signing in add_lldb_library()
Summary:
D57334 added entitlements support in `add_llvm_library()` so we can use it for library targets in LLDB.

Additionally this patch fixes the way that the entitlements argument is passed on from `add_lldb_executable()` to `add_llvm_executable()`. We still need the explicit parsing and passing on of single- and multi-value arguments as long as we are on CMake < 3.7 (due to bug https://gitlab.kitware.com/cmake/cmake/merge_requests/133).

Reviewers: beanz, JDevlieghere, aprantl

Reviewed By: JDevlieghere

Subscribers: mgorny, lldb-commits, #lldb

Differential Revision: https://reviews.llvm.org/D57378

llvm-svn: 352629
2019-01-30 15:13:16 +00:00
Stefan Granitz
1f34e851ee [CMake] Dump LLDB.framework tools at configuration time
llvm-svn: 352387
2019-01-28 16:57:19 +00:00
Stefan Granitz
a50cce2266 [CMake] Quick-Fix targets don't exist when building against LLVM install-tree with LLDB_INCLUDE_TESTS=ON
The issue came up during release testing for LLVM 8: https://bugs.llvm.org/show_bug.cgi?id=40443

Differential Revision: https://reviews.llvm.org/D57233

llvm-svn: 352382
2019-01-28 16:15:27 +00:00
Michal Gorny
d4b194cf95 [cmake] Fix get_llvm_lit_path() to respect LLVM_EXTERNAL_LIT always
Refactor the get_llvm_lit_path() logic to respect LLVM_EXTERNAL_LIT,
and require the fallback to be defined explicitly
as LLVM_DEFAULT_EXTERNAL_LIT. This fixes building libcxx standalone
after r346888.

The old logic was using LLVM_EXTERNAL_LIT both as user-defined cache
variable and an optional pre-definition of default value from caller
(e.g. libcxx). It included a hack to make this work by assigning
the value back and forth but it was fragile and stopped working
in libcxx.

The new logic is simpler and more transparent. Default value is
provided in a separate variable, and used only when user-specified
variable is empty (i.e. not overriden).

Differential Revision: https://reviews.llvm.org/D57282

llvm-svn: 352374
2019-01-28 15:16:03 +00:00
Alex Langford
165ea58798 [CMake] Use llvm-tblgen from NATIVE LLVM build when cross-compiling
Summary:
When cross-compiling LLDB, we want to use llvm-tblgen built for the
host, not the target.

Reviewers: compnerd, sgraenitz

Subscribers: mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D57194

llvm-svn: 352235
2019-01-25 19:38:21 +00:00
Alex Langford
43eb71b4c2 [CMake] Remove duplicated cache variable. NFC.
llvm-svn: 352078
2019-01-24 18:52:19 +00:00
Stefan Granitz
f7098b3a04 [CMake] Get back some variables used in AddLLVM.cmake
This fixes 'gtest/gtest.h' file not found when building unit tests after r351863.

llvm-svn: 352058
2019-01-24 16:02:21 +00:00
Stefan Granitz
fea3731f37 [CMake] Fix two details from r351863
llvm-svn: 351879
2019-01-22 21:14:51 +00:00
Alex Langford
b8ecd7e49b [CMake] Replace use of llvm-config with LLVM and Clang CMake packages
Summary:
I did this for two reasons:
- Using the CMake packages simplifies building LLDB Standalone. This is for two
  reasons: 1) We were doing a decent amount of work that is already done in the
  LLVMConfig.cmake that we want to import, 2) We had to do some manual work to call
  llvm-config, parse its output, and populate variables that the build system
  uses.
- As far as I understand, using llvm-config makes it difficult if not impossible
  to cross-compile LLDB standalone.

Reviewers: sgraenitz, labath, zturner, JDevlieghere, davide, aprantl, stella.stamenova

Subscribers: mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D56531

llvm-svn: 351863
2019-01-22 19:26:42 +00:00
Stefan Granitz
16be420953 [CMake] Turn LLDB_FRAMEWORK_TOOLS into STRING to allow overrides from cache files
llvm-svn: 351830
2019-01-22 15:59:47 +00:00
Stefan Granitz
bb3df52c0c [CMake] Include tests by default also in standalone builds
In-tree builds include tests by default. Standalone builds should behave the same.

llvm-svn: 350945
2019-01-11 18:11:04 +00:00
Stefan Granitz
cfdbad065e [CMake] Remove dead code and outdated comments
Summary: All of these changes are NOPs.

Reviewers: stella.stamenova, labath, JDevlieghere

Reviewed By: stella.stamenova

Subscribers: mgorny, lldb-commits, #lldb

Differential Revision: https://reviews.llvm.org/D56609

llvm-svn: 350937
2019-01-11 17:51:33 +00:00
Stefan Granitz
79f41967dc [CMake] In standalone builds, LLVM_BINARY_DIR should point to LLVM's binary directory
Summary: In standalone builds `LLVM_BINARY_DIR` was equal to `LLDB_BINARY_DIR` so far. This is counterintuitive and invalidated the values of `LLDB_DEFAULT_TEST_DSYMUTIL/FILECHECK/COMPILER` etc.

Reviewers: zturner, labath, clayborg, JDevlieghere, stella.stamenova, serge-sans-paille

Reviewed By: labath

Subscribers: mgorny, friss, lldb-commits, #lldb

Differential Revision: https://reviews.llvm.org/D56443

llvm-svn: 350738
2019-01-09 16:25:37 +00:00
Stefan Granitz
5d005a856d [CMake] Revised RPATH handling
Summary:
If we build LLDB.framework, dependant tools need appropriate RPATHs in both locations, the build-tree (for testing) and the install-tree (for deployment). Luckily, CMake can handle it for us: https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling.

* In the build-tree, tools use the absolute path to the framework's actual output location.
* In the install-tree, tools get a list of RPATHs to look for the framework when deployed.

`LLDB_FRAMEWORK_INSTALL_DIR` is added to the `CMAKE_INSTALL_PREFIX` to change the relative location of LLDB.framework in the install-tree.
If it is not empty, it will be added as an additional RPATH to all dependant tools (so they are functional in the install-tree).
If it is empty, LLDB.framework goes to the root and tools will not be functional in the directory structure of the LLVM install-tree.
For historical reasons `LLDB_FRAMEWORK_INSTALL_DIR` defaults to "Library/Frameworks".

Reviewers: xiaobai, JDevlieghere, aprantl, clayborg

Reviewed By: JDevlieghere

Subscribers: ki.stfu, mgorny, lldb-commits, #lldb

Differential Revision: https://reviews.llvm.org/D55330

llvm-svn: 350392
2019-01-04 12:46:57 +00:00
Stefan Granitz
f126ce6881 [CMake] Revised LLDB.framework builds
Summary:
Add features to LLDB CMake builds that have so far only been available in Xcode. Clean up a few inconveniences and prepare further improvements.

Options:
* `LLDB_FRAMEWORK_BUILD_DIR` determines target directory (in build-tree)
* `LLDB_FRAMEWORK_INSTALL_DIR` **only** determines target directory in install-tree
* `LLVM_EXTERNALIZE_DEBUGINFO` allows externalized debug info (dSYM on Darwin, emitted to `bin`)
* `LLDB_FRAMEWORK_TOOLS` determines which executables will be copied to the framework's Resources (dropped symlinking, removed INCLUDE_IN_SUITE, removed dummy targets)

Other changes:
* clean up `add_lldb_executable()`
* include `LLDBFramework.cmake` from `source/API/CMakeLists.txt`
* use `*.plist.in` files, which are typical for CMake and independent from Xcode
* add clang headers to the framework bundle

Reviewers: xiaobai, JDevlieghere, aprantl, davide, beanz, stella.stamenova, clayborg, labath

Reviewed By: aprantl

Subscribers: friss, mgorny, lldb-commits, #lldb

Differential Revision: https://reviews.llvm.org/D55328

llvm-svn: 350391
2019-01-04 12:46:50 +00:00
Stefan Granitz
d0dc161f62 [CMake] Move debugserver options to separate debugserverConfig.cmake
Summary:
One place for debugserver options, analog to LLDBConfig for LLDB options (see D55317). It was discussed in earlier reviews already, e.g. D55013.

Reviewers: JDevlieghere, aprantl, xiaobai

Reviewed By: aprantl, xiaobai

Subscribers: mgorny, lldb-commits, #lldb

Differential Revision: https://reviews.llvm.org/D55320

llvm-svn: 350390
2019-01-04 12:46:38 +00:00
Stefan Granitz
fd6fedfbe0 [CMake] Aggregate options for LLDB in LLDBConfig.cmake
Summary: In preparation for LLDB.framework changes, collect options for LLDB in LLDBConfig.cmake (used for both, standalone and in-tree builds of LLDB).

Reviewers: JDevlieghere, aprantl, xiaobai

Reviewed By: aprantl

Subscribers: srhines, mgorny, lldb-commits, #lldb

Differential Revision: https://reviews.llvm.org/D55317

llvm-svn: 350389
2019-01-04 12:46:34 +00:00
Stefan Granitz
90aeb4c8d9 [CMake] Streamline code signing for debugserver #2
Summary:
Major fixes after D54476 (use Diff1 as base for comparison to see only recent changes):
* In standalone builds target directory for debugserver must be LLDB's bin, not LLVM's bin
* Default identity for code signing must not force-override LLVM_CODESIGNING_IDENTITY globally

We have a lot of cases, make them explicit:

* ID used for code signing (debugserver and in tests):
** `LLDB_CODESIGN_IDENTITY` if set explicitly, or otherwise
** `LLVM_CODESIGNING_IDENTITY` if set explicitly, or otherwise
** `lldb_codesign` as the default

* On Darwin we have a debugserver target that:

* On other systems, the debugserver target is not defined, which is equivalent to **[3A]**

Common configurations on Darwin:
* **[1A]** `cmake -GNinja ../llvm` builds debugserver from source and signs with `lldb_codesign`, no code signing for other binaries (prints status: //lldb debugserver: /path/to/bin/debugserver//)
* **[1A]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- -DLLDB_CODESIGN_IDENTITY=lldb_codesign ../llvm` builds debugserver from source and signs with `lldb_codesign`, ad-hoc code signing for other binaries (prints status: //lldb debugserver: /path/to/bin/debugserver//)
* **[2A]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- -DLLDB_USE_SYSTEM_DEBUGSERVER=ON ../llvm` copies debugserver from system, ad-hoc code signing for other binaries (prints status: //Copy system debugserver from: /path/to/system/debugserver//)
* **[2B]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- ../llvm` same, but prints additional warning: //Cannot code sign debugserver with identity '-'. Will fall back to system's debugserver. Pass -DLLDB_CODESIGN_IDENTITY=lldb_codesign to override the LLVM value for debugserver.//
* **[3A]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- -DLLDB_NO_DEBUGSERVER=ON ../llvm` debugserver not available (prints status: //lldb debugserver will not be available)//

Reviewers: JDevlieghere, beanz, davide, vsk, aprantl, labath

Reviewed By: JDevlieghere, labath

Subscribers: mgorny, #lldb, lldb-commits

Differential Revision: https://reviews.llvm.org/D55013

llvm-svn: 350388
2019-01-04 12:46:30 +00:00
Stella Stamenova
c3bedd0564 [cmake] Suppress 'warning C4201: nonstandard extension used: nameless struct/union' on Windows
This warning comes up in the ObjC language plugin because of the use of nameless structs. This change suppresses the warning.

llvm-svn: 349977
2018-12-21 23:59:24 +00:00
Nathan Lanza
97327189f2 Reenable FindLibXml2 on Windows and confirm its at least 2.8 or newer
Summary:
GnuWin32 installs libxml2 2.4. This isn't recent enough for lldb's
usage and thus the build fails. Searching for libxml2 was disabled
due to this build failure.

However, the gdb-remote plugin requires libxml2 to parse various
gdb-remote protocol packets. Thus check and confirm that the libxml2
version is at least 2.8 and disable it if not.

Reviewers: compnerd, zturner

Reviewed By: compnerd

Subscribers: mgorny

Differential Revision: https://reviews.llvm.org/D55583

llvm-svn: 349538
2018-12-18 20:51:00 +00:00
Stefan Granitz
3d00002ea2 [CMake] Fix side-effect from LLDB_VERSION change in r346668 for framework-enabled builds
llvm-svn: 348360
2018-12-05 12:18:44 +00:00
Jonas Devlieghere
dd7369a316 Make standalone build find tabelgen
The standalone build couldn't find tablegen because we didn't include
it. This patch rectifies that.

llvm-svn: 347814
2018-11-28 22:10:01 +00:00
Davide Italiano
3bd249018c Revert "[CMake] Streamline code signing for debugserver and pass entitlements to extended llvm_codesign"
It breaks the lldb cmake bots.

llvm-svn: 347619
2018-11-27 00:25:49 +00:00
Stefan Granitz
6e6b4ac18e [CMake] Streamline code signing for debugserver and pass entitlements to extended llvm_codesign
Summary:
Use llvm_codesign to sign debugserver with entitlements.
Set global LLVM_CODESIGNING_IDENTITY from LLDB_CODESIGN_IDENTITY (if given).
Pass through ENTITLEMENTS from add_lldb_executable to add_llvm_executable.
Handle reconfigurations correctly.

We have a lot of cases, make them explicit:

(1) build and sign debugserver, if all conditions apply:
* LLDB_NO_DEBUGSERVER=OFF (default)
* On Darwin: LLDB_USE_SYSTEM_DEBUGSERVER=OFF (default)
* On Darwin: LLVM_CODESIGNING_IDENTITY == lldb_codesign

(2) use system debugserver, if on Darwin and any of:
* LLDB_USE_SYSTEM_DEBUGSERVER=ON and found on system (explicit case)
* LLVM_CODESIGNING_IDENTITY != lldb_codesign and found on system (fallback case)

(3) debugserver will not be available, in case of:
* LLDB_NO_DEBUGSERVER=ON
* On Darwin: LLVM_CODESIGNING_IDENTITY != lldb_codesign and not found on system

(4) error state, in case of:
* LLDB_USE_SYSTEM_DEBUGSERVER=ON and not found on system
* LLDB_USE_SYSTEM_DEBUGSERVER=ON and LLDB_NO_DEBUGSERVER=ON

Reviewers: xiaobai, beanz, vsk, JDevlieghere

Subscribers: mgorny, lldb-commits, llvm-commits

Differential Revision: https://reviews.llvm.org/D54476

llvm-svn: 347305
2018-11-20 14:10:33 +00:00
Stefan Granitz
de62b76c51 [CMake] Allow version overrides with -DLLDB_VERSION_MAJOR/MINOR/PATCH/SUFFIX
Summary:
This follows the approach in Clang. If no overrides are given, LLDB_VERSION_* is inferred from LLVM_VERSION_*. This mimics the current behaviour (PACKAGE_VERSION itself is generated from LLVM_VERSION_*).
For in-tree builds LLVM_VERSION_* will be defined at this point already. For standalone builds, LLDBConfig.cmake is included after LLDBStandalone.cmake which includes LLVMConfig.cmake.

Reviewers: labath, xiaobai

Subscribers: mgorny, friss, aprantl, lldb-commits

Differential Revision: https://reviews.llvm.org/D54333

llvm-svn: 346668
2018-11-12 16:22:28 +00:00
Shoaib Meenai
67a633a717 [lldb] Fix race condition in framework installation
We need the install-liblldb-stripped target to depend on the
lldb-framework target in order for the installation to be guaranteed to
behave correctly, otherwise it's possible for the lldb-framework and
install-liblldb-stripped targets to run in parallel, resulting in
temporary or partially processed files being copied into the framework.
install-liblldb already depends on lldb-framework for this reason.

Differential Revision: https://reviews.llvm.org/D53917

llvm-svn: 345711
2018-10-31 10:41:12 +00:00
Alex Langford
520201babb [cmake] Add option to skip building lldb-server
Summary:
There is currently a way to skip the debugserver build. See how the CMake
variables SKIP_DEBUGSERVER and LLDB_CODESIGN_IDENTITY are used if you're
interested in that.

This allows us to skip building lldb-server as well. There is another
debug server called ds2 that can be used with LLDB. If you choose to use
ds2, this flag is very useful because it can cut down the build time of LLDB.

Differential Revision: https://reviews.llvm.org/D49282

llvm-svn: 340560
2018-08-23 18:05:45 +00:00
Stephane Sezer
a8accca4f5 Add include directory for libxml on macOS
Summary:
Builds fail because libxml/xmlreader.h isn't found. Adding the include
directory to the include list fixes the issue. This is what we already do on
non-macOS platforms in the same file.

Reviewers: clayborg, xiaobai, lanza

Reviewed By: clayborg, lanza

Subscribers: mgorny

Differential Revision: https://reviews.llvm.org/D50918

llvm-svn: 340460
2018-08-22 22:25:45 +00:00
Alex Langford
36706fd977 Introduce install-lldb-framework target
Summary:
Previously, I thought that install-liblldb would fail because CMake had
a bug related to installing frameworks. In actuality, I misunderstood the
semantics of `add_custom_target`: the DEPENDS option refers to specific files,
not targets. Therefore `install-liblldb` should rely on the actual liblldb
getting generated rather than the target.

This means that the previous patch I committed (to stop relying on CMake's
framework support) is no longer needed and has been reverted. Using CMake's
framework support greatly simplifies the implementation.

`install-lldb-framework` (and the stripped variant) is as simple as
depending on `install-liblldb` because CMake knows that liblldb was built as a
framework and will install the whole framework for you. The stripped variant
will depend on the stripped variants of individual tools only to ensure they
actually are stripped as well.

Reviewers: labath, sas

Subscribers: mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D50038

llvm-svn: 338594
2018-08-01 17:21:18 +00:00
Alex Langford
2f6a1018e0 Revert "Stop building liblldb with CMake's framework functionality"
This reverts r338154. This change is actually unnecessary, as the CMake
bug I referred to was actually not a bug but a misunderstanding of
CMake.

Original Differential Revision: https://reviews.llvm.org/D49888

llvm-svn: 338178
2018-07-27 23:38:58 +00:00
Alex Langford
c1d4311c1b Stop building liblldb with CMake's framework functionality
Summary:
CMake has a bug in its ninja generator that prevents you from
installing targets that are built with framework support. Therefore, I want to
not rely on CMake's framework support.
See https://gitlab.kitware.com/cmake/cmake/issues/18216

Differential Revision: https://reviews.llvm.org/D49888

llvm-svn: 338154
2018-07-27 19:41:17 +00:00
Alex Langford
60bdd09d10 Add back lldb-framework-headers target
In r338058 we removed the target `lldb-framework-headers`, which mean
lldb-framework no longer depended on `framework_headers`, so they never
actually got generated. This is a partial revert of r338058: I added
back the lldb-framework-headers target, but the framework-header-fix.sh
script still runs on the copied headers.

llvm-svn: 338074
2018-07-26 21:55:14 +00:00
Alex Langford
10c9e0e0d8 Make framework-header-fix process copied headers
Summary:
Previously the framework-header-fix script would change the sources
before they were copied, leading to unnecessary rebuilds on repeat
`ninja lldb` invocations. This runs the script on the headers after
they're copied into the produced LLDB.framework, meaning it doesn't
affect any files being built.

Patch by Keith Smiley <keithbsmiley@gmail.com>!

Differential Revision: https://reviews.llvm.org/D49779

llvm-svn: 338058
2018-07-26 19:04:46 +00:00
Stefan Granitz
2f842d68df Use LLVM's new ItaniumPartialDemangler in LLDB
Summary:
Replace the existing combination of FastDemangle and the fallback to llvm::itaniumDemangle() with LLVM's new ItaniumPartialDemangler. It slightly reduces complexity and slightly improves performance, but doesn't introduce conceptual changes. This patch is preparing for more fundamental improvements on LLDB's demangling approach.

Reviewers: friss, jingham, erik.pilkington, labath, clayborg, mgorny, davide, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: teemperor, JDevlieghere, labath, clayborg, davide, lldb-commits, mgorny, erik.pilkington

Differential Revision: https://reviews.llvm.org/D49612

llvm-svn: 337931
2018-07-25 15:19:04 +00:00
Alex Langford
97ba3b64dd Invert dependency between lldb-framework and lldb-suite
Summary:
Currently, if you build lldb-framework the entire framework doesn't
actually build. In order to build the entire framework, you need to actually
build lldb-suite. This abstraction doesn't feel quite right because
lldb-framework truly does depend on lldb-suite (liblldb + related tools).

In this change I want to invert their dependency. This will mean that lldb and
finish_swig will depend on lldb-framework in a framework build, and lldb-suite
otherwise. Instead of adding conditional logic everywhere to handle this, I
introduce LLDB_SUITE_TARGET to handle it.

Differential Revision: https://reviews.llvm.org/D49406

llvm-svn: 337311
2018-07-17 18:28:51 +00:00
Alex Langford
8d33a085c3 [CMake] Give lldb tools functional install targets when building LLDB.framework
Summary:
This change makes the install targets for lldb tools functional when
building for the framework.

I am currently working on the install rules for lldb-framework and this will
let me make `install-lldb-framework` rely on `install-lldb-argdumper` for
instance. This is especially important for `install-lldb-framework-stripped`. It
is much better for `install-lldb-framework-stripped` to rely on
`install-lldb-argdumper-stripped` than to copy and strip lldb-argdumper
manually.

Differential Revision: https://reviews.llvm.org/D49038

llvm-svn: 337202
2018-07-16 19:19:56 +00:00
Alex Langford
bd09f772eb [CMake] Simplify a few framework build rules
llvm-svn: 336395
2018-07-05 22:16:15 +00:00
Alex Langford
f66a36d2dc Fix up Info.plist when building LLDB.framework with CMake
Summary:
We weren't using the Info.plist template in resources previously.
When using that template, some of the key's values weren't being populated
because some variables were not being defined. In one case, CMake didn't
like the substring expansion syntax of CFBundleIdentifier so I got rid of that.

Differential Revision: https://reviews.llvm.org/D47792

llvm-svn: 335014
2018-06-19 02:59:30 +00:00
Alex Langford
27510c18ad Introduce lldb-framework CMake target and centralize its logic
Summary:
In this patch I aim to do the following:

1) Create an lldb-framework target that acts as the target that handles generating LLDB.framework. Previously, liblldb acted as the target for generating the framework in addition to generating the actual lldb library. This made the target feel overloaded.
2) Centralize framework generation as much as it makes sense to do so.
3) Create a target lldb-suite, which depends on every tool and library that makes liblldb fully functional. One result of having this target is it makes tracking dependencies much clearer.

Differential Revision: https://reviews.llvm.org/D48060

llvm-svn: 334968
2018-06-18 18:27:16 +00:00
Pavel Labath
3351381165 [cmake] Detect presence of wide-char libedit at build time
Summary:
Instead of hardcoding a list of platforms where libedit is known to have
wide char support we detect this in cmake. The main motivation for this
is attempting to improve compatibility with different versions of
libedit, as the interface of non-wide-char functions varies slightly
between versions.

Reviewers: krytarowski, uweigand, jankratochvil, timshen, beanz

Subscribers: mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D47625

llvm-svn: 334393
2018-06-11 09:14:26 +00:00
Alex Langford
05c10d0def Check for process_vm_readv using CheckSymbolExists
Instead of checking if code compiles, I think it is a better to check
if the symbol exists. This is simpler and should do the same thing.

Differential Revision: https://reviews.llvm.org/D47897

llvm-svn: 334219
2018-06-07 19:53:25 +00:00
Alex Langford
39bf7d551b Fix typo in CMake comments
llvm-svn: 333299
2018-05-25 18:59:21 +00:00
Saleem Abdulrasool
9426358ea1 build: use cmake to find the libedit content
Use proper cmake techniques to detect where the libedit package resides.
This allows for the use of libedit from an alternative location which is
needed for supporting cross-compilation.

llvm-svn: 333041
2018-05-22 23:24:46 +00:00
Pavel Labath
10ef313678 [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687)
Summary:
To make this build work, I needed to add detection code for the pthread
library. This is necessary, because we have direct calls to these
libraries (instead of going through llvm) and in the standalone build we
cannot rely on llvm to detect these for us. In a standalone non-dylib
build this was accidentaly working because these libraries were pulled
in as an interface dependency of the .a files, but in a dylib build
these are no longer part of the link interface, and so we need to add
them explicitly.

Reviewers: krytarowski, zturner

Subscribers: lldb-commits, mgorny

Differential Revision: https://reviews.llvm.org/D44379

llvm-svn: 327490
2018-03-14 10:08:21 +00:00
Pavel Labath
6bf2a8ea70 Install lldb's SB headers (pr36630)
These were removed in r309021 in what looks like an accidentally
committed change. This brings them back.

I also rename the header component to lldb-headers (instead of
lldb_headers) to match the llvm style and add a special
install-lldb-headers target, which installs just the headers.

llvm-svn: 327016
2018-03-08 15:52:46 +00:00
Adrian Prantl
39e54cb7b7 LLDBStandalone.cmake: set path to llvm-lit inside of llvm build dir
llvm-svn: 326754
2018-03-05 23:57:46 +00:00
Petr Hosek
eb8301413a [lldb] Set component when invoking add_llvm_install_targets
This is needed to ensure that the distribution and install-distribution
targets work properly.

Differential Revision: https://reviews.llvm.org/D41144

llvm-svn: 320537
2017-12-13 01:14:27 +00:00
Shoaib Meenai
ac75523108 [lldb] Switch to add_llvm_install_targets
This adds the install-*-stripped targets to LLDB, which are required for
the install-distribution-stripped option. We also need to create some
install-*-stripped targets manually, which are modeled after their
corresponding install-* targets.

Differential Revision: https://reviews.llvm.org/D41099

llvm-svn: 320443
2017-12-12 00:47:07 +00:00
Vedant Kumar
9df6e0a5ea Disable warnings related to anonymous types in the ObjC plugin
This part of lldb make use of anonymous structs and unions. The usage is
idiomatic and doesn't deserve a warning. Logic in the NSDictionary and NSSet
plugins use anonymous structs in a manner consistent with the relevant Apple
frameworks.

Differential Revision: https://reviews.llvm.org/D40757

llvm-svn: 320071
2017-12-07 18:57:09 +00:00
Shoaib Meenai
d806af3499 [CMake] Use PRIVATE in target_link_libraries for executables
We currently use target_link_libraries without an explicit scope
specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables.
Dependencies added in this way apply to both the target and its
dependencies, i.e. they become part of the executable's link interface
and are transitive.

Transitive dependencies generally don't make sense for executables,
since you wouldn't normally be linking against an executable. This also
causes issues for generating install export files when using
LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM
library dependencies, which are currently added as interface
dependencies. If clang is in the distribution components but the LLVM
libraries it depends on aren't (which is a perfectly legitimate use case
if the LLVM libraries are being built static and there are therefore no
run-time dependencies on them), CMake will complain about the LLVM
libraries not being in export set when attempting to generate the
install export file for clang. This is reasonable behavior on CMake's
part, and the right thing is for LLVM's build system to explicitly use
PRIVATE dependencies for executables.

Unfortunately, CMake doesn't allow you to mix and match the keyword and
non-keyword target_link_libraries signatures for a single target; i.e.,
if a single call to target_link_libraries for a particular target uses
one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must
also be updated to use those keywords. This means we must do this change
in a single shot. I also fully expect to have missed some instances; I
tested by enabling all the projects in the monorepo (except dragonegg),
and configuring both with and without shared libraries, on both Darwin
and Linux, but I'm planning to rely on the buildbots for other
configurations (since it should be pretty easy to fix those).

Even after this change, we still have a lot of target_link_libraries
calls that don't specify a scope keyword, mostly for shared libraries.
I'm thinking about addressing those in a follow-up, but that's a
separate change IMO.

Differential Revision: https://reviews.llvm.org/D40823

llvm-svn: 319840
2017-12-05 21:49:56 +00:00
Pavel Labath
f753bfeeec Fix LLVM_LINK_LLVM_DYLIB build (pr35053)
Summary:
r316368 broke this build when it introduced a reference to a pthread
function to the Utility module. This caused cmake to generate an
incorrect link line (wrong order of libs) because it did not see the
dependency from Utility to the system libraries. Instead these libraries
were being manually added to each final target.

This changes moves the dependency management from the individual targets
to the lldbUtility module, which is consistent with how llvm does it.
The final targets will pick up these libraries as they will be a part of
the link interface of the module.

Technically, some of these dependencies could go into the host module,
as that's where most of the os-specific code is, but I did not try to
investigate which ones.

Reviewers: zturner, sylvestre.ledru

Subscribers: lldb-commits, mgorny

Differential Revision: https://reviews.llvm.org/D39246

llvm-svn: 316997
2017-10-31 13:23:19 +00:00
Eugene Zemtsov
0edfea5340 Check availability of accept4 in C++ instad of C code.
llvm-svn: 313437
2017-09-16 02:58:49 +00:00
Eugene Zemtsov
d4abad9a0a More precise c library feature detection for Android.
llvm-svn: 313436
2017-09-16 02:19:21 +00:00
Chris Bieneman
8c01cc54eb [CMake] Add checks for libcompression
This enables libcompression when available in the CMake build system.

llvm-svn: 309395
2017-07-28 15:39:51 +00:00
Chris Bieneman
6bcc4b96b3 [CMake] Adapt to clang r309390
This removes the configuration order dependence between LLDB and Clang.

llvm-svn: 309392
2017-07-28 15:39:49 +00:00
Chris Bieneman
3769777f11 [CMake] Update Framework construction for iOS
On iOS frameworks don't have versions or resources, they are flatter bundles. This updates the LLDB framework build to accommodate the flatter bundles.

llvm-svn: 309025
2017-07-25 20:31:15 +00:00
Chris Bieneman
5493c34c85 [CMake] NFC. Cleanup unnecessary CMake policy
This is just setting to the default behavior, so it does nothing.

llvm-svn: 309022
2017-07-25 20:30:18 +00:00
Chris Bieneman
5deeda88a3 [CMake] Cleanup unnecessary definition
This is only used in one file, and we already set it correctly on that file, so we don't need to set this everywhere.

llvm-svn: 309021
2017-07-25 20:29:45 +00:00
Chris Bieneman
f6b8ac28ab [CMake] A few fixups to support building LLDB for iOS
These changes enable proper configuration of LLDB targeting iOS.

llvm-svn: 308378
2017-07-18 21:15:53 +00:00
Chris Bieneman
154a5ff15b [CMake] [NFC] Remove out of date and redundant version requirement
Since we set the minimum required version elsewhere to be higher this actually has meaningful good impact.

llvm-svn: 308376
2017-07-18 21:15:14 +00:00
Pavel Labath
090b8616e2 cmake: Put PROCESS_VM_READV detection results into Config.h
Reviewers: beanz, eugene

Subscribers: mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D33771

llvm-svn: 304544
2017-06-02 12:29:08 +00:00
Pavel Labath
02f290f652 cmake: Enable process_vm_readv detection on android
Only android and linux can have this function as far as I am aware, but
it seems cleaner to enable this code for all platforms.

llvm-svn: 304405
2017-06-01 11:20:17 +00:00
Chris Bieneman
2246972ecc [CMake] Abstract Config.h generation for Xcode
This patch abstracts the generation of Config.h and creates a dummy project entry point to allow generation of LLDB's Config header without performing a full CMake configuration.

This will enable the Xcode project to generate LLDB's Config header.

llvm-svn: 301553
2017-04-27 16:04:26 +00:00
Chris Bieneman
1182779917 Re-landing IPv6 support for LLDB Host
This support was landed in r300579, and reverted in r300669 due to failures on the bots.

The failures were caused by sockets not being properly closed, and this updated version of the patches should resolve that.

Summary from the original change:

This patch adds IPv6 support to LLDB/Host's TCP socket implementation. Supporting IPv6 involved a few significant changes to the implementation of the socket layers, and I have performed some significant code cleanup along the way.

This patch changes the Socket constructors for all types of sockets to not create sockets until first use. This is required for IPv6 support because the socket type will vary based on the address you are connecting to. This also has the benefit of removing code that could have errors from the Socket subclass constructors (which seems like a win to me).

The patch also slightly changes the API and behaviors of the Listen/Accept pattern. Previously both Listen and Accept calls took an address specified as a string. Now only listen does. This change was made because the Listen call can result in opening more than one socket. In order to support listening for both IPv4 and IPv6 connections we need to open one AF_INET socket and one AF_INET6 socket. During the listen call we construct a map of file descriptors to addrin structures which represent the allowable incoming connection address. This map removes the need for taking an address into the Accept call.

This does have a change in functionality. Previously you could Listen for connections based on one address, and Accept connections from a different address. This is no longer supported. I could not find anywhere in LLDB where we actually used the APIs in that way. The new API does still support AnyAddr for allowing incoming connections from any address.

The Listen implementation is implemented using kqueue on FreeBSD and Darwin, WSAPoll on Windows and poll(2) everywhere else.

https://reviews.llvm.org/D31823

llvm-svn: 301492
2017-04-26 23:17:20 +00:00
Pavel Labath
2933d7b0d2 Remove the home-grown android toolchain file and all references to it
Summary:
The toolchain file has been deprecated in favor of the "official"
toolchain file present in the Android NDK. Also update the web
build instructions to reflect this.

Reviewers: eugene

Subscribers: srhines, mgorny, dgross, tberghammer, lldb-commits

Differential Revision: https://reviews.llvm.org/D32441

llvm-svn: 301306
2017-04-25 12:58:49 +00:00
Nitesh Jain
4c5fb05503 [LLDB][MIPS] Move it into HandleLLVMOptions.cmake.
The revison https://reviews.llvm.org/D32125 will fixed the off_t for GNU specific 32 bit platform. This fixed the difference in definition of off_t in LLDB and LLVM

Subscribers: jaydeep, bhushan, lldb-commits, slthakur, llvm-commits, krytarowski, emaste, zturner
llvm-svn: 301172
2017-04-24 10:56:01 +00:00
Kamil Rytarowski
37283039cd Resurrect LLDB Standalone build on NetBSD
Include CheckIncludeFile for check_include_file() in CMake.

Detect <sys/event.h> in CMake.
This header is available on NetBSD.

llvm-svn: 300853
2017-04-20 16:35:36 +00:00
Pavel Labath
107e694271 Revert yesterdays IPv6 patches
The break the linux bots (and probably any other machine which would
run the test suite in a massively parallel way). The problem is that it
can happen that we only successfully create an IPv6 listening socket
(because the relevant IPv4 port is used by another process) and then the
connecting side attempts to connect to the IPv4 port and fails.

It's not very obvious how to fix this problem, so I am reverting this
until we come up with a solution.

llvm-svn: 300669
2017-04-19 10:13:22 +00:00
Chris Bieneman
94c1708110 [CMake] Add configure check for sys/event.h
This enables the kqueue path in MainLoop for Darwin and BSD.

llvm-svn: 300654
2017-04-19 02:53:53 +00:00
Chris Bieneman
7879598d75 [CMake] Adding configure-time check for sigaction
Hopefully this will fix the netbsd bot that I broke...

llvm-svn: 300590
2017-04-18 20:49:09 +00:00
Chris Bieneman
31e7c5e89f Update LLDB Host to support IPv6 over TCP
Summary:
This patch adds IPv6 support to LLDB/Host's TCP socket implementation. Supporting IPv6 involved a few significant changes to the implementation of the socket layers, and I have performed some significant code cleanup along the way.

This patch changes the Socket constructors for all types of sockets to not create sockets until first use. This is required for IPv6 support because the socket type will vary based on the address you are connecting to. This also has the benefit of removing code that could have errors from the Socket subclass constructors (which seems like a win to me).

The patch also slightly changes the API and behaviors of the Listen/Accept pattern. Previously both Listen and Accept calls took an address specified as a string. Now only listen does. This change was made because the Listen call can result in opening more than one socket. In order to support listening for both IPv4 and IPv6 connections we need to open one AF_INET socket and one AF_INET6 socket. During the listen call we construct a map of file descriptors to addrin structures which represent the allowable incoming connection address. This map removes the need for taking an address into the Accept call.

This does have a change in functionality. Previously you could Listen for connections based on one address, and Accept connections from a different address. This is no longer supported. I could not find anywhere in LLDB where we actually used the APIs in that way. The new API does still support AnyAddr for allowing incoming connections from any address.

The Listen implementation is implemented using kqueue on FreeBSD and Darwin, WSAPoll on Windows and poll(2) everywhere else.

Reviewers: zturner, clayborg

Subscribers: jasonmolenda, labath, lldb-commits, emaste

Differential Revision: https://reviews.llvm.org/D31823

llvm-svn: 300579
2017-04-18 20:01:52 +00:00
Chris Bieneman
b90bee044b [CMake] Support generating Config.h
Summary:
This patch removes the hand maintained config files in favor of auto-generating the config file. We will still need to maintain the defines for the Xcode builds on Mac, but all CMake builds use the generated header instead.

This will enable finer grained platform support tests and enable supporting LLDB on more platforms with less manual maintenance.

I have only tested this patch on Darwin, and any help testing it out on other platforms would be greatly appreciated. I've probably messed something up somewhere.

Reviewers: labath, zturner

Reviewed By: labath

Subscribers: krytarowski, emaste, srhines, lldb-commits, mgorny

Differential Revision: https://reviews.llvm.org/D31969

llvm-svn: 300372
2017-04-14 22:03:45 +00:00
Zachary Turner
f98dec1c53 CMake requires normalized paths when appending.
Patch by Hugh Bellamy
Differential Revision: https://reviews.llvm.org/D30927

llvm-svn: 298100
2017-03-17 16:33:37 +00:00
Chris Bieneman
fd2f0cb170 [CMake] Final dependency cleanup patch!
Summary:
This patch removes the over-specified dependencies from LLDBDependencies and instead relies on the dependencies as expressed in each library and tool.

This also removes the library looping in favor of allowing CMake to do its thing. I've tested this patch on Darwin, and found no issues, but since linker semantics vary by system I'll also work on testing it on other platforms too.

Help testing would be greatly appreciated.

Reviewers: labath, zturner

Subscribers: danalbert, srhines, mgorny, jgosnell, lldb-commits

Differential Revision: https://reviews.llvm.org/D29352

llvm-svn: 294515
2017-02-08 21:00:46 +00:00
Kamil Rytarowski
4791532830 Install six.py conditionally
Summary:
The current version of LLDB installs six.py into global python library directory. This approach produces conflicts downstream with distribution's py-six copy.

Introduce new configure option LLDB_USE_SYSTEM_SIX (disabled by default). Once specified as TRUE, six.py won't be installed to Python's directory.

Add new option in finishSwigWrapperClasses.py, namely --useSystemSix.

Sponsored by <The NetBSD Foundation>

Reviewers: mgorny, emaste, clayborg, joerg, labath

Reviewed By: labath

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D29405

llvm-svn: 294071
2017-02-04 00:20:24 +00:00
Chris Bieneman
cee3837eb8 [CMake] Add explicit dependencies to plugins
Summary:
This patch does two things. First it updates all the ABI plugins with accurate dependencies, and second it adds a tracking mechanism for add_lldb_library to denote plugin libraries, allowing us to build up a list of all the configured plugins.

This list of generated plugins will be used during generating liblldb so that we can link all the plugins into the library.

If this patch looks good I will update all the other plugins in subsequent patches.

Reviewers: labath, zturner

Subscribers: nemanjai, mgorny, lldb-commits, jgosnell

Differential Revision: https://reviews.llvm.org/D29348

llvm-svn: 293696
2017-01-31 22:12:59 +00:00
Chris Bieneman
62b83ede84 [CMake] Add LINK_LIBS and LINK_COMPONENTS options
This patch adds CMake options to add_lldb_library and add_lldb_executable for specifying LLVM components and direct library links.

This patch is NFC, but it is a small separable bit of a series of much larger patches that I'll be landing over the next day or two.

llvm-svn: 293647
2017-01-31 16:59:46 +00:00
Pavel Labath
095d6b8f99 Address post-commit review remarks
Tamas pointed out that the macro name I used in r293282 was too vague.
Rename it to better reflect what it is used for.

llvm-svn: 293287
2017-01-27 15:19:03 +00:00
Pavel Labath
810055ee23 Fix android-i386 build broken by previous commit
I foolishly thought I could simplify the condition to cover all android
targets. I was wrong - i386 headers don't define __NR_accept.

Revert back to enabling the workaround on arm an mips only.

llvm-svn: 293282
2017-01-27 12:58:23 +00:00
Pavel Labath
ef97630fd2 Refactor the android accept hack
This moves the accept hack from the android toolchain file into
LLDBConfig.cmake. This allows successful lldb android compilation
without relying on our custom toolchain file.

llvm-svn: 293281
2017-01-27 12:23:51 +00:00
Pavel Labath
e5cfc67113 [cmake] Make lldb build with the android ndk toolchain file
Summary:
The NDK cmake toolchain file defines CMAKE_SYSTEM_NAME=Android, so switch the
build to use that. I have also updated the in-tree toolchain file to do that
(instead of defining __ANDROID_NDK__), so it can still be used to build.
After migrating the last bits of non-toolchainy bits out of the in-tree
toolchain, I intend to delete it.

Reviewers: tberghammer, danalbert

Subscribers: srhines, mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D28775

llvm-svn: 292212
2017-01-17 11:55:00 +00:00
Michal Gorny
eb200b2ccf [cmake] Obtain LLVM_CMAKE_PATH from llvm-config
Use the new --cmakedir option to obtain LLVM_CMAKE_PATH straight from
llvm-config instead of reconstructing it locally.

llvm-svn: 291500
2017-01-09 23:12:37 +00:00
Chris Bieneman
5f0793b36c [CMake] Fix install rules for tools included in the framework
The logic for install rules was wrong for tools included in the framework if the framework build is disabled.

llvm-svn: 290934
2017-01-04 03:36:35 +00:00
Chris Bieneman
e9ce09b89f [CMake] Support distribution install for LLDB.framework
This patch adds the last bit of support to get LLVM_DISTRIBUTION_COMPONENTS working with libLLDB when built as a framework.

This patch adds dummy install targets for binaries built into the framework's Resources directory, and makes the framework's install target depend on all the binaries that get installed with the framework.

llvm-svn: 290273
2016-12-21 21:23:27 +00:00
Chris Bieneman
11da40b775 [CMake] [PR31433] Fix LLDB tool installation
This resolves PR 31433.

llvm-svn: 290180
2016-12-20 16:28:18 +00:00
Sylvestre Ledru
47b071deff Support of lldb on Kfreebsd
Summary: Patch by Pino Toscano. Reported in http://bugs.debian.org/835665

Reviewers: tfiala, emaste

Subscribers: beanz, mgorny, emaste, krytarowski, brucem, tberghammer, danalbert, srhines, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D23977

llvm-svn: 290044
2016-12-17 12:48:06 +00:00
Chris Bieneman
d69b9414b3 [CMake] Refactor LLDB libraries and tools to be components
In LLVM's CMake we have a convention that components have both a build and an install target. Making LLDB follow this convention will allow LLDB to take advantage of the LLVM_DISTRIBUTION_COMPONENTS build option from LLVM.

llvm-svn: 289879
2016-12-15 22:01:17 +00:00
Hafiz Abid Qadeer
f6ee79c926 Fix build for mingw.
Summary: I was building lldb using cross mingw-w64 toolchain on Linux and observed some issues. This is first patch in the series to fix that build. It mostly corrects the case of include files and adjusts some #ifdefs from _MSC_VER to _WIN32 and vice versa. I built lldb on windows with VS after applying this patch to make sure it does not break the build there.

Reviewers: zturner, labath, abidh

Subscribers: ki.stfu, mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D27759

llvm-svn: 289821
2016-12-15 15:00:41 +00:00
Pavel Labath
3d9941588f Remove one more if(__ANDROID_NDK__) I missed
llvm-svn: 288673
2016-12-05 14:57:19 +00:00
Chris Bieneman
c5882a73a0 [CMake] Use add_llvm_tool_symlink's OUTPUT_DIR option
This is updating to take r288632 into account.

llvm-svn: 288633
2016-12-05 03:29:10 +00:00
Pavel Labath
e705c8b5e6 Replace __ANDROID_NDK__ with __ANDROID__
Summary:
This replaces all the uses of the __ANDROID_NDK__ define with __ANDROID__. This
is a preparatory step to remove our custom android toolchain file and rely on
the standard android NDK one instead, which does not provide this define.
Instead I rely, on __ANDROID__, which is set by the compiler.

I haven't yet removed the cmake variable with the same name, as we will need to
do something completely different there -- NDK toolchain defines
CMAKE_SYSTEM_NAME to Android, while our current one pretends it's linux.

Reviewers: tberghammer, zturner

Subscribers: danalbert, srhines, mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D27305

llvm-svn: 288494
2016-12-02 11:15:15 +00:00
Pavel Labath
c962c6ac3b Remove another hack from the android toolchain file
This is no longer an issue with recent versions of the android ndk.

llvm-svn: 288387
2016-12-01 17:48:51 +00:00
Pavel Labath
bbd6f7af33 Remove a hack from the Android toolchain file
Summary:
The fix is to make sure llvm does not pull in dlopen() in configurations where it
is not available.

Reviewers: tberghammer, beanz

Subscribers: danalbert, srhines, lldb-commits, mgorny

Differential Revision: https://reviews.llvm.org/D26505

llvm-svn: 288331
2016-12-01 11:30:08 +00:00
Adrian McCarthy
4ad5def9b0 Refactor LLDB's Windows process plugin (NFC)
The Windows process plugin was broken up into multiple pieces a while back in
order to share code between debugging live processes and minidumps
(postmortem) debugging. The minidump portion was replaced by a cross-platform
solution. This left the plugin split into a formerly "common" base classes and
the derived classes for live debugging. This extra layer made the code harder
to understand and work with.

This patch simplifies these class hierarchies by rolling the live debugging
concrete classes up to the base classes. Last week I posted my intent to make
this change to lldb-dev, and I didn't hear any objections.

This involved moving code and changing references to classes like
ProcessWindowsLive to ProcessWindows. It still builds for both 32- and 64-bit,
and the tests still pass on 32-bit. (Tests on 64-bit weren't passing before
this refactor for unrelated reasons.)

llvm-svn: 287770
2016-11-23 16:26:37 +00:00
Chris Bieneman
b653c4957d [CMake] NFC. Updating CMake dependency specifications
This patch updates a bunch of places where add_dependencies was being explicitly called to add dependencies on intrinsics_gen to instead use the DEPENDS named parameter. This cleanup is needed for a patch I'm working on to add a dependency debugging mode to the build system.

llvm-svn: 287408
2016-11-18 23:31:53 +00:00
Adrian McCarthy
1ca677f4c4 Remove Windows-specific minidump plugin
With the cross-platform minidump plugin working, the Windows-specific one is no longer needed. This eliminates the unnecessary code.

This does not eliminate the Windows-specific tests, as they hit a few cases the general tests don't. (The Windows-specific tests are currently passing.) I'll look into a separate patch to make sure we're not doing too much duplicate testing.

After that I might do a little re-org in the Windows plugin, as there was some factoring there (Common & Live) that probably isn't necessary anymore.

Differential Revision: https://reviews.llvm.org/D26697

llvm-svn: 287113
2016-11-16 16:04:14 +00:00
Chris Bieneman
1778f69f44 Fixing the Xcode build that I broke in r286479
Since Xcode can't seem to handle quotes in preprocessor definitions, I've changed the build to assume that the define is unquoted. This should fix the failing Darwin bots.

llvm-svn: 286504
2016-11-10 21:30:16 +00:00
Chris Bieneman
b92cfe6804 Unify Darwin and Non-Darwin printing of version output
Summary:
This change unifies and simplifies the code paths between the Darwin and non-Darwin code to print the LLDB version information.

It also introduces a new variable in CMake LLDB_VERSION_STRING which can be used to specify custom version information. On Darwin this value is implicitly set based on the resource/LLDB-Info.plist file.

With the LLDB_VERSION_STRING variable set to lldb-360.99.0, the -version output is:

> ./bin/lldb -version
lldb version 4.0.0 (lldb-360.99.0)
  clang revision 286264
  llvm revision 286265

This behavior is unified across all target platforms.

Reviewers: lldb-commits

Subscribers: mgorny, tfiala

Differential Revision: https://reviews.llvm.org/D26478

llvm-svn: 286479
2016-11-10 17:33:19 +00:00
Pavel Labath
01a955a341 [cmake] Make dependencies of lldb libraries private, take 2
Summary:
The dependencies of our libraries (only liblldb, really) we marked as public, which caused all
their dependencies to be repeated when linking any executables to them. This is a problem because
then all the .a files could end up being linked twice, once to liblldb and once
again to to the executable linking against liblldb (lldb, lldb-mi). As it turns out,
our build actually depends on this behavior:
- on windows, lldb does not have getopt, so it pulls it from inside liblldb, even
  though getopt is not a part of the exported interface of liblldb (maybe some of
  the bsd variants have this problem as well)
- lldb-mi uses llvm, which again is not exported by liblldb

This change does not actually fix these problems (that is going to be a hard
one), but it does make them explicit by moving this magic from add_lldb_library
to the places the executable targets are defined. That way, I can link the
additional .a files only on targets that really need it, and the other targets
can build cleanly and make sure we don't regress further. It also fixes the
LLVM_LINK_LLVM_DYLIB build on linux.

Reviewers: zturner, beanz

Subscribers: ki.stfu, lldb-commits, mgorny

Differential Revision: https://reviews.llvm.org/D25680

llvm-svn: 284466
2016-10-18 10:26:57 +00:00
Chris Bieneman
7176862809 [CMake] Fixing a small hack in add_lldb_library
This code was adding an explicit dependency on libclang because lldb needs clang headers, changing this to instead depend on the clang tablegen targets means we don't have to depend on building the clang bits in libclang that lldb doesn't need.

Note this is still a bit of a hack because we're adding the dependency to all lldb libraries, instead of just the ones that need it.

llvm-svn: 282196
2016-09-22 21:08:27 +00:00
Chris Bieneman
d3199f5ed2 [CMake] Initial support for LLDB.framework
Summary:
This patch adds a CMake option LLDB_BUILD_FRAMEWORK, which builds libLLDB as a macOS framework instead of as a *nix shared library.

With this patch any LLDB executable that has the INCLUDE_IN_FRAMEWORK option set will be built into the Framework's resources directory, and a symlink to the exeuctable will be placed under the build directory's bin folder. Creating the symlinks allows users to run commands from the build directory without altering the workflow.

The framework generated by this patch passes the LLDB test suite, but has not been tested beyond that. It is not expected to be fully ready to ship, but it is a first step.

With this patch binaries that are placed inside the framework aren't being properly installed. Fixing that would increase the patch size significantly, so I'd like to do that in a follow-up.

Reviewers: zturner, tfiala

Subscribers: beanz, lldb-commits, mgorny

Differential Revision: https://reviews.llvm.org/D24749

llvm-svn: 282110
2016-09-21 21:02:16 +00:00
Rafael Espindola
9aa7d66aab Use llvm's demangler.
LLVM now has a copy of libcxxabi demangler, so lldb doesn't need to
keep one too.

llvm-svn: 280821
2016-09-07 16:14:00 +00:00
Dimitar Vlahovski
2e50d8edc6 Minidump parsing
Summary:
This is a Minidump parsing code.
There are still some more structures/data streams that need to be added.
The aim ot this is to be used in the implementation of
a minidump debugging plugin that works on all platforms/architectures.
Currently we have a windows-only plugin that uses the WinAPI to parse
the dump files.
Also added unittests for the current functionality.

Reviewers: labath, amccarth

Subscribers: tberghammer, danalbert, srhines, lldb-commits, dschuff

Differential Revision: https://reviews.llvm.org/D23545

llvm-svn: 280356
2016-09-01 11:29:53 +00:00
Pavel Labath
0e947eb636 Add cmake option to choose whether to use the builtin demangler
Summary:
Previously the builting demangler was on for platforms that explicitly set a flag by modifying
Mangled.cpp (windows, freebsd). The Xcode build always used builtin demangler by passing a
compiler flag. This adds a cmake flag (defaulting to ON) to configure the demangling library used
at build time. The flag is only available on non-windows platforms as there the system demangler
is not present (in the form we're trying to use it, at least).
The impact of this change is:
- linux: switches to the builtin demangler
- freebsd, windows: NFC (I hope)
- netbsd: switches to the builtin demangler
- osx cmake build: switches to the builtin demangler (matching the XCode build)

The main motivation for this is the cross-platform case, where it should bring more consistency
by removing the dependency on the host demangler (which can be completely unrelated to the debug
target).

Reviewers: zturner, emaste, krytarowski

Subscribers: emaste, clayborg, lldb-commits

Differential Revision: https://reviews.llvm.org/D23830

llvm-svn: 279808
2016-08-26 09:47:58 +00:00
Vedant Kumar
e62b54ed2a Revert "[lldb][cmake] Remove libclang as an lldbBase dependency (NFCI)"
This reverts commit r279296. Including LLDBDependencies breaks the
netbsd lldb bot because it exposes LLDB_USED_LIBS, which causes
lldb_link_common_libs to run to completion in unintended sites, which
results in a malformed call to target_link_libraries.

  http://lab.llvm.org:8011/builders/lldb-amd64-ninja-netbsd7/builds/5989

Thanks to Chris Bieneman for figuring this out!

llvm-svn: 279322
2016-08-19 21:00:40 +00:00
Vedant Kumar
181f924beb [lldb][cmake] Remove libclang as an lldbBase dependency (NFCI)
It's pulling in all kinds of things it doesn't need (e.g, clang-tidy!).

Eliminating this dependency removes 1056 dependencies from the
'CommandObjectFrame.cpp.o' target and 454 dependencies from the 'lldb'
target. On my machine, this shaves 7 minutes off of a clean build of
lldb.

Thanks to Zachary Turner for pointing out some issues with an earlier
version of this patch!

Differential Revision: https://reviews.llvm.org/D22987

llvm-svn: 279296
2016-08-19 18:41:50 +00:00
Todd Fiala
759300192a Add StructuredData plugin type; showcase with new DarwinLog feature
Take 2, with missing cmake line fixed.  Build tested on
Ubuntu 14.04 with clang-3.6.

See docs/structured_data/StructuredDataPlugins.md for details.

differential review: https://reviews.llvm.org/D22976

reviewers: clayborg, jingham
llvm-svn: 279202
2016-08-19 04:21:48 +00:00
Todd Fiala
a07e4a8352 Revert "Add StructuredData plugin type; showcase with new DarwinLog feature"
This reverts commit 1d885845d1451e7b232f53fba2e36be67aadabd8.

llvm-svn: 279200
2016-08-19 03:03:58 +00:00
Todd Fiala
aef7de8492 Add StructuredData plugin type; showcase with new DarwinLog feature
See docs/structured_data/StructuredDataPlugins.md for details.

differential review: https://reviews.llvm.org/D22976

reviewers: clayborg, jingham
llvm-svn: 279198
2016-08-19 02:52:07 +00:00
Pavel Labath
2f430a1938 Remove cmake legacy code
Summary: Cmake 2.8 support is gone and not coming back. We can remove a bit of legacy code now.

Reviewers: zturner

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D23554

llvm-svn: 278924
2016-08-17 11:55:50 +00:00
Ismail Donmez
7b80ff3c7e Fix the BUILD_SHARED_LIBS=ON build, was getting the following error while linking liblldb.so:
../include/llvm/Target/TargetOptions.h:104: error: undefined reference to 'llvm::TargetRecip::TargetRecip()'

llvm-svn: 277585
2016-08-03 10:46:42 +00:00
Tamas Berghammer
00adc41370 Support for OCaml native debugging
This introduces basic support for debugging OCaml binaries.
Use of the native compiler with DWARF emission support (see
https://github.com/ocaml/ocaml/pull/574) is required.

Available variables are considered as 64 bits unsigned integers,
their interpretation will be left to a OCaml-made debugging layer.

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

llvm-svn: 277443
2016-08-02 11:15:55 +00:00
Omair Javaid
9fab64643d Fix LLDBConfig.cmake to enable python enabled build for all 64 bit lldb targets
Differential revision: https://reviews.llvm.org/D22771

llvm-svn: 276814
2016-07-26 21:43:02 +00:00
Eugene Zelenko
dab35bd67f Fixes for standalone build:
* include CheckAtomic to set HAVE_CXX_ATOMICS64_WITHOUT_LIB properly (introduced in r274121)
* hint Clang CMake files for LLVM CMake files location (inctroduced in ~ r274176)

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

llvm-svn: 275641
2016-07-15 22:46:15 +00:00
Sagar Thakur
067b6edc1f [LLDB][MIPS] Check if libatomic needs to be specified explicitly
Patch by Nitesh Jain.

Summary : The problem appears while linking liblldb.so. The class Address contain atomic variable m_offset. The loading and storing of variable is access via atomic_load_8 and atomic_store_8 functions. Some target fail to implicitly link libatomic, which cause undefine reference to atomic_store_8/atomic_load_8. This patch uses http://reviews.llvm.org/D20896 to check if libatomic need to be explicitly link.

Reviewed by labath.
Differential: D20464

llvm-svn: 274121
2016-06-29 12:30:18 +00:00
Pavel Labath
a0adeb69ab [cmake] Remove the LLDB versions of the exception-controlling variables
Summary:
One can still use the LLVM variables to control this: LLVM_ENABLE_EH, LLVM_ENABLE_RTTI. It's not
clear to me why one would want to control these at lldb level and it's generally not even a good
idea to compile parts of the same binary with different values of these flags.

Reviewers: zturner, tfiala

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D20673

llvm-svn: 270863
2016-05-26 16:11:04 +00:00
Pavel Labath
95d6c7731c [cmake] Add a big warning about a libstdc++ issue
Summary:
Recent increase in the usage of std::weak_ptr has caused us to rediscover an issue in libstdc++
versions prior to 4.9 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59656>, which make this class
unusable without exceptions in the presence of multiple threads. It's virtualy impossible to work
around this issue without implementing our own shared_ptr/weak_ptr substitutes, which does not
seem like a good idea.

Therefore, I am adding a big CMake warning which warns you about this issue if you're attempting
a to do a build which is suceptible to this problem and suggests possible alternatives. Right
now, nothing spectacular will happen if you ignore this warning (all the crashes I have seen
occur during process shutdown), but there's no guarantee the situation will not change in the
future.

Reviewers: tberghammer, tfiala, nitesh.jain, omjavaid, emaste, krytarowski

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D20671

llvm-svn: 270854
2016-05-26 15:16:11 +00:00
Tamas Berghammer
059e5fb44f Work around android-arm NDK bug exposed by rL269992
In the android-arm ndk there is a duplicated typedef in link.h
and in unwind.h causing build erros. This CL introduces a HACK
to prevent LLVM from finding unwind.h to fix the issue.

llvm-svn: 270201
2016-05-20 10:58:55 +00:00
Eugene Zelenko
000752f171 Fix standalone LLDB build, when LLVM/Clang were built with LLVM_INSTALL_TOOLCHAIN_ONLY=ON.
Fix standalone build with CMake 2.8.12.2.

Differential revision: http://reviews.llvm.org/D20344

llvm-svn: 269996
2016-05-18 22:50:08 +00:00
Kamil Rytarowski
f49f2ee6d6 Add CMake bits necessary for standalone build
Summary: Developed on NetBSD with pkgsrc.

Reviewers: zturner, labath

Subscribers: jevinskie, zturner, tfiala, Eugene.Zelenko, artagnon, joerg, lldb-commits

Differential Revision: http://reviews.llvm.org/D15067

llvm-svn: 269332
2016-05-12 19:49:17 +00:00
Eugene Zelenko
774b8da47f Fix standalone build on RHEL6.
Differential revision: http://reviews.llvm.org/D19991

llvm-svn: 268750
2016-05-06 17:03:09 +00:00
Kamil Rytarowski
90db606429 Fix NetBSD build with CMake 3.5.2
Summary:
Building HEAD of LLDB fails in linking against DebugInfoPDB. It also prints the following warning:

```
CMake Warning (dev) in source/Plugins/SymbolFile/PDB/CMakeLists.txt:
  Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
  interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  Target "lldbPluginSymbolFilePDB" has an INTERFACE_LINK_LIBRARIES property.
  This should be preferred as the source of the link interface for this
  library but because CMP0022 is not set CMake is ignoring the property and
  using the link implementation as the link interface instead.

  INTERFACE_LINK_LIBRARIES:

    LLVMDebugInfoPDB

  Link implementation:

    (empty)
```

CMP0022 was introduced in CMake-2.8.11, bump minimal required version from 2.8 to 3.0 to gain more useful features like libexecinfo(3) detection on NetBSD.

Reviewers: emaste, zturner, labath

Subscribers: zturner, lldb-commits, joerg

Differential Revision: http://reviews.llvm.org/D19685

llvm-svn: 268191
2016-05-01 10:23:24 +00:00
Ulrich Weigand
bb00d0b6b2 Support Linux on SystemZ as platform
This patch adds support for Linux on SystemZ:
- A new ArchSpec value of eCore_s390x_generic
- A new directory Plugins/ABI/SysV-s390x providing an ABI implementation
- Register context support
- Native Linux support including watchpoint support
- ELF core file support
- Misc. support throughout the code base (e.g. breakpoint opcodes)
- Test case updates to support the platform

This should provide complete support for debugging the SystemZ platform.
Not yet supported are optional features like transaction support (zEC12)
or SIMD vector support (z13).

There is no instruction emulation, since our ABI requires that all code
provide correct DWARF CFI at all PC locations in .eh_frame to support
unwinding (i.e. -fasynchronous-unwind-tables is on by default).

The implementation follows existing platforms in a mostly straightforward
manner.  A couple of things that are different:

- We do not use PTRACE_PEEKUSER / PTRACE_POKEUSER to access single registers,
  since some registers (access register) reside at offsets in the user area
  that are multiples of 4, but the PTRACE_PEEKUSER interface only allows
  accessing aligned 8-byte blocks in the user area.  Instead, we use a s390
  specific ptrace interface PTRACE_PEEKUSR_AREA / PTRACE_POKEUSR_AREA that
  allows accessing a whole block of the user area in one go, so in effect
  allowing to treat parts of the user area as register sets.

- SystemZ hardware does not provide any means to implement read watchpoints,
  only write watchpoints.  In fact, we can only support a *single* write
  watchpoint (but this can span a range of arbitrary size).  In LLDB this
  means we support only a single watchpoint.  I've set all test cases that
  require read watchpoints (or multiple watchpoints) to expected failure
  on the platform.  [ Note that there were two test cases that install
  a read/write watchpoint even though they nowhere rely on the "read"
  property.  I've changed those to simply use plain write watchpoints. ]

Differential Revision: http://reviews.llvm.org/D18978

llvm-svn: 266308
2016-04-14 14:28:34 +00:00
Kuba Brecka
ed0b2f7dd5 Follow-up for r264162 to fix the CMake build (update LLDBDependencies.cmake).
llvm-svn: 264168
2016-03-23 16:54:23 +00:00
Zachary Turner
190fadcdb2 Unicode support on Win32.
Win32 API calls that are Unicode aware require wide character
strings, but LLDB uses UTF8 everywhere.  This patch does conversions
wherever necessary when passing strings into and out of Win32 API
calls.

Patch by Cameron
Differential Revision: http://reviews.llvm.org/D17107
Reviewed By: zturner, amccarth

llvm-svn: 264074
2016-03-22 17:58:09 +00:00
Zachary Turner
74e08ca05c Add support for reading line tables from PDB files.
PDB is Microsoft's debug information format, and although we
cannot yet generate it, we still must be able to consume it.
Reason for this is that debug information for system libraries
(e.g. kernel32, C Runtime Library, etc) only have debug info
in PDB format, so in order to be able to support debugging
of system code, we must support it.

Currently this code should compile on every platform, but on
non-Windows platforms the PDB plugin will return 0 capabilities,
meaning that for now PDB is only supported on Windows.  This
may change in the future, but the API is designed in such a way
that this will require few (if any) changes on the LLDB side.
In the future we can just flip a switch and everything will
work.

This patch only adds support for line tables.  It does not return
information about functions, types, global variables, or anything
else.  This functionality will be added in a followup patch.

Differential Revision: http://reviews.llvm.org/D17363
Reviewed by: Greg Clayton

llvm-svn: 262528
2016-03-02 22:05:52 +00:00
Tamas Berghammer
87a9769e9b Add a set of new plugins to handle Java debugging
The purpose of these plugins is to make LLDB capable of debugging java
code JIT-ed by the android runtime.

Differential revision: http://reviews.llvm.org/D17616

llvm-svn: 262015
2016-02-26 14:21:23 +00:00
Niels Ole Salscheider
6795eff63e Fix the search path for CMake files
This allows to find the LLVM's CMake files after moving them in
r259821.

llvm-svn: 259845
2016-02-04 23:28:57 +00:00
Pavel Labath
48003e721e Fix linking with LLVM_LINK_LLVM_DYLIB=ON
Linking with LLVM shared libraries currently produces linker errors.  This works around the issue
(pr24953) by disabling linking with llvm so for lldb libraries.

Patch by Evangelos Foutras.

Reviewers: zturner

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D16293

llvm-svn: 258921
2016-01-27 11:02:02 +00:00
Aidan Dodds
a15b44c967 Patch cmake to allow detection of python 2.7.9+
Some distributions of python have their version defined as follows in patchlevel.h (note the '+'):
#define PY_VERSION "2.7.9+"
The '+' char needs to be stripped by the cmake regex so that LLDBs python lib detection is successful.

Differential Revision: http://reviews.llvm.org/D15566

llvm-svn: 255893
2015-12-17 14:13:39 +00:00
Tamas Berghammer
7b93d66208 Switch to gold linker on android x86, x86_64, arm
These architectures already using the gold linker for the android
framework and switching to gold gives us the opportunity to enable ICF.

Safe ICF (identical code folding) reduces the size of an optimized and
striped binary by ~5%.

Differential revision: http://reviews.llvm.org/D15379

llvm-svn: 255240
2015-12-10 11:02:51 +00:00
Tamas Berghammer
a8dd275609 Use thumb instruction set for ldb-server on android arm
Differential revision: http://reviews.llvm.org/D14816

llvm-svn: 253657
2015-11-20 10:51:39 +00:00
Bruce Mitchener
eb0a6f4308 Use library discovery for curses and panel
Summary:
This approach is tunable with custom paths for curses library.

It also detects whether there are requirements met.

I make use of it on NetBSD.

Patch by Kamil Rytarowski. Thanks!

Reviewers: clayborg

Subscribers: brucem, joerg, lldb-commits

Differential Revision: http://reviews.llvm.org/D14529

llvm-svn: 253151
2015-11-15 01:53:23 +00:00
Ramkumar Ramachandra
f7e934d12a LLDBStandalone: Report nice errors on missing vars
Differential Revision: http://reviews.llvm.org/D13819

llvm-svn: 252624
2015-11-10 18:09:14 +00:00
Bruce Mitchener
d31113f0b9 Add more NetBSD platform glue for lldb
Summary:
These changes are still incomplete, but  we are almost there.

Changes:
- CMake and gmake code
- SWIG code
- minor code additions

Reviewers: emaste, joerg

Subscribers: youri, akat1, brucem, lldb-commits, joerg

Differential Revision: http://reviews.llvm.org/D14042

llvm-svn: 252403
2015-11-07 15:31:54 +00:00
Ryan Brown
2dd84882fc Add go data formatters.
Differential Revision: http://reviews.llvm.org/D13878

llvm-svn: 252109
2015-11-05 00:24:36 +00:00
Ryan Brown
998c8a1c1c Create an expression parser for Go.
The Go interpreter doesn't JIT or use LLVM, so this also
moves all the JIT related code from UserExpression to a new class LLVMUserExpression.

Differential Revision: http://reviews.llvm.org/D13073

Fix merge

llvm-svn: 251820
2015-11-02 19:30:40 +00:00
Chaoren Lin
41c502318c Correctly include LLVM_EXTERNAL_CLANG_SOURCE_DIR.
Reviewers: sas, ovyalov

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D14166

llvm-svn: 251589
2015-10-29 00:48:38 +00:00
Adrian McCarthy
18a9135d56 Refactor Windows process plugin to allow code sharing between live and mini dump debugging.
llvm-svn: 251540
2015-10-28 18:21:45 +00:00
Stephane Sezer
d1517e184c Avoid using .. in paths for include dirs.
Summary:
This breaks when using a symlink from llvm/tools/lldb to the lldb source
tree, instead of cloning directly as a child. With this change, we can
build properly, even when using links.

Reviewers: dawn, brucem, zturner

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D14089

llvm-svn: 251530
2015-10-28 17:34:45 +00:00
Chaoren Lin
339428232a Use accept4 workaround for MIPS Android build.
Summary: Similar to http://reviews.llvm.org/rL242319, which was for ARM.

Reviewers: chying, ovyalov

Subscribers: aemerson, tberghammer, danalbert, srhines, lldb-commits

Differential Revision: http://reviews.llvm.org/D14127

llvm-svn: 251439
2015-10-27 19:17:35 +00:00
Tamas Berghammer
e7ec227839 Disable the strict-aliasing warnings produced by gcc
GCC produce a lot of strict-aliasing warning for the LLDB codebase
what makes reading the compile output very difficult. This change
disable these warnings to reduce the noise as we already ignore them.

We should consider re-enabling the warning if we fix all (or most)
strict-aliasing violation first.

Differential revision: http://reviews.llvm.org/D13981

llvm-svn: 251107
2015-10-23 10:34:53 +00:00