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 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 20 void ThreadPostMortemTrace::RefreshStateAfterStop() {} 21 22 RegisterContextSP ThreadPostMortemTrace::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 30 ThreadPostMortemTrace::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 37 bool ThreadPostMortemTrace::CalculateStopInfo() { return false; } 38 39 const FileSpec &ThreadPostMortemTrace::GetTraceFile() const { 40 return m_trace_file; 41 } 42