Commit Graph

94 Commits

Author SHA1 Message Date
Chris Bieneman 1c9da8bc55 [CMake] Fixing CMake to append source properties instead of overwrite them.
This is a small fix to the version output.

llvm-svn: 286528
2016-11-10 23:56:32 +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
Michal Gorny e2f4b25d04 [cmake] Use LLVM_CMAKE_PATH for GetSVN script
Use the LLVM_CMAKE_PATH variable to locate the GetSVN.cmake script.
The variable was already available in stand-alone builds, and is also
set by LLVM since r284581.

llvm-svn: 284584
2016-10-19 12:54:28 +00:00
Chris Bieneman aa098de715 [CMake] Generate LLDB_REVISION at build time
Summary:
This alters the generation of LLDB_REVISION to be heavily based on how clang generates its version header. There are two benefits of this aproach.

(1) The LLDB_REVISION is generated at build time, so it will be updated after an SCM pull/update even if CMake doesn't re-run
(2) This works on Windows

As noted this code is a simplified implementation of the code from clang.

Reviewers: tfiala, zturner

Subscribers: beanz, mgorny, lldb-commits

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

llvm-svn: 282314
2016-09-23 23:33:52 +00:00
Bruce Mitchener 64f74da568 Add initial CMake glue for the NetBSD platform
Summary:
These changes aren't everything what is needed for the CMake target, but it's significantly approaching it.

These changes shouldn't effect the build process on other platforms.

Patch by Kamil Rytarowski, thanks!

Reviewers: joerg, brucem

Subscribers: lldb-commits

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

llvm-svn: 251164
2015-10-24 00:27:04 +00:00
Bruce Mitchener 6ec5d61bda Fix handling of LLDB_VERS_GENERATED_FILE.
Summary:
This is Darwin only.

The symbol defined by ${LLDB_VERS_GENERATED_FILE} is used by
source/lldb.cpp, so anything that uses lldb.cpp (which is in
lldbBase) should also have the generated symbol. This means
that the entire process can be centralized within source/CMakeLists.txt
where lldbBase is constructed.

Additionally, the custom command should have dependencies on the
project file as well as the generation script so that if either
changes, the version file is correctly re-generated and everything
is re-linked appropriately.

* cmake/LLDBDependencies.cmake: Remove everything related to
  the generated version file from here.

* source/CMakeLists.txt: On Darwin, add the generated version
  file to the sources that make up lldbBase.  Also, create a
  custom target and make lldbBase depend on it to re-generate
  the generated file as needed.

* source/API/CMakeLists.txt: Don't need to build the generated
  version file here or use it to control linking against swig_wrapper.

* tools/lldb-server/CMakeLists.txt: Likewise.

Reviewers: dawn, sas, clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 249806
2015-10-09 03:40:55 +00:00
Dawn Perchik b751bfb9bd [cmake] Fix cmake build on OSX after r249434.
Reviewed by: zturner
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D13535

llvm-svn: 249684
2015-10-08 12:35:21 +00:00
Chaoren Lin 6c85598c5a Fix Android build.
llvm-svn: 249486
2015-10-07 00:01:06 +00:00
Ryan Brown 702c4b865e Simple readline functionality for interactive python on linux.
Differential Revision: http://reviews.llvm.org/D13268

llvm-svn: 249478
2015-10-06 22:21:08 +00:00
Stephane Sezer d16d6c0046 Fix Darwin build of lldb-server.
Summary: We were missing the symbol for the version number.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 249434
2015-10-06 18:03:04 +00:00
Zachary Turner 3a00691f3d Move LLDB initialization/shutdown to Initialization.
This creates a new top-level folder called Initialization which
is intended to hold code specific to LLDB system initialization.
Currently this holds the Initialize() and Terminate() functions,
as well as the fatal error handler.

This provides a means to break the massive dependency cycle which
is caused by the fact that Debugger depends on Initialize and
Terminate which then depends on the entire LLDB project.  With
this structure, it will be possible for applications to invoke
lldb_private::Initialize() directly, and have that invoke
Debugger::Initialize.

llvm-svn: 232768
2015-03-19 22:00:21 +00:00
Zachary Turner 3294de270e Move lldb-log.cpp to core/Logging.cpp
So that we don't have to update every single #include in the entire
codebase to #include this new header (which used to get included by
lldb-private-log.h, we automatically #include "Logging.h" from
within "Log.h".

llvm-svn: 232653
2015-03-18 18:20:42 +00:00
Zachary Turner 799770c03a Fix linking of unit tests via CMake on Windows.
A previous attempt to make the unit tests link properly on
Linux broke it for Windows.  This patch fixes it for both platforms.

llvm-svn: 232648
2015-03-18 16:56:24 +00:00
Zachary Turner eeba1a896a [CMake] Make the unittests link against everything...
Sigh.  There's really not a good alternative until we decouple
python from lldb better.  The only way the build works right now
is by having every executable link against every LLDB library.
This causes implicit transitive link dependencies on the union
of everything that LLDB brings in.  Which means that if all we
want is one header file from interpreter, we have to bring in
everything, including everything that everything depends on,
which means python.

There's outstanding efforts to address this, but it's not yet
complete.  So until then, this is all we can do.

llvm-svn: 232287
2015-03-14 23:39:28 +00:00
Zachary Turner 030b8cb413 Resubmit "[CMake] Change lldbAPI to be a CMake OBJECT library."
This resubmits r230380.  The primary cause of the failure was
actually just a warning, which we can disable at the CMake level
in a followup patch on the LLVM side.  The other thing which was
actually an error on the bot should be able to be fixed with
a clean.

llvm-svn: 230389
2015-02-24 22:17:57 +00:00
Zachary Turner 0980447a5f Revert "[CMake] Change lldbAPI to be a CMake OBJECT library."
This reverts commit r230380.  It causes CMake to fail on certain
machines with an error about needing to use string(STRIP_GENEX).

llvm-svn: 230382
2015-02-24 21:28:01 +00:00
Zachary Turner f4f8740eb0 [CMake] Change lldbAPI to be a CMake OBJECT library.
An OBJECT library is a special type of CMake library that produces
no archive, has no link interface, and no link inputs.  It is like
a regular archive, just without the physical output.  To link
against an OBJECT library, you reference it in the *source* file
list of a library using the special syntax $<TARGET_OBJECTS:lldbAPI>.
This will cause every object file to be passed to the linker
independently, as opposed to a single archive being passed to the
linker.

This is *extremely* important on Windows.  lldbAPI exports all of the
SB classes using __declspec(dllexport).  Unfortunately for technical
reasons it is not possible (well, extremely difficult) to get the
linker to propagate a __declspec(dllexport) attribute from a symbol
in an object file in an archive to a DLL that links against that
archive.  The solution to this is for the DLL to link the object files
directly.  So lldbAPI must be an OBJECT library.

This fixes an issue that has been present since the duplicated
lldbAPI file lists were removed, which would cause linker failures.

As a side effect, this also makes LLDB_DISABLE_PYTHON=1 work again
on Windows, which was previously totally broken.

llvm-svn: 230380
2015-02-24 20:58:39 +00:00
Zachary Turner d487bb12d9 [CMake] On Windows, require manual specification of python libs.
Embedding python with MSVC is very finicky, for reasons having
to do with the operating system's CRT, the implementation of
python itself on Windows, and even bugs in CMake.

One side effect of this is that we cannot rely on FindPythonLibs
and FindPythonInterp CMake functions to locate the correct
version of Python.  We must instead manually specify the location
of PYTHON_LIBRARY and PYTHON_INCLUDE_DIR.

As a side effect, this fixes building LLDB in release mode by
specifying -DCMAKE_BUILD_TYPE=Release, which was previously
broken.

llvm-svn: 230262
2015-02-23 21:20:59 +00:00
Zachary Turner a12920a414 [CMake] Remove debug message from CMakeLists.txt
llvm-svn: 229592
2015-02-18 00:27:11 +00:00
Zachary Turner aeda626d80 [CMake] Create a custom target for generating extension module.
Previously we would create the extension module as a post-build
step of creating liblldb.  As part of this process, we created
symlinks and did other stuff.

This had several longstanding issues related to target
dependencies, such as not re-creating the symlink if liblldb.dll
failed to link, or if the build was Ctrl+C'ed from.

Then, the script that creates the symlinks began to grow to
include other things, such as argdumper, and it would try to
create symlinks before it had finished building the targets it
needed to symlink to.

This patches addresses all of these problems by creating an
explicit target for the script to run, and making it have a
dependency on all the targets it needs to create symlinks from/to.

llvm-svn: 229569
2015-02-17 22:20:29 +00:00
Zachary Turner 7513e82075 Remove the CMake duplication for liblldb.
Previously the CMake had a lot of duplication for the public API
due to some differences regarding how we link on Windows.  This
fixes the issue, so making changes to the public API should be
much easier now.

llvm-svn: 229568
2015-02-17 22:20:20 +00:00
Zachary Turner 51f96eeb24 Revert "Revert "I had recently added a new SBFrame::GetVariables() overload with yet another bool argument""
Reverting this commit led to other failures which I did not see at
first.  This turned out to be an easy problem to fix, so I added
SBVariablesOptions.cpp to the CMakeLists.txt.  In the future please
try to make sure new files are added to CMake.

llvm-svn: 229516
2015-02-17 17:55:50 +00:00
Oleksiy Vyalov 71d08b3f2d Extract SBAttachInfo into own set of files - SBAttachInfo.h, SBAttachInfo.cpp and SBAttachInfo.i.
llvm-svn: 229346
2015-02-16 00:04:19 +00:00
Oleksiy Vyalov 1ef7b2c897 Extend SBPlatform with capability to launch/terminate a process remotely. Integrate this change into test framework in order to spawn processes on a remote target.
http://reviews.llvm.org/D7263

llvm-svn: 228230
2015-02-04 23:19:15 +00:00
Vince Harron 5275aaa0cc Moved Args::StringToXIntYZ to StringConvert::ToXIntYZ
The refactor was motivated by some comments that Greg made
http://reviews.llvm.org/D6918

and also to break a dependency cascade that caused functions linking
in string->int conversion functions to pull in most of lldb

llvm-svn: 226199
2015-01-15 20:08:35 +00:00
Vince Harron 4d2857321d Fixes compilation/run error with BUILD_SHARED_LIBS=TRUE
BUILD_SHARED_LIBS=TRUE currently isn't working for Linux x86_64
This patch fixes the link errors and also some runtime errors

Test Plan:
CC=clang CXX=clang++ cmake -GNinja -DBUILD_SHARED_LIBS=TRUE -DCMAKE_LINKER=ld.gold -DCMAKE_BUILD_TYPE=Debug ../../llvm
ninja
ninja check-lldb

llvm-svn: 226039
2015-01-14 21:01:15 +00:00
Chandler Carruth 875d3bb538 [cmake/multilib] Teach LLDB to respect the multlib LLVM_LIBDIR_SUFFIX
variable (now provided both by the normal parent LLVM CMake files and by
the LLVMConfig.cmake file used by the standalone build).

This allows LLDB to build into and install into correctly suffixed
libdirs. This is especially significant for LLDB because the python
extension building done by CMake directly uses multilib suffixes when
the host OS does, and the host OS will not always look back and forth
between them. As a consequence, before LLVM, Clang, and LLDB (and every
other subproject) had support for using LLVM_LIBDIR_SUFFIX, you couldn't
build or install LLDB on a multilib system with its python extensions
enabled. With this patch (on top of all the others I have submitted
throughout the project), I'm finally able to build and install LLDB on
my system with Python support enabled. I'm also able to actually run the
LLDB test suite, etc. Now, a *huge* number of the tests still fail on my
Linux system, but hey, actually running them and them testing the
debugger is a huge step forward. =D

llvm-svn: 224930
2014-12-29 12:42:33 +00:00
Zachary Turner d553d00c79 Disable Editline on Windows.
Editline does not work correctly on Windows.  This goes back at
least to r208369, and as a result r210105 was submitted to disable
libedit at runtime on Windows.

More recently, r222163 was submitted which re-writes editline
entirely, but makes the situation even worse on Windows, to the
point that it doesn't even compile.  While it would be easy to
fix the compilation failure, this patch simply stops compiling
Editline entirely on Windows, as the simple compilation fix would
still result in a broken use of select on Windows, and as such a
broken implementation of Editline.

Since Editline was already disabled to begin with on Windows, we
don't attempt to fix the compilation failure or the underlying
issues, and instead just disable it "even more".

llvm-svn: 222177
2014-11-17 21:31:18 +00:00
Shawn Best 8da0bf3b7c LLGS Android target support - for Andy Chien : http://reviews.llvm.org/D6166
llvm-svn: 221570
2014-11-08 01:41:49 +00:00
Justin Hibbits 6256a0ea8f First cut of PowerPC(64) support in LLDB.
Summary:
This adds preliminary support for PowerPC/PowerPC64, for FreeBSD.  There are
some issues still:

 * Breakpoints don't work well on powerpc64.
 * Shared libraries don't yet get loaded for a 32-bit process on powerpc64 host.
 * Backtraces don't work.  This is due to PowerPC ABI using a backchain pointer
   in memory, instead of a dedicated frame pointer register for the backchain.
 * Breakpoints on functions without debug info may not work correctly for 32-bit
   powerpc.

Reviewers: emaste, tfiala, jingham, clayborg

Reviewed By: clayborg

Subscribers: emaste, lldb-commits

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

llvm-svn: 220944
2014-10-31 02:34:28 +00:00
Eric Christopher e709821359 Fix the build after the recent plugin additions for
AddressSanitizer by adding dependencies and definitions.

llvm-svn: 219554
2014-10-11 00:38:55 +00:00
Jim Ingham 5346f884da Add SBExecutionContext.cpp to this file as well, as the comment
in source/API/CMakeLists.txt instructs...

llvm-svn: 218837
2014-10-01 22:26:52 +00:00
Jim Ingham 8d81bdf11f Add SBThreadPlan to this CMakeLists.txt as well.
llvm-svn: 218687
2014-09-30 17:11:53 +00:00
Deepak Panickal 7337ae55fa Fix OSX CMake build
llvm-svn: 217667
2014-09-12 12:15:11 +00:00
Zachary Turner 40a069adcd Fix Windows build.
* ssize_t isn't defined by default on Windows.
* New public API files need to be defined in a different file for
  Windows.

llvm-svn: 217624
2014-09-11 20:26:49 +00:00
Kuba Brecka beed821ffb ASan malloc/free history threads
Reviewed at http://reviews.llvm.org/D4596

llvm-svn: 217116
2014-09-04 01:03:18 +00:00
Reid Kleckner 634ff8ec04 Remove the JIT from LLDB's dependencies to fix the build
llvm-svn: 217002
2014-09-03 00:35:03 +00:00
Zachary Turner cfe910b9d4 Fix a CMake error when using CMake 3.0.1
llvm-svn: 216286
2014-08-22 20:44:55 +00:00
Zachary Turner 4ec5d0d0e1 In the CMake build, convert lldbHost to be a single static library.
Previously lldbHost was built as multiple static libraries such as
lldbHostCommon, lldbHostLinux, etc.  With this patch, the CMake
build produces only a single static library, lldbHost, whose file
set is dynamically created based on the platform.

llvm-svn: 215792
2014-08-15 23:50:36 +00:00
Zachary Turner c00cf4a068 Move FileSystem functions out of Host and into their own classes.
More specifically, this change can be summarized as follows:
1) Makes an lldbHostPosix library which contains code common to
   all posix platforms.
2) Creates Host/FileSystem.h which defines a common FileSystem
   interface.
3) Implements FileSystem.h in Host/windows and Host/posix.
4) Creates Host/FileCache.h, implemented in Host/common, which
   defines a class useful for storing handles to open files needed
   by the debugger.

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

llvm-svn: 215775
2014-08-15 22:04:21 +00:00
Zachary Turner d867520d0b Revert "Fix the build broken as a result of deleting jit from LLVM."
jit was re-added back to LLVM, so now we require to link against it
again.  Should it get removed again, then revert this revert.

llvm-svn: 215170
2014-08-07 23:26:01 +00:00
Zachary Turner c349434010 Fix the build broken as a result of deleting jit from LLVM.
llvm-svn: 215119
2014-08-07 16:50:45 +00:00
Zachary Turner 35ed13262d Teach LLDB about Windows processes.
This patch creates a simple ProcessWindows process plugin.
The only thing it knows how to do currently is create processes.

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

llvm-svn: 214094
2014-07-28 16:45:18 +00:00
Saleem Abdulrasool 0fb2f5d0f9 build: silence GCC warning on Linux
LLDWrapPython.cpp is a generated file.  This contains a double assignment to the
same value, which causes GCC to emit a warning about sequence point evaluation
causing a use-before-init.  Simply silence the warning.

llvm-svn: 213575
2014-07-21 18:18:52 +00:00
Deepak Panickal 5780657be8 Update CMakeLists.txt and Makefiles for building/linking the Hexagon ABI and Dynamic Loader
llvm-svn: 213568
2014-07-21 17:24:05 +00:00
Zachary Turner 37373b0c98 Remove spurious debugging message from CMake.
llvm-svn: 213553
2014-07-21 16:10:20 +00:00
Saleem Abdulrasool e1401eb747 build: fix cmake warning with newer CMake
Hoist the compatibility macros out a level and re-use them when adding link
dependencies.  Silences a warning from CMake.

llvm-svn: 213469
2014-07-20 05:28:55 +00:00
Zachary Turner 05c30880b6 Use the designated PYTHON_EXECUTABLE during build.
We were hardcoding "python" as the command to run the swig wrapper
scripts.  We should be using PYTHON_EXECUTABLE instead.

llvm-svn: 213354
2014-07-18 07:06:13 +00:00
Zachary Turner fa59e62012 Create an _d suffixed symlink when doing a debug Windows build.
_lldb is built as an extension module on Windows.  Normally to load
an extension module named 'foo', Python would look for the file
'foo.pyd'.  However, when a debug interpreter is used, Python will
look for the file 'foo_d.pyd'.  This change checks the build
configuration and creates the correct symlink name based on the
build configuration.

llvm-svn: 213306
2014-07-17 20:36:14 +00:00