diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:52 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:52 +0000 |
commit | 5f29bb8a675e8f96452b632e7129113f7dec850e (patch) | |
tree | 3d3f2a0d3ad10872a4dcaba8ec8d1d20c87ab147 /source/Plugins/Process/Darwin | |
parent | 88c643b6fec27eec436c8d138fee6346e92337d6 (diff) |
Notes
Diffstat (limited to 'source/Plugins/Process/Darwin')
-rw-r--r-- | source/Plugins/Process/Darwin/CFBundle.cpp | 17 | ||||
-rw-r--r-- | source/Plugins/Process/Darwin/CFBundle.h | 9 | ||||
-rw-r--r-- | source/Plugins/Process/Darwin/CFString.cpp | 15 | ||||
-rw-r--r-- | source/Plugins/Process/Darwin/CFString.h | 9 | ||||
-rw-r--r-- | source/Plugins/Process/Darwin/CFUtils.h | 9 | ||||
-rw-r--r-- | source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp | 13 | ||||
-rw-r--r-- | source/Plugins/Process/Darwin/DarwinProcessLauncher.h | 13 | ||||
-rw-r--r-- | source/Plugins/Process/Darwin/LaunchFlavor.h | 7 | ||||
-rw-r--r-- | source/Plugins/Process/Darwin/MachException.cpp | 7 | ||||
-rw-r--r-- | source/Plugins/Process/Darwin/MachException.h | 7 | ||||
-rw-r--r-- | source/Plugins/Process/Darwin/NativeProcessDarwin.cpp | 25 | ||||
-rw-r--r-- | source/Plugins/Process/Darwin/NativeProcessDarwin.h | 35 | ||||
-rw-r--r-- | source/Plugins/Process/Darwin/NativeThreadDarwin.cpp | 13 | ||||
-rw-r--r-- | source/Plugins/Process/Darwin/NativeThreadDarwin.h | 25 | ||||
-rw-r--r-- | source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp | 9 | ||||
-rw-r--r-- | source/Plugins/Process/Darwin/NativeThreadListDarwin.h | 7 |
16 files changed, 62 insertions, 158 deletions
diff --git a/source/Plugins/Process/Darwin/CFBundle.cpp b/source/Plugins/Process/Darwin/CFBundle.cpp index 7b080e60cdb3a..3cdd2fa575e79 100644 --- a/source/Plugins/Process/Darwin/CFBundle.cpp +++ b/source/Plugins/Process/Darwin/CFBundle.cpp @@ -1,9 +1,8 @@ //===-- CFBundle.cpp --------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -14,37 +13,27 @@ #include "CFBundle.h" #include "CFString.h" -//---------------------------------------------------------------------- // CFBundle constructor -//---------------------------------------------------------------------- CFBundle::CFBundle(const char *path) : CFReleaser<CFBundleRef>(), m_bundle_url() { if (path && path[0]) SetPath(path); } -//---------------------------------------------------------------------- // CFBundle copy constructor -//---------------------------------------------------------------------- CFBundle::CFBundle(const CFBundle &rhs) : CFReleaser<CFBundleRef>(rhs), m_bundle_url(rhs.m_bundle_url) {} -//---------------------------------------------------------------------- // CFBundle copy constructor -//---------------------------------------------------------------------- CFBundle &CFBundle::operator=(const CFBundle &rhs) { *this = rhs; return *this; } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFBundle::~CFBundle() {} -//---------------------------------------------------------------------- // Set the path for a bundle by supplying a -//---------------------------------------------------------------------- bool CFBundle::SetPath(const char *path) { CFAllocatorRef alloc = kCFAllocatorDefault; // Release our old bundle and ULR diff --git a/source/Plugins/Process/Darwin/CFBundle.h b/source/Plugins/Process/Darwin/CFBundle.h index 09957af534b35..f49dc30f1f8f7 100644 --- a/source/Plugins/Process/Darwin/CFBundle.h +++ b/source/Plugins/Process/Darwin/CFBundle.h @@ -1,9 +1,8 @@ //===-- CFBundle.h ----------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -18,9 +17,7 @@ class CFBundle : public CFReleaser<CFBundleRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFBundle(const char *path = NULL); CFBundle(const CFBundle &rhs); CFBundle &operator=(const CFBundle &rhs); diff --git a/source/Plugins/Process/Darwin/CFString.cpp b/source/Plugins/Process/Darwin/CFString.cpp index b87afe9991816..4dcc05c866576 100644 --- a/source/Plugins/Process/Darwin/CFString.cpp +++ b/source/Plugins/Process/Darwin/CFString.cpp @@ -1,9 +1,8 @@ //===-- CFString.cpp --------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -15,19 +14,13 @@ #include <glob.h> #include <string> -//---------------------------------------------------------------------- // CFString constructor -//---------------------------------------------------------------------- CFString::CFString(CFStringRef s) : CFReleaser<CFStringRef>(s) {} -//---------------------------------------------------------------------- // CFString copy constructor -//---------------------------------------------------------------------- CFString::CFString(const CFString &rhs) : CFReleaser<CFStringRef>(rhs) {} -//---------------------------------------------------------------------- // CFString copy constructor -//---------------------------------------------------------------------- CFString &CFString::operator=(const CFString &rhs) { if (this != &rhs) *this = rhs; @@ -42,9 +35,7 @@ CFString::CFString(const char *cstr, CFStringEncoding cstr_encoding) } } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFString::~CFString() {} const char *CFString::GetFileSystemRepresentation(std::string &s) { diff --git a/source/Plugins/Process/Darwin/CFString.h b/source/Plugins/Process/Darwin/CFString.h index 18d60a5a74bd8..d1bd5682689e8 100644 --- a/source/Plugins/Process/Darwin/CFString.h +++ b/source/Plugins/Process/Darwin/CFString.h @@ -1,9 +1,8 @@ //===-- CFString.h ----------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -19,9 +18,7 @@ class CFString : public CFReleaser<CFStringRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFString(CFStringRef cf_str = NULL); CFString(const char *s, CFStringEncoding encoding = kCFStringEncodingUTF8); CFString(const CFString &rhs); diff --git a/source/Plugins/Process/Darwin/CFUtils.h b/source/Plugins/Process/Darwin/CFUtils.h index a904cd0ea6f07..b567524ce63a3 100644 --- a/source/Plugins/Process/Darwin/CFUtils.h +++ b/source/Plugins/Process/Darwin/CFUtils.h @@ -1,9 +1,8 @@ //===-- CFUtils.h -----------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -18,11 +17,9 @@ #ifdef __cplusplus -//---------------------------------------------------------------------- // Templatized CF helper class that can own any CF pointer and will // call CFRelease() on any valid pointer it owns unless that pointer is // explicitly released using the release() member function. -//---------------------------------------------------------------------- template <class T> class CFReleaser { public: // Type names for the avlue diff --git a/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp b/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp index 95659725ce2ec..3ec410fe7d768 100644 --- a/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp +++ b/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp @@ -1,9 +1,8 @@ //===-- DarwinProcessLauncher.cpp -------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -149,17 +148,13 @@ static Status ForkChildForPTraceDebugging(const char *path, char const *argv[], memset(fork_error, 0, sizeof(fork_error)); *pid = static_cast<::pid_t>(pty.Fork(fork_error, sizeof(fork_error))); if (*pid < 0) { - //-------------------------------------------------------------- // Status during fork. - //-------------------------------------------------------------- *pid = static_cast<::pid_t>(LLDB_INVALID_PROCESS_ID); error.SetErrorStringWithFormat("%s(): fork failed: %s", __FUNCTION__, fork_error); return error; } else if (pid == 0) { - //-------------------------------------------------------------- // Child process - //-------------------------------------------------------------- // Debug this process. ::ptrace(PT_TRACE_ME, 0, 0, 0); @@ -187,9 +182,7 @@ static Status ForkChildForPTraceDebugging(const char *path, char const *argv[], // call and if the exec fails it will exit the child process below. ::exit(127); } else { - //-------------------------------------------------------------- // Parent process - //-------------------------------------------------------------- // Let the child have its own process group. We need to execute this call // in both the child and parent to avoid a race condition between the two // processes. diff --git a/source/Plugins/Process/Darwin/DarwinProcessLauncher.h b/source/Plugins/Process/Darwin/DarwinProcessLauncher.h index a0e8ce5cb9dcd..0e65b56a143e0 100644 --- a/source/Plugins/Process/Darwin/DarwinProcessLauncher.h +++ b/source/Plugins/Process/Darwin/DarwinProcessLauncher.h @@ -1,9 +1,8 @@ //===-- DarwinProcessLauncher.h ---------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -28,15 +27,15 @@ namespace darwin_process_launcher { // ============================================================================= /// Launches a process for debugging. /// -/// @param[inout] launch_info +/// \param[inout] launch_info /// Specifies details about the process to launch (e.g. path, architecture, /// etc.). On output, includes the launched ProcessID (pid). /// -/// @param[out] pty_master_fd +/// \param[out] pty_master_fd /// Returns the master side of the pseudo-terminal used to communicate /// with stdin/stdout from the launched process. May be nullptr. /// -/// @param[out] launch_flavor +/// \param[out] launch_flavor /// Contains the launch flavor used when launching the process. // ============================================================================= Status diff --git a/source/Plugins/Process/Darwin/LaunchFlavor.h b/source/Plugins/Process/Darwin/LaunchFlavor.h index 7b161712cffdf..cfd76d1b9c3c2 100644 --- a/source/Plugins/Process/Darwin/LaunchFlavor.h +++ b/source/Plugins/Process/Darwin/LaunchFlavor.h @@ -1,9 +1,8 @@ //===-- LaunchFlavor.h ---------------------------------------- -*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/source/Plugins/Process/Darwin/MachException.cpp b/source/Plugins/Process/Darwin/MachException.cpp index 353f2df321395..70ad6736a7487 100644 --- a/source/Plugins/Process/Darwin/MachException.cpp +++ b/source/Plugins/Process/Darwin/MachException.cpp @@ -1,9 +1,8 @@ //===-- MachException.cpp ---------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/source/Plugins/Process/Darwin/MachException.h b/source/Plugins/Process/Darwin/MachException.h index 2da6a36a921e4..18e49173b0200 100644 --- a/source/Plugins/Process/Darwin/MachException.h +++ b/source/Plugins/Process/Darwin/MachException.h @@ -1,9 +1,8 @@ //===-- MachException.h -----------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp b/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp index 70d9a5248fd9d..fe7de27e0ee68 100644 --- a/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp +++ b/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp @@ -1,9 +1,8 @@ //===-- NativeProcessDarwin.cpp ---------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -38,9 +37,7 @@ using namespace lldb_private; using namespace lldb_private::process_darwin; using namespace lldb_private::darwin_process_launcher; -// ----------------------------------------------------------------------------- // Hidden Impl -// ----------------------------------------------------------------------------- namespace { struct hack_task_dyld_info { @@ -49,9 +46,7 @@ struct hack_task_dyld_info { }; } -// ----------------------------------------------------------------------------- // Public Static Methods -// ----------------------------------------------------------------------------- Status NativeProcessProtocol::Launch( ProcessLaunchInfo &launch_info, @@ -154,9 +149,7 @@ Status NativeProcessProtocol::Attach( return error; } -// ----------------------------------------------------------------------------- // ctor/dtor -// ----------------------------------------------------------------------------- NativeProcessDarwin::NativeProcessDarwin(lldb::pid_t pid, int pty_master_fd) : NativeProcessProtocol(pid), m_task(TASK_NULL), m_did_exec(false), @@ -171,23 +164,13 @@ NativeProcessDarwin::NativeProcessDarwin(lldb::pid_t pid, int pty_master_fd) NativeProcessDarwin::~NativeProcessDarwin() {} -// ----------------------------------------------------------------------------- // Instance methods -// ----------------------------------------------------------------------------- Status NativeProcessDarwin::FinalizeLaunch(LaunchFlavor launch_flavor, MainLoop &main_loop) { Status error; Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS)); -#if 0 - m_path = path; - size_t i; - char const *arg; - for (i=0; (arg = argv[i]) != NULL; i++) - m_args.push_back(arg); -#endif - error = StartExceptionThread(); if (!error.Success()) { if (log) @@ -1548,9 +1531,7 @@ Status NativeProcessDarwin::GetFileLoadAddress(const llvm::StringRef &file_name, return error; } -// ----------------------------------------------------------------- // NativeProcessProtocol protected interface -// ----------------------------------------------------------------- Status NativeProcessDarwin::GetSoftwareBreakpointTrapOpcode( size_t trap_opcode_size_hint, size_t &actual_opcode_size, const uint8_t *&trap_opcode_bytes) { diff --git a/source/Plugins/Process/Darwin/NativeProcessDarwin.h b/source/Plugins/Process/Darwin/NativeProcessDarwin.h index 9abdd5360eba5..6741d4ddc5d8f 100644 --- a/source/Plugins/Process/Darwin/NativeProcessDarwin.h +++ b/source/Plugins/Process/Darwin/NativeProcessDarwin.h @@ -1,9 +1,8 @@ //===-- NativeProcessDarwin.h --------------------------------- -*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -41,7 +40,7 @@ class Scalar; namespace process_darwin { -/// @class NativeProcessDarwin +/// \class NativeProcessDarwin /// Manages communication with the inferior (debugee) process. /// /// Upon construction, this class prepares and launches an inferior process @@ -60,9 +59,7 @@ class NativeProcessDarwin : public NativeProcessProtocol { public: ~NativeProcessDarwin() override; - // ----------------------------------------------------------------- // NativeProcessProtocol Interface - // ----------------------------------------------------------------- Status Resume(const ResumeActionList &resume_actions) override; Status Halt() override; @@ -113,9 +110,7 @@ public: task_t GetTask() const { return m_task; } - // ----------------------------------------------------------------- // Interface used by NativeRegisterContext-derived classes. - // ----------------------------------------------------------------- static Status PtraceWrapper(int req, lldb::pid_t pid, void *addr = nullptr, void *data = nullptr, size_t data_size = 0, long *result = nullptr); @@ -123,18 +118,14 @@ public: bool SupportHardwareSingleStepping() const; protected: - // ----------------------------------------------------------------- // NativeProcessProtocol protected interface - // ----------------------------------------------------------------- Status GetSoftwareBreakpointTrapOpcode(size_t trap_opcode_size_hint, size_t &actual_opcode_size, const uint8_t *&trap_opcode_bytes) override; private: - // ----------------------------------------------------------------- /// Mach task-related Member Variables - // ----------------------------------------------------------------- // The task port for the inferior process. mutable task_t m_task; @@ -146,9 +137,7 @@ private: // The CPU type of this process. mutable cpu_type_t m_cpu_type; - // ----------------------------------------------------------------- /// Exception/Signal Handling Member Variables - // ----------------------------------------------------------------- // Exception port on which we will receive child exceptions mach_port_t m_exception_port; @@ -176,15 +165,11 @@ private: // interrupt signal (if this is non-zero). int m_auto_resume_signo; - // ----------------------------------------------------------------- /// Thread-related Member Variables - // ----------------------------------------------------------------- NativeThreadListDarwin m_thread_list; ResumeActionList m_thread_actions; - // ----------------------------------------------------------------- /// Process Lifetime Member Variable - // ----------------------------------------------------------------- // The pipe over which the waitpid thread and the main loop will // communicate. @@ -196,12 +181,9 @@ private: // waitpid reader callback handle. MainLoop::ReadHandleUP m_waitpid_reader_handle; - // ----------------------------------------------------------------- // Private Instance Methods - // ----------------------------------------------------------------- NativeProcessDarwin(lldb::pid_t pid, int pty_master_fd); - // ----------------------------------------------------------------- /// Finalize the launch. /// /// This method associates the NativeProcessDarwin instance with the host @@ -209,19 +191,18 @@ private: /// listener to the inferior exception port, ptracing the process, and the /// like. /// - /// @param[in] launch_flavor + /// \param[in] launch_flavor /// The launch flavor that was used to launch the process. /// - /// @param[in] main_loop + /// \param[in] main_loop /// The main loop that will run the process monitor. Work /// that needs to be done (e.g. reading files) gets registered /// here along with callbacks to process the work. /// - /// @return + /// \return /// Any error that occurred during the aforementioned /// operations. Failure here will force termination of the /// launched process and debugging session. - // ----------------------------------------------------------------- Status FinalizeLaunch(LaunchFlavor launch_flavor, MainLoop &main_loop); Status SaveExceptionPortInfo(); @@ -318,7 +299,7 @@ private: Status FixupBreakpointPCAsNeeded(NativeThreadDarwin &thread); /// Writes a siginfo_t structure corresponding to the given thread - /// ID to the memory region pointed to by @p siginfo. + /// ID to the memory region pointed to by \p siginfo. Status GetSignalInfo(lldb::tid_t tid, void *siginfo); /// Writes the raw event message code (vis-a-vis PTRACE_GETEVENTMSG) diff --git a/source/Plugins/Process/Darwin/NativeThreadDarwin.cpp b/source/Plugins/Process/Darwin/NativeThreadDarwin.cpp index 521c6d5c8fd03..bcd6d8c2c4c1e 100644 --- a/source/Plugins/Process/Darwin/NativeThreadDarwin.cpp +++ b/source/Plugins/Process/Darwin/NativeThreadDarwin.cpp @@ -1,9 +1,8 @@ //===-- NativeThreadDarwin.cpp -------------------------------- -*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -139,7 +138,7 @@ bool NativeThreadDarwin::NotifyException(MachException::Data &exc) { // Allow the arch specific protocol to process (MachException::Data &)exc // first before possible reassignment of m_stop_exception with exc. See // also MachThread::GetStopException(). - bool handled = m_arch_ap->NotifyException(exc); + bool handled = m_arch_up->NotifyException(exc); if (m_stop_exception.IsValid()) { @@ -176,7 +175,7 @@ bool NativeThreadDarwin::ShouldStop(bool &step_more) const { } else { - if (m_arch_ap->StepNotComplete()) + if (m_arch_up->StepNotComplete()) { step_more = true; return false; @@ -218,7 +217,7 @@ void NativeThreadDarwin::ThreadDidStop() { // When this method gets called, the process state is still in the state it // was in while running so we can act accordingly. - m_arch_ap->ThreadDidStop(); + m_arch_up->ThreadDidStop(); // We may have suspended this thread so the primary thread could step diff --git a/source/Plugins/Process/Darwin/NativeThreadDarwin.h b/source/Plugins/Process/Darwin/NativeThreadDarwin.h index f66f8fe8738ca..616a9a7b9bf00 100644 --- a/source/Plugins/Process/Darwin/NativeThreadDarwin.h +++ b/source/Plugins/Process/Darwin/NativeThreadDarwin.h @@ -1,9 +1,8 @@ //===-- NativeThreadDarwin.h ---------------------------------- -*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -46,9 +45,7 @@ public: lldb::tid_t unique_thread_id = 0, ::thread_t mach_thread_port = 0); - // ----------------------------------------------------------------- // NativeThreadProtocol Interface - // ----------------------------------------------------------------- std::string GetName() override; lldb::StateType GetState() override; @@ -63,21 +60,17 @@ public: Status RemoveWatchpoint(lldb::addr_t addr) override; - // ----------------------------------------------------------------- // New methods that are fine for others to call. - // ----------------------------------------------------------------- void Dump(Stream &stream) const; private: - // ----------------------------------------------------------------- // Interface for friend classes - // ----------------------------------------------------------------- - /// Resumes the thread. If @p signo is anything but + /// Resumes the thread. If \p signo is anything but /// LLDB_INVALID_SIGNAL_NUMBER, deliver that signal to the thread. Status Resume(uint32_t signo); - /// Single steps the thread. If @p signo is anything but + /// Single steps the thread. If \p signo is anything but /// LLDB_INVALID_SIGNAL_NUMBER, deliver that signal to the thread. Status SingleStep(uint32_t signo); @@ -119,20 +112,16 @@ private: Status RequestStop(); - // ------------------------------------------------------------------------- /// Return the mach thread port number for this thread. /// - /// @return + /// \return /// The mach port number for this thread. Returns NULL_THREAD /// when the thread is invalid. - // ------------------------------------------------------------------------- thread_t GetMachPortNumber() const { return m_mach_thread_port; } static bool MachPortNumberIsValid(::thread_t thread); - // --------------------------------------------------------------------- // Private interface - // --------------------------------------------------------------------- bool GetIdentifierInfo(); void MaybeLogStateChange(lldb::StateType new_state); @@ -145,9 +134,7 @@ private: inline void MaybeCleanupSingleStepWorkaround(); - // ----------------------------------------------------------------- // Member Variables - // ----------------------------------------------------------------- // The mach thread port for the thread. ::thread_t m_mach_thread_port; diff --git a/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp b/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp index 4ff662e420972..89de92a6df4d1 100644 --- a/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp +++ b/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp @@ -1,10 +1,9 @@ //===-- NativeThreadListDarwin.cpp ------------------------------------*- C++ //-*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -549,7 +548,6 @@ uint32_t NativeThreadListDarwin::ProcessDidStop(NativeProcessDarwin &process) { return (uint32_t)m_threads.size(); } -//---------------------------------------------------------------------- // Check each thread in our thread list to see if we should notify our client // of the current halt in execution. // @@ -559,7 +557,6 @@ uint32_t NativeThreadListDarwin::ProcessDidStop(NativeProcessDarwin &process) { // RETURNS // true if we should stop and notify our clients // false if we should resume our child process and skip notification -//---------------------------------------------------------------------- bool NativeThreadListDarwin::ShouldStop(bool &step_more) { std::lock_guard<std::recursive_mutex> locker(m_threads_mutex); for (auto thread_sp : m_threads) { diff --git a/source/Plugins/Process/Darwin/NativeThreadListDarwin.h b/source/Plugins/Process/Darwin/NativeThreadListDarwin.h index 7b59afb96e958..9ab0a7c8c8023 100644 --- a/source/Plugins/Process/Darwin/NativeThreadListDarwin.h +++ b/source/Plugins/Process/Darwin/NativeThreadListDarwin.h @@ -1,10 +1,9 @@ //===-- NativeThreadListDarwin.h --------------------------------------*- C++ //-*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // |