hanchenye-llvm-project/lldb/tools/intel-features
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
..
intel-mpx
intel-pt
scripts
CMakeLists.txt Fix LLVM_LINK_LLVM_DYLIB build (pr35053) 2017-10-31 13:23:19 +00:00
README.txt
cli-wrapper.cpp

README.txt

****************************************************************************
*                            README                                        *
*                                                                          *
* This file provides all the information regarding new CLI commands that   *
* enable using various hardware features of Intel(R) architecture based    *
* processors from LLDB's CLI.                                              *
****************************************************************************


============
Introduction
============
A shared library has been developed to use various hardware features of
Intel(R) architecture based processors through LLDB's command line. The library
currently comprises of hardware features namely Intel(R) Processor Trace and
Intel(R) Memory Protection Extensions.


============
Details
============
A C++ based cli wrapper (cli-wrapper.cpp) has been developed here that
agglomerates all cli commands for various hardware features. This wrapper is
build to generate a shared library (lldbIntelFeatures) to provide all these
commands.

For each hardware feature, separate cli commands have been developed that are
provided by wrappers (cli-wrapper-pt.cpp and cli-wrapper-mpxtable.cpp) residing
in feature specific folders ("intel-pt" and "intel-mpx" respectively).

For details regarding cli commands of each feature, please refer to these
feature specific wrappers.



============
How to Build
============
The shared library (lldbIntelFeatures) has a cmake based build and can be built
while building LLDB with cmake. "cli-wrapper.cpp" file is compiled along with all
the feature specific source files (residing in feature specific folders).

Furthermore, flexibility is provided to the user to include/exclude a particular
feature while building lldbIntelFeatures library. This is done by flags described
below:

  - LLDB_BUILD_INTEL_PT - The flag enables building of Intel(R) Processor Trace
    feature (inside intel-pt folder). This flag defaults to "OFF" meaning the
    feature is excluded while building lldbIntelFeatures library. Set it to "ON"
    in order to include it.

  - LLDB_BUILD_INTEL_MPX - Enables building Intel(R) Memory Protection Extensions
    feature (inside intel-mpx folder). This flag defaults to "ON" meaning
    the feature is excluded while building lldbIntelFeatures library.

Please refer to README files in feature specific folders to know about additional
flags that need to be set in order to build that feature successfully.


============
How to Use
============
All CLI commands provided by this shared library can be used through the LLDB's
CLI by executing "plugin load <shared_lib_name>" on LLDB CLI. shared_lib_name here
is lldbIntelFeatures



============
Description
============
Please refer to README_CLI file of each feature to know about details of CLI
commands.