diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 | 
| commit | cfca06d7963fa0909f90483b42a6d7d194d01e08 (patch) | |
| tree | 209fb2a2d68f8f277793fc8df46c753d31bc853b /lldb/source/Plugins/Process/FreeBSD | |
| parent | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff) | |
Notes
Diffstat (limited to 'lldb/source/Plugins/Process/FreeBSD')
11 files changed, 25 insertions, 35 deletions
diff --git a/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp b/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp index 0a49f96f54a11..48dbddb86cca3 100644 --- a/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp +++ b/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" @@ -166,7 +164,6 @@ lldb::RegisterContextSP FreeBSDThread::GetRegisterContext() {      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); @@ -195,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; @@ -254,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; @@ -275,13 +272,6 @@ 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.  } diff --git a/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h b/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h index 6d3c253a519e6..774ffb511bc65 100644 --- a/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h +++ b/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h @@ -102,8 +102,6 @@ protected:    void ExitNotify(const ProcessMessage &message);    void ExecNotify(const ProcessMessage &message); -  lldb_private::Unwind *GetUnwinder() override; -    // FreeBSDThread internal API.    // POSIXThread override diff --git a/lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.cpp b/lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.cpp index 71f012944a9a8..4e6f3afda0ab8 100644 --- a/lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.cpp @@ -1,4 +1,4 @@ -//===-- POSIXStopInfo.cpp ---------------------------------------*- C++ -*-===// +//===-- POSIXStopInfo.cpp -------------------------------------------------===//  //  // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.  // See https://llvm.org/LICENSE.txt for license information. diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp index 32e3320150f83..a44080640f6c4 100644 --- a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp @@ -1,5 +1,4 @@ -//===-- ProcessFreeBSD.cpp ----------------------------------------*- C++ -//-*-===// +//===-- ProcessFreeBSD.cpp ------------------------------------------------===//  //  // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.  // See https://llvm.org/LICENSE.txt for license information. @@ -57,6 +56,8 @@  using namespace lldb;  using namespace lldb_private; +LLDB_PLUGIN_DEFINE(ProcessFreeBSD) +  namespace {  UnixSignalsSP &GetFreeBSDSignals() {    static UnixSignalsSP s_freebsd_signals_sp(new FreeBSDSignals()); @@ -379,7 +380,8 @@ Status ProcessFreeBSD::DoLaunch(Module *module,    FileSpec stdout_file_spec{};    FileSpec stderr_file_spec{}; -  const FileSpec dbg_pts_file_spec{launch_info.GetPTY().GetSlaveName(NULL, 0)}; +  const FileSpec dbg_pts_file_spec{ +      launch_info.GetPTY().GetSecondaryName(NULL, 0)};    file_action = launch_info.GetFileActionForFD(STDIN_FILENO);    stdin_file_spec = diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp index ff3fb0a75e2d0..6a9209d1214c1 100644 --- a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp @@ -1,4 +1,4 @@ -//===-- ProcessMonitor.cpp ------------------------------------ -*- C++ -*-===// +//===-- ProcessMonitor.cpp ------------------------------------------------===//  //  // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.  // See https://llvm.org/LICENSE.txt for license information. @@ -855,7 +855,7 @@ bool ProcessMonitor::Launch(LaunchArgs *args) {      // terminal has already dupped the tty descriptors to stdin/out/err. This      // closes original fd from which they were copied (and avoids leaking      // descriptors to the debugged process. -    terminal.CloseSlaveFileDescriptor(); +    terminal.CloseSecondaryFileDescriptor();      // Do not inherit setgid powers.      if (setgid(getgid()) != 0) @@ -939,7 +939,7 @@ bool ProcessMonitor::Launch(LaunchArgs *args) {  #endif    // Release the master terminal descriptor and pass it off to the    // ProcessMonitor instance.  Similarly stash the inferior pid. -  monitor->m_terminal_fd = terminal.ReleaseMasterFileDescriptor(); +  monitor->m_terminal_fd = terminal.ReleasePrimaryFileDescriptor();    monitor->m_pid = pid;    // Set the terminal fd to be in non blocking mode (it simplifies the diff --git a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp index f0c4526357cc6..4216f68faf5c6 100644 --- a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp @@ -1,4 +1,4 @@ -//===-- RegisterContextPOSIXProcessMonitor_arm.cpp -----------*- C++ -*-===// +//===-- RegisterContextPOSIXProcessMonitor_arm.cpp ------------------------===//  //  // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.  // See https://llvm.org/LICENSE.txt for license information. diff --git a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp index 147f4b56a8040..d3eafae1e6de4 100644 --- a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp @@ -1,4 +1,4 @@ -//===-- RegisterContextPOSIXProcessMonitor_arm64.cpp -----------*- C++ -*-===// +//===-- RegisterContextPOSIXProcessMonitor_arm64.cpp ----------------------===//  //  // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.  // See https://llvm.org/LICENSE.txt for license information. @@ -22,9 +22,9 @@ using namespace lldb_private;  RegisterContextPOSIXProcessMonitor_arm64::      RegisterContextPOSIXProcessMonitor_arm64( -        lldb_private::Thread &thread, uint32_t concrete_frame_idx, -        lldb_private::RegisterInfoInterface *register_info) -    : RegisterContextPOSIX_arm64(thread, concrete_frame_idx, register_info) {} +        lldb_private::Thread &thread, +        std::unique_ptr<RegisterInfoPOSIX_arm64> register_info) +    : RegisterContextPOSIX_arm64(thread, std::move(register_info)) {}  ProcessMonitor &RegisterContextPOSIXProcessMonitor_arm64::GetMonitor() {    lldb::ProcessSP base = CalculateProcess(); diff --git a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.h b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.h index d54d34e89cad2..f100d905e28fd 100644 --- a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.h +++ b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.h @@ -17,8 +17,8 @@ class RegisterContextPOSIXProcessMonitor_arm64        public POSIXBreakpointProtocol {  public:    RegisterContextPOSIXProcessMonitor_arm64( -      lldb_private::Thread &thread, uint32_t concrete_frame_idx, -      lldb_private::RegisterInfoInterface *register_info); +      lldb_private::Thread &thread, +      std::unique_ptr<RegisterInfoPOSIX_arm64> register_info);  protected:    bool ReadGPR(); diff --git a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_mips64.cpp b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_mips64.cpp index db9b5a6a038cb..23c76f234c8e3 100644 --- a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_mips64.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_mips64.cpp @@ -1,4 +1,4 @@ -//===-- RegisterContextPOSIXProcessMonitor_mips64.cpp -----------*- C++ -*-===// +//===-- RegisterContextPOSIXProcessMonitor_mips64.cpp ---------------------===//  //  // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.  // See https://llvm.org/LICENSE.txt for license information. diff --git a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.cpp b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.cpp index 77694733fa395..f8342775a81b0 100644 --- a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.cpp @@ -1,4 +1,4 @@ -//===-- RegisterContextPOSIXProcessMonitor_powerpc.cpp ----------*- C++ -*-===// +//===-- RegisterContextPOSIXProcessMonitor_powerpc.cpp --------------------===//  //  // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.  // See https://llvm.org/LICENSE.txt for license information. diff --git a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp index 3046d97f153c9..b1739e1e3bd88 100644 --- a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp @@ -1,4 +1,4 @@ -//===-- RegisterContextPOSIXProcessMonitor_x86.cpp --------------*- C++ -*-===// +//===-- RegisterContextPOSIXProcessMonitor_x86.cpp ------------------------===//  //  // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.  // See https://llvm.org/LICENSE.txt for license information.  | 
