summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/Utility/ThreadMemory.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-07-26 19:36:28 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-07-26 19:36:28 +0000
commitcfca06d7963fa0909f90483b42a6d7d194d01e08 (patch)
tree209fb2a2d68f8f277793fc8df46c753d31bc853b /lldb/source/Plugins/Process/Utility/ThreadMemory.cpp
parent706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff)
Notes
Diffstat (limited to 'lldb/source/Plugins/Process/Utility/ThreadMemory.cpp')
-rw-r--r--lldb/source/Plugins/Process/Utility/ThreadMemory.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/lldb/source/Plugins/Process/Utility/ThreadMemory.cpp b/lldb/source/Plugins/Process/Utility/ThreadMemory.cpp
index 80b04bb14f77a..7469e7633e71d 100644
--- a/lldb/source/Plugins/Process/Utility/ThreadMemory.cpp
+++ b/lldb/source/Plugins/Process/Utility/ThreadMemory.cpp
@@ -1,5 +1,4 @@
-//===-- ThreadMemory.cpp ----------------------------------------------*- C++
-//-*-===//
+//===-- ThreadMemory.cpp --------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -30,7 +29,8 @@ ThreadMemory::ThreadMemory(Process &process, lldb::tid_t tid,
llvm::StringRef name, llvm::StringRef queue,
lldb::addr_t register_data_addr)
: Thread(process, tid), m_backing_thread_sp(), m_thread_info_valobj_sp(),
- m_name(name), m_queue(queue), m_register_data_addr(register_data_addr) {}
+ m_name(std::string(name)), m_queue(std::string(queue)),
+ m_register_data_addr(register_data_addr) {}
ThreadMemory::~ThreadMemory() { DestroyThread(); }
@@ -54,20 +54,14 @@ RegisterContextSP ThreadMemory::GetRegisterContext() {
RegisterContextSP
ThreadMemory::CreateRegisterContextForFrame(StackFrame *frame) {
- RegisterContextSP reg_ctx_sp;
uint32_t concrete_frame_idx = 0;
if (frame)
concrete_frame_idx = frame->GetConcreteFrameIndex();
- if (concrete_frame_idx == 0) {
- reg_ctx_sp = GetRegisterContext();
- } else {
- Unwind *unwinder = GetUnwinder();
- if (unwinder != nullptr)
- reg_ctx_sp = unwinder->CreateRegisterContextForFrame(frame);
- }
- return reg_ctx_sp;
+ if (concrete_frame_idx == 0)
+ return GetRegisterContext();
+ return GetUnwinder().CreateRegisterContextForFrame(frame);
}
bool ThreadMemory::CalculateStopInfo() {