Walter Erquinigo | 8a203bb | 2020-10-14 10:25:39 -0700 | [diff] [blame] | 1 | //===-- ThreadTrace.cpp ---------------------------------------------------===// |
Walter Erquinigo | ea1f497 | 2020-10-03 12:23:12 -0700 | [diff] [blame] | 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 | |
Walter Erquinigo | 8a203bb | 2020-10-14 10:25:39 -0700 | [diff] [blame] | 9 | #include "lldb/Target/ThreadTrace.h" |
Walter Erquinigo | ea1f497 | 2020-10-03 12:23:12 -0700 | [diff] [blame] | 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; |
Walter Erquinigo | ea1f497 | 2020-10-03 12:23:12 -0700 | [diff] [blame] | 19 | |
Walter Erquinigo | 8a203bb | 2020-10-14 10:25:39 -0700 | [diff] [blame] | 20 | void ThreadTrace::RefreshStateAfterStop() {} |
Walter Erquinigo | ea1f497 | 2020-10-03 12:23:12 -0700 | [diff] [blame] | 21 | |
Walter Erquinigo | 8a203bb | 2020-10-14 10:25:39 -0700 | [diff] [blame] | 22 | RegisterContextSP ThreadTrace::GetRegisterContext() { |
Walter Erquinigo | ea1f497 | 2020-10-03 12:23:12 -0700 | [diff] [blame] | 23 | if (!m_reg_context_sp) |
| 24 | m_reg_context_sp = CreateRegisterContextForFrame(nullptr); |
| 25 | |
| 26 | return m_reg_context_sp; |
| 27 | } |
| 28 | |
| 29 | RegisterContextSP |
Walter Erquinigo | 8a203bb | 2020-10-14 10:25:39 -0700 | [diff] [blame] | 30 | ThreadTrace::CreateRegisterContextForFrame(StackFrame *frame) { |
Walter Erquinigo | ea1f497 | 2020-10-03 12:23:12 -0700 | [diff] [blame] | 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 | |
Walter Erquinigo | 8a203bb | 2020-10-14 10:25:39 -0700 | [diff] [blame] | 37 | bool ThreadTrace::CalculateStopInfo() { return false; } |
| 38 | |
| 39 | const FileSpec &ThreadTrace::GetTraceFile() const { return m_trace_file; } |