LLDB mainline
ThreadPostMortemTrace.h
Go to the documentation of this file.
1//===-- ThreadPostMortemTrace.h ---------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_TARGET_THREADPOSTMORTEMTRACE_H
10#define LLDB_TARGET_THREADPOSTMORTEMTRACE_H
11
12#include "lldb/Target/Thread.h"
13#include <optional>
14
15namespace lldb_private {
16
17/// \class ThreadPostMortemTrace ThreadPostMortemTrace.h
18///
19/// Thread implementation used for representing threads gotten from trace
20/// session files, which are similar to threads from core files.
21///
23public:
24 /// \param[in] process
25 /// The process who owns this thread.
26 ///
27 /// \param[in] tid
28 /// The tid of this thread.
29 ///
30 /// \param[in] trace_file
31 /// The file that contains the list of instructions that were traced when
32 /// this thread was being executed.
34 const std::optional<FileSpec> &trace_file)
35 : Thread(process, tid), m_trace_file(trace_file) {}
36
37 void RefreshStateAfterStop() override;
38
40
43
44 /// \return
45 /// The trace file of this thread.
46 const std::optional<FileSpec> &GetTraceFile() const;
47
48protected:
49 bool CalculateStopInfo() override;
50
52
53private:
54 std::optional<FileSpec> m_trace_file;
55};
56
57} // namespace lldb_private
58
59#endif // LLDB_TARGET_THREADPOSTMORTEMTRACE_H
A plug-in interface definition class for debugging a process.
Definition: Process.h:341
This base class provides an interface to stack frames.
Definition: StackFrame.h:43
Thread implementation used for representing threads gotten from trace session files,...
bool CalculateStopInfo() override
Ask the thread subclass to set its stop info.
ThreadPostMortemTrace(Process &process, lldb::tid_t tid, const std::optional< FileSpec > &trace_file)
lldb::RegisterContextSP GetRegisterContext() override
lldb::RegisterContextSP m_thread_reg_ctx_sp
lldb::RegisterContextSP CreateRegisterContextForFrame(StackFrame *frame) override
const std::optional< FileSpec > & GetTraceFile() const
std::optional< FileSpec > m_trace_file
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::RegisterContext > RegisterContextSP
Definition: lldb-forward.h:392
uint64_t tid_t
Definition: lldb-types.h:84