1 //===-- ThreadTrace.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 "lldb/Target/ThreadTrace.h" 10 11 #include <memory> 12 13 #include "Plugins/Process/Utility/RegisterContextHistory.h" 14 #include "lldb/Target/Process.h" 15 #include "lldb/Target/RegisterContext.h" 16 17 using namespace lldb; 18 using namespace lldb_private; 19 RefreshStateAfterStop()20void ThreadTrace::RefreshStateAfterStop() {} 21 GetRegisterContext()22RegisterContextSP ThreadTrace::GetRegisterContext() { 23 if (!m_reg_context_sp) 24 m_reg_context_sp = CreateRegisterContextForFrame(nullptr); 25 26 return m_reg_context_sp; 27 } 28 29 RegisterContextSP CreateRegisterContextForFrame(StackFrame * frame)30ThreadTrace::CreateRegisterContextForFrame(StackFrame *frame) { 31 // 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 CalculateStopInfo()37bool ThreadTrace::CalculateStopInfo() { return false; } 38 GetTraceFile() const39const FileSpec &ThreadTrace::GetTraceFile() const { return m_trace_file; } 40