brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 39f53fe Raw
60 lines · c
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-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLDB_TARGET_THREADPOSTMORTEMTRACE_H10#define LLDB_TARGET_THREADPOSTMORTEMTRACE_H11 12#include "lldb/Target/Thread.h"13#include <optional>14 15namespace lldb_private {16 17/// \class ThreadPostMortemTrace ThreadPostMortemTrace.h18///19/// Thread implementation used for representing threads gotten from trace20/// session files, which are similar to threads from core files.21///22class ThreadPostMortemTrace : public Thread {23public:24  /// \param[in] process25  ///     The process who owns this thread.26  ///27  /// \param[in] tid28  ///     The tid of this thread.29  ///30  /// \param[in] trace_file31  ///     The file that contains the list of instructions that were traced when32  ///     this thread was being executed.33  ThreadPostMortemTrace(Process &process, lldb::tid_t tid,34                        const std::optional<FileSpec> &trace_file)35      : Thread(process, tid), m_trace_file(trace_file) {}36 37  void RefreshStateAfterStop() override;38 39  lldb::RegisterContextSP GetRegisterContext() override;40 41  lldb::RegisterContextSP42  CreateRegisterContextForFrame(StackFrame *frame) override;43 44  /// \return45  ///   The trace file of this thread.46  const std::optional<FileSpec> &GetTraceFile() const;47 48protected:49  bool CalculateStopInfo() override;50 51  lldb::RegisterContextSP m_thread_reg_ctx_sp;52 53private:54  std::optional<FileSpec> m_trace_file;55};56 57} // namespace lldb_private58 59#endif // LLDB_TARGET_THREADPOSTMORTEMTRACE_H60