blob: 346f36a737d72b8515f455d87a663eed2a4f7353 [file] [log] [blame]
Walter Erquinigo8a203bb2020-10-14 10:25:39 -07001//===-- ThreadTrace.cpp ---------------------------------------------------===//
Walter Erquinigoea1f4972020-10-03 12:23:12 -07002//
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
Walter Erquinigo8a203bb2020-10-14 10:25:39 -07009#include "lldb/Target/ThreadTrace.h"
Walter Erquinigoea1f4972020-10-03 12:23:12 -070010
11#include <memory>
12
13#include "Plugins/Process/Utility/RegisterContextHistory.h"
14#include "lldb/Target/Process.h"
15#include "lldb/Target/RegisterContext.h"
16
17using namespace lldb;
18using namespace lldb_private;
Walter Erquinigoea1f4972020-10-03 12:23:12 -070019
Walter Erquinigo8a203bb2020-10-14 10:25:39 -070020void ThreadTrace::RefreshStateAfterStop() {}
Walter Erquinigoea1f4972020-10-03 12:23:12 -070021
Walter Erquinigo8a203bb2020-10-14 10:25:39 -070022RegisterContextSP ThreadTrace::GetRegisterContext() {
Walter Erquinigoea1f4972020-10-03 12:23:12 -070023 if (!m_reg_context_sp)
24 m_reg_context_sp = CreateRegisterContextForFrame(nullptr);
25
26 return m_reg_context_sp;
27}
28
29RegisterContextSP
Walter Erquinigo8a203bb2020-10-14 10:25:39 -070030ThreadTrace::CreateRegisterContextForFrame(StackFrame *frame) {
Walter Erquinigoea1f4972020-10-03 12:23:12 -070031 // Eventually this will calculate the register context based on the current
32 // trace position.
33 return std::make_shared<RegisterContextHistory>(
34 *this, 0, GetProcess()->GetAddressByteSize(), LLDB_INVALID_ADDRESS);
35}
36
Walter Erquinigo8a203bb2020-10-14 10:25:39 -070037bool ThreadTrace::CalculateStopInfo() { return false; }
38
39const FileSpec &ThreadTrace::GetTraceFile() const { return m_trace_file; }