1//===-- ThreadPostMortemTrace.cpp -----------------------------------------===//
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#include "ThreadPostMortemTrace.h"
10
11#include <memory>
12#include <optional>
13
14#include "Plugins/Process/Utility/RegisterContextHistory.h"
15#include "lldb/Target/Process.h"
16#include "lldb/Target/RegisterContext.h"
17
18using namespace lldb;
19using namespace lldb_private;
20using namespace llvm;
21
22void ThreadPostMortemTrace::RefreshStateAfterStop() {}
23
24RegisterContextSP ThreadPostMortemTrace::GetRegisterContext() {
25 if (!m_reg_context_sp)
26 m_reg_context_sp = CreateRegisterContextForFrame(frame: nullptr);
27
28 return m_reg_context_sp;
29}
30
31RegisterContextSP
32ThreadPostMortemTrace::CreateRegisterContextForFrame(StackFrame *frame) {
33 // Eventually this will calculate the register context based on the current
34 // trace position.
35 return std::make_shared<RegisterContextHistory>(
36 args&: *this, args: 0, args: GetProcess()->GetAddressByteSize(), LLDB_INVALID_ADDRESS);
37}
38
39bool ThreadPostMortemTrace::CalculateStopInfo() { return false; }
40
41const std::optional<FileSpec> &ThreadPostMortemTrace::GetTraceFile() const {
42 return m_trace_file;
43}
44

source code of lldb/source/Plugins/Trace/common/ThreadPostMortemTrace.cpp