9#ifndef LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACEINTELPTBUNDLELOADER_H
10#define LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACEINTELPTBUNDLELOADER_H
12#include "../common/ThreadPostMortemTrace.h"
16namespace trace_intel_pt {
25 std::vector<lldb::ThreadPostMortemTraceSP>
threads;
38 const llvm::json::Value &bundle_description,
39 llvm::StringRef bundle_dir)
53 llvm::Expected<lldb::TraceSP>
Load();
66 llvm::Expected<lldb::TraceSP>
68 std::vector<ParsedProcess> &parsed_processes);
72 llvm::StringRef triple);
86 llvm::Expected<ParsedProcess>
101 const llvm::json::Value &value);
105 llvm::Expected<std::vector<ParsedProcess>>
A class to manage flag bits.
A plug-in interface definition class for debugging a process.
llvm::Error AugmentThreadsFromContextSwitches(JSONTraceBundleDescription &bundle_description)
When applicable, augment the list of threads in the trace bundle by inspecting the context switch tra...
llvm::Expected< lldb::TraceSP > CreateTraceIntelPTInstance(JSONTraceBundleDescription &bundle_description, std::vector< ParsedProcess > &parsed_processes)
Given a bundle description and a list of fully parsed processes, create an actual Trace instance that...
void NormalizeAllPaths(JSONTraceBundleDescription &bundle_description)
Modifiy the bundle description by normalizing all the paths relative to the session file directory.
llvm::Expected< std::vector< ParsedProcess > > LoadBundle(const JSONTraceBundleDescription &bundle_description)
Create the corresponding Process, Thread and Module objects given this bundle description.
lldb::ThreadPostMortemTraceSP ParseThread(Process &process, const JSONThread &thread)
Create a post-mortem thread associated with the given process using the definition from thread.
llvm::Error CreateJSONError(llvm::json::Path::Root &root, const llvm::json::Value &value)
Create a user-friendly error message upon a JSON-parsing failure using the json::ObjectMapper functio...
llvm::Expected< lldb::TraceSP > Load()
Parse the trace bundle description and create the corresponding Target objects.
static llvm::StringRef GetSchema()
FileSpec NormalizePath(const std::string &path)
Resolve non-absolute paths relative to the bundle folder.
TraceIntelPTBundleLoader(Debugger &debugger, const llvm::json::Value &bundle_description, llvm::StringRef bundle_dir)
const std::string m_bundle_dir
const llvm::json::Value & m_bundle_description
llvm::Expected< ParsedProcess > CreateEmptyProcess(lldb::pid_t pid, llvm::StringRef triple)
Create an empty Process object with given pid and target.
llvm::Expected< ParsedProcess > ParseProcess(const JSONProcess &process)
Create the corresponding Threads and Process objects given the JSON process definition.
llvm::Expected< ParsedProcess > ParseKernel(const JSONTraceBundleDescription &bundle_description)
Create a kernel process and cpu threads given the JSON kernel definition.
llvm::Error ParseModule(Target &target, const JSONModule &module)
Create a module associated with the given target using the definition from module.
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ThreadPostMortemTrace > ThreadPostMortemTraceSP
std::shared_ptr< lldb_private::Target > TargetSP
Helper struct holding the objects created when parsing a process.
std::vector< lldb::ThreadPostMortemTraceSP > threads