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 18 using namespace lldb; 19 using namespace lldb_private; 20 using namespace llvm; 21 RefreshStateAfterStop()22void ThreadPostMortemTrace::RefreshStateAfterStop() {} 23 GetRegisterContext()24RegisterContextSP ThreadPostMortemTrace::GetRegisterContext() { 25 if (!m_reg_context_sp) 26 m_reg_context_sp = CreateRegisterContextForFrame(nullptr); 27 28 return m_reg_context_sp; 29 } 30 31 RegisterContextSP CreateRegisterContextForFrame(StackFrame * frame)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 *this, 0, GetProcess()->GetAddressByteSize(), LLDB_INVALID_ADDRESS); 37 } 38 CalculateStopInfo()39bool ThreadPostMortemTrace::CalculateStopInfo() { return false; } 40 GetTraceFile() const41const std::optional<FileSpec> &ThreadPostMortemTrace::GetTraceFile() const { 42 return m_trace_file; 43 } 44