summaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp')
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp25
1 files changed, 8 insertions, 17 deletions
diff --git a/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp b/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
index c93b39c953aa..48dbddb86cca 100644
--- a/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
@@ -1,4 +1,4 @@
-//===-- FreeBSDThread.cpp ---------------------------------------*- C++ -*-===//
+//===-- FreeBSDThread.cpp -------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -14,9 +14,6 @@
#include <sys/types.h>
#include <sys/user.h>
-#include "lldb/Target/UnixSignals.h"
-#include "lldb/Utility/State.h"
-
#include "FreeBSDThread.h"
#include "POSIXStopInfo.h"
#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
@@ -26,7 +23,6 @@
#include "Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.h"
#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h"
#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
-#include "Plugins/Process/Utility/UnwindLLDB.h"
#include "ProcessFreeBSD.h"
#include "ProcessMonitor.h"
#include "RegisterContextPOSIXProcessMonitor_arm.h"
@@ -44,6 +40,8 @@
#include "lldb/Target/StopInfo.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/ThreadSpec.h"
+#include "lldb/Target/UnixSignals.h"
+#include "lldb/Target/Unwind.h"
#include "lldb/Utility/State.h"
#include "llvm/ADT/SmallString.h"
@@ -163,9 +161,9 @@ lldb::RegisterContextSP FreeBSDThread::GetRegisterContext() {
RegisterInfoInterface *reg_interface = nullptr;
const ArchSpec &target_arch = GetProcess()->GetTarget().GetArchitecture();
+ assert(target_arch.GetTriple().getOS() == llvm::Triple::FreeBSD);
switch (target_arch.GetMachine()) {
case llvm::Triple::aarch64:
- reg_interface = new RegisterInfoPOSIX_arm64(target_arch);
break;
case llvm::Triple::arm:
reg_interface = new RegisterInfoPOSIX_arm(target_arch);
@@ -194,7 +192,8 @@ lldb::RegisterContextSP FreeBSDThread::GetRegisterContext() {
switch (target_arch.GetMachine()) {
case llvm::Triple::aarch64: {
RegisterContextPOSIXProcessMonitor_arm64 *reg_ctx =
- new RegisterContextPOSIXProcessMonitor_arm64(*this, 0, reg_interface);
+ new RegisterContextPOSIXProcessMonitor_arm64(
+ *this, std::make_unique<RegisterInfoPOSIX_arm64>(target_arch));
m_posix_thread = reg_ctx;
m_reg_context_sp.reset(reg_ctx);
break;
@@ -253,8 +252,7 @@ FreeBSDThread::CreateRegisterContextForFrame(lldb_private::StackFrame *frame) {
if (concrete_frame_idx == 0)
reg_ctx_sp = GetRegisterContext();
else {
- assert(GetUnwinder());
- reg_ctx_sp = GetUnwinder()->CreateRegisterContextForFrame(frame);
+ reg_ctx_sp = GetUnwinder().CreateRegisterContextForFrame(frame);
}
return reg_ctx_sp;
@@ -274,20 +272,13 @@ bool FreeBSDThread::CalculateStopInfo() {
return true;
}
-Unwind *FreeBSDThread::GetUnwinder() {
- if (!m_unwinder_up)
- m_unwinder_up.reset(new UnwindLLDB(*this));
-
- return m_unwinder_up.get();
-}
-
void FreeBSDThread::DidStop() {
// Don't set the thread state to stopped unless we really stopped.
}
void FreeBSDThread::WillResume(lldb::StateType resume_state) {
Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_THREAD));
- LLDB_LOGF(log, "tid %" PRIu64 " resume_state = %s", GetID(),
+ LLDB_LOGF(log, "tid %lu resume_state = %s", GetID(),
lldb_private::StateAsCString(resume_state));
ProcessSP process_sp(GetProcess());
ProcessFreeBSD *process = static_cast<ProcessFreeBSD *>(process_sp.get());