[LLDB] Move Trace-specific classes into separate library

These two classes, TraceSessionFileParser and ThreadPostMortemTrace,
seem to be useful primarily for tracing. Currently it looks like
intel-pt is the sole user of these, but that other tracing plugins could
be written in the future that take advantage of these. Unfortunately
with them in Target, there is a dependency on PluginProcessUtility. I'd
like to sever that dependency, so I moved them into a `TraceCommon`
plugin.

Differential Revision: https://reviews.llvm.org/D105649
This commit is contained in:
Alex Langford
2021-07-07 11:51:16 -07:00
parent aa5adc0c1c
commit 8e6b31c395
10 changed files with 15 additions and 8 deletions

View File

@@ -230,7 +230,6 @@ class ThreadSpec;
class ThreadPostMortemTrace;
class Trace;
class TraceCursor;
class TraceSessionFileParser;
class Type;
class TypeAndOrName;
class TypeCategoryImpl;

View File

@@ -1,5 +1,7 @@
option(LLDB_BUILD_INTEL_PT "Enable Building of Intel(R) Processor Trace Tool" OFF)
add_subdirectory(common)
if (LLDB_BUILD_INTEL_PT)
add_subdirectory(intel-pt)
endif()

View File

@@ -0,0 +1,8 @@
add_lldb_library(lldbPluginTraceCommon
ThreadPostMortemTrace.cpp
TraceSessionFileParser.cpp
LINK_LIBS
lldbCore
lldbTarget
)

View File

@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
#include "lldb/Target/ThreadPostMortemTrace.h"
#include "ThreadPostMortemTrace.h"
#include <memory>

View File

@@ -6,7 +6,8 @@
//
//===----------------------------------------------------------------------===/
#include "lldb/Target/TraceSessionFileParser.h"
#include "TraceSessionFileParser.h"
#include "ThreadPostMortemTrace.h"
#include <sstream>
@@ -14,7 +15,6 @@
#include "lldb/Core/Module.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/ThreadPostMortemTrace.h"
using namespace lldb;
using namespace lldb_private;

View File

@@ -11,7 +11,7 @@
#include "llvm/Support/JSON.h"
#include "lldb/Target/ThreadPostMortemTrace.h"
#include "ThreadPostMortemTrace.h"
namespace lldb_private {

View File

@@ -25,6 +25,7 @@ add_lldb_library(lldbPluginTraceIntelPT PLUGIN
lldbCore
lldbSymbol
lldbTarget
lldbPluginTraceCommon
${LIBIPT_LIBRARY}
LINK_COMPONENTS
Support

View File

@@ -66,11 +66,9 @@ add_lldb_library(lldbTarget
ThreadPlanTracer.cpp
ThreadPlanStack.cpp
ThreadSpec.cpp
ThreadPostMortemTrace.cpp
Trace.cpp
TraceCursor.cpp
TraceInstructionDumper.cpp
TraceSessionFileParser.cpp
UnixSignals.cpp
UnwindAssembly.cpp
UnwindLLDB.cpp

View File

@@ -17,7 +17,6 @@
#include "lldb/Target/Process.h"
#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadPostMortemTrace.h"
#include "lldb/Utility/Stream.h"
using namespace lldb;