blob: 37edddabbf0a4168e3edf49bbbc5958b46e423fd [file] [log] [blame]
Adrian McCarthyc96516f2015-08-03 23:01:51 +00001//===-- ThreadWinMiniDump.cpp -----------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "ThreadWinMiniDump.h"
11
12// Windows includes
13#include "lldb/Host/windows/windows.h"
14#include <DbgHelp.h>
15
16#include "ProcessWinMiniDump.h"
17#include "RegisterContextWindowsMiniDump.h"
18
19using namespace lldb;
20using namespace lldb_private;
21
22// This is a minimal implementation in order to get something running. It will
23// be fleshed out as more mini-dump functionality is added.
24
25ThreadWinMiniDump::ThreadWinMiniDump(lldb_private::Process &process, lldb::tid_t tid) :
26 Thread(process, tid),
27 m_thread_name()
28{
29}
30
31ThreadWinMiniDump::~ThreadWinMiniDump()
32{
33}
34
35void
36ThreadWinMiniDump::RefreshStateAfterStop()
37{
38}
39
40lldb::RegisterContextSP
41ThreadWinMiniDump::GetRegisterContext()
42{
43 if (m_reg_context_sp.get() == NULL) {
44 m_reg_context_sp = CreateRegisterContextForFrame (NULL);
45 }
46 return m_reg_context_sp;
47}
48
49lldb::RegisterContextSP
50ThreadWinMiniDump::CreateRegisterContextForFrame(lldb_private::StackFrame *frame)
51{
52 const uint32_t concrete_frame_idx = (frame) ? frame->GetConcreteFrameIndex() : 0;
53 RegisterContextSP reg_ctx_sp(new RegisterContextWindowsMiniDump(*this, concrete_frame_idx));
54 return reg_ctx_sp;
55}
56
57void
58ThreadWinMiniDump::ClearStackFrames()
59{
60}
61
62const char *
63ThreadWinMiniDump::GetName()
64{
65 return m_thread_name.empty() ? nullptr : m_thread_name.c_str();
66}
67
68void
69ThreadWinMiniDump::SetName(const char *name)
70{
71 if (name && name[0])
72 m_thread_name.assign(name);
73 else
74 m_thread_name.clear();
75}
76
77bool ThreadWinMiniDump::CalculateStopInfo()
78{
79 return false;
80}