ThreadPostMortemTrace.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #ifndef LLDB_TARGET_THREADPOSTMORTEMTRACE_H
  9. #define LLDB_TARGET_THREADPOSTMORTEMTRACE_H
  10. #include "lldb/Target/Thread.h"
  11. namespace lldb_private {
  12. /// \class ThreadPostMortemTrace ThreadPostMortemTrace.h
  13. ///
  14. /// Thread implementation used for representing threads gotten from trace
  15. /// session files, which are similar to threads from core files.
  16. ///
  17. /// See \a TraceSessionFileParser for more information regarding trace session
  18. /// files.
  19. class ThreadPostMortemTrace : public Thread {
  20. public:
  21. /// \param[in] process
  22. /// The process who owns this thread.
  23. ///
  24. /// \param[in] tid
  25. /// The tid of this thread.
  26. ///
  27. /// \param[in] trace_file
  28. /// The file that contains the list of instructions that were traced when
  29. /// this thread was being executed.
  30. ThreadPostMortemTrace(Process &process, lldb::tid_t tid,
  31. const FileSpec &trace_file)
  32. : Thread(process, tid), m_trace_file(trace_file) {}
  33. void RefreshStateAfterStop() override;
  34. lldb::RegisterContextSP GetRegisterContext() override;
  35. lldb::RegisterContextSP
  36. CreateRegisterContextForFrame(StackFrame *frame) override;
  37. /// \return
  38. /// The trace file of this thread.
  39. const FileSpec &GetTraceFile() const;
  40. protected:
  41. bool CalculateStopInfo() override;
  42. lldb::RegisterContextSP m_thread_reg_ctx_sp;
  43. private:
  44. FileSpec m_trace_file;
  45. };
  46. } // namespace lldb_private
  47. #endif // LLDB_TARGET_THREADPOSTMORTEMTRACE_H