diff options
Diffstat (limited to 'lldb/source/Plugins/Process')
113 files changed, 0 insertions, 595 deletions
diff --git a/lldb/source/Plugins/Process/Darwin/CFBundle.cpp b/lldb/source/Plugins/Process/Darwin/CFBundle.cpp index 9bdc6f56199..3cdd2fa575e 100644 --- a/lldb/source/Plugins/Process/Darwin/CFBundle.cpp +++ b/lldb/source/Plugins/Process/Darwin/CFBundle.cpp @@ -13,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/lldb/source/Plugins/Process/Darwin/CFBundle.h b/lldb/source/Plugins/Process/Darwin/CFBundle.h index c56edee7a03..f49dc30f1f8 100644 --- a/lldb/source/Plugins/Process/Darwin/CFBundle.h +++ b/lldb/source/Plugins/Process/Darwin/CFBundle.h @@ -17,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/lldb/source/Plugins/Process/Darwin/CFString.cpp b/lldb/source/Plugins/Process/Darwin/CFString.cpp index 21b3a0427c6..4dcc05c8665 100644 --- a/lldb/source/Plugins/Process/Darwin/CFString.cpp +++ b/lldb/source/Plugins/Process/Darwin/CFString.cpp @@ -14,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; @@ -41,9 +35,7 @@ CFString::CFString(const char *cstr, CFStringEncoding cstr_encoding) } } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFString::~CFString() {} const char *CFString::GetFileSystemRepresentation(std::string &s) { diff --git a/lldb/source/Plugins/Process/Darwin/CFString.h b/lldb/source/Plugins/Process/Darwin/CFString.h index 47db507ce38..d1bd5682689 100644 --- a/lldb/source/Plugins/Process/Darwin/CFString.h +++ b/lldb/source/Plugins/Process/Darwin/CFString.h @@ -18,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/lldb/source/Plugins/Process/Darwin/CFUtils.h b/lldb/source/Plugins/Process/Darwin/CFUtils.h index 9dae40670f3..b567524ce63 100644 --- a/lldb/source/Plugins/Process/Darwin/CFUtils.h +++ b/lldb/source/Plugins/Process/Darwin/CFUtils.h @@ -17,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/lldb/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp b/lldb/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp index c72def37407..3ec410fe7d7 100644 --- a/lldb/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp +++ b/lldb/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp @@ -148,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); @@ -186,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/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp b/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp index 17116e819b3..1d7851d2dbe 100644 --- a/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp +++ b/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp @@ -37,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 { @@ -48,9 +46,7 @@ struct hack_task_dyld_info { }; } -// ----------------------------------------------------------------------------- // Public Static Methods -// ----------------------------------------------------------------------------- Status NativeProcessProtocol::Launch( ProcessLaunchInfo &launch_info, @@ -153,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), @@ -170,9 +164,7 @@ NativeProcessDarwin::NativeProcessDarwin(lldb::pid_t pid, int pty_master_fd) NativeProcessDarwin::~NativeProcessDarwin() {} -// ----------------------------------------------------------------------------- // Instance methods -// ----------------------------------------------------------------------------- Status NativeProcessDarwin::FinalizeLaunch(LaunchFlavor launch_flavor, MainLoop &main_loop) { @@ -1547,9 +1539,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/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.h b/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.h index 1b50a8c5cf8..6741d4ddc5d 100644 --- a/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.h +++ b/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.h @@ -59,9 +59,7 @@ class NativeProcessDarwin : public NativeProcessProtocol { public: ~NativeProcessDarwin() override; - // ----------------------------------------------------------------- // NativeProcessProtocol Interface - // ----------------------------------------------------------------- Status Resume(const ResumeActionList &resume_actions) override; Status Halt() override; @@ -112,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); @@ -122,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; @@ -145,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; @@ -175,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. @@ -195,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 @@ -220,7 +203,6 @@ private: /// 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(); diff --git a/lldb/source/Plugins/Process/Darwin/NativeThreadDarwin.h b/lldb/source/Plugins/Process/Darwin/NativeThreadDarwin.h index 9f53643ff71..616a9a7b9bf 100644 --- a/lldb/source/Plugins/Process/Darwin/NativeThreadDarwin.h +++ b/lldb/source/Plugins/Process/Darwin/NativeThreadDarwin.h @@ -45,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; @@ -62,15 +60,11 @@ 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 /// LLDB_INVALID_SIGNAL_NUMBER, deliver that signal to the thread. @@ -118,20 +112,16 @@ private: Status RequestStop(); - // ------------------------------------------------------------------------- /// Return the mach thread port number for this thread. /// /// \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); @@ -144,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/lldb/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp b/lldb/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp index 499db58e2d8..89de92a6df4 100644 --- a/lldb/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp +++ b/lldb/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp @@ -548,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. // @@ -558,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/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h b/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h index 92faee7480c..6d3c253a519 100644 --- a/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h +++ b/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h @@ -19,14 +19,11 @@ class ProcessMessage; class ProcessMonitor; class POSIXBreakpointProtocol; -//------------------------------------------------------------------------------ // @class FreeBSDThread // Abstraction of a FreeBSD thread. class FreeBSDThread : public lldb_private::Thread { public: - //------------------------------------------------------------------ // Constructors and destructors - //------------------------------------------------------------------ FreeBSDThread(lldb_private::Process &process, lldb::tid_t tid); virtual ~FreeBSDThread(); @@ -50,7 +47,6 @@ public: lldb::addr_t GetThreadPointer() override; - //-------------------------------------------------------------------------- // These functions provide a mapping from the register offset // back to the register index or name for use in debugging or log // output. @@ -61,14 +57,12 @@ public: const char *GetRegisterNameFromOffset(unsigned offset); - //-------------------------------------------------------------------------- // These methods form a specialized interface to POSIX threads. // bool Resume(); void Notify(const ProcessMessage &message); - //-------------------------------------------------------------------------- // These methods provide an interface to watchpoints // bool EnableHardwareWatchpoint(lldb_private::Watchpoint *wp); @@ -110,7 +104,6 @@ protected: lldb_private::Unwind *GetUnwinder() override; - //-------------------------------------------------------------------------- // FreeBSDThread internal API. // POSIXThread override diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp index d985a52ce44..efd8cade504 100644 --- a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp @@ -64,7 +64,6 @@ UnixSignalsSP &GetFreeBSDSignals() { } } -//------------------------------------------------------------------------------ // Static functions. lldb::ProcessSP @@ -96,7 +95,6 @@ const char *ProcessFreeBSD::GetPluginDescriptionStatic() { return "Process plugin for FreeBSD"; } -//------------------------------------------------------------------------------ // ProcessInterface protocol. lldb_private::ConstString ProcessFreeBSD::GetPluginName() { @@ -250,7 +248,6 @@ void ProcessFreeBSD::SendMessage(const ProcessMessage &message) { m_message_queue.push(message); } -//------------------------------------------------------------------------------ // Constructors and destructors. ProcessFreeBSD::ProcessFreeBSD(lldb::TargetSP target_sp, @@ -269,7 +266,6 @@ ProcessFreeBSD::ProcessFreeBSD(lldb::TargetSP target_sp, ProcessFreeBSD::~ProcessFreeBSD() { delete m_monitor; } -//------------------------------------------------------------------------------ // Process protocol. void ProcessFreeBSD::Finalize() { Process::Finalize(); @@ -835,7 +831,6 @@ size_t ProcessFreeBSD::PutSTDIN(const char *buf, size_t len, Status &error) { return status; } -//------------------------------------------------------------------------------ // Utility functions. bool ProcessFreeBSD::HasExited() { diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h index e8a0cd9a9df..293f7b854b4 100644 --- a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h +++ b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h @@ -23,9 +23,7 @@ class FreeBSDThread; class ProcessFreeBSD : public lldb_private::Process { public: - //------------------------------------------------------------------ // Static functions. - //------------------------------------------------------------------ static lldb::ProcessSP CreateInstance(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const lldb_private::FileSpec *crash_file_path); @@ -38,9 +36,7 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // Constructors and destructors - //------------------------------------------------------------------ ProcessFreeBSD(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, lldb::UnixSignalsSP &unix_signals_sp); @@ -48,17 +44,13 @@ public: virtual lldb_private::Status WillResume() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ virtual lldb_private::ConstString GetPluginName() override; virtual uint32_t GetPluginVersion() override; public: - //------------------------------------------------------------------ // Process protocol. - //------------------------------------------------------------------ void Finalize() override; bool CanDebug(lldb::TargetSP target_sp, @@ -137,7 +129,6 @@ public: const lldb::DataBufferSP GetAuxvData() override; - //-------------------------------------------------------------------------- // ProcessFreeBSD internal API. /// Registers the given message with this process. diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp index 959e5f0dfd8..09a898ca7d4 100644 --- a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp @@ -140,7 +140,6 @@ extern long PtraceWrapper(int req, lldb::pid_t pid, void *addr, int data) { PtraceWrapper((req), (pid), (addr), (data)) #endif -//------------------------------------------------------------------------------ // Static implementations of ProcessMonitor::ReadMemory and // ProcessMonitor::WriteMemory. This enables mutual recursion between these // functions without needed to go thru the thread funnel. @@ -195,7 +194,6 @@ static bool EnsureFDFlags(int fd, int flags, Status &error) { return true; } -//------------------------------------------------------------------------------ /// \class Operation /// Represents a ProcessMonitor operation. /// @@ -213,7 +211,6 @@ public: virtual void Execute(ProcessMonitor *monitor) = 0; }; -//------------------------------------------------------------------------------ /// \class ReadOperation /// Implements ProcessMonitor::ReadMemory. class ReadOperation : public Operation { @@ -239,7 +236,6 @@ void ReadOperation::Execute(ProcessMonitor *monitor) { m_result = DoReadMemory(pid, m_addr, m_buff, m_size, m_error); } -//------------------------------------------------------------------------------ /// \class WriteOperation /// Implements ProcessMonitor::WriteMemory. class WriteOperation : public Operation { @@ -265,7 +261,6 @@ void WriteOperation::Execute(ProcessMonitor *monitor) { m_result = DoWriteMemory(pid, m_addr, m_buff, m_size, m_error); } -//------------------------------------------------------------------------------ /// \class ReadRegOperation /// Implements ProcessMonitor::ReadRegisterValue. class ReadRegOperation : public Operation { @@ -305,7 +300,6 @@ void ReadRegOperation::Execute(ProcessMonitor *monitor) { } } -//------------------------------------------------------------------------------ /// \class WriteRegOperation /// Implements ProcessMonitor::WriteRegisterValue. class WriteRegOperation : public Operation { @@ -338,7 +332,6 @@ void WriteRegOperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class ReadDebugRegOperation /// Implements ProcessMonitor::ReadDebugRegisterValue. class ReadDebugRegOperation : public Operation { @@ -373,7 +366,6 @@ void ReadDebugRegOperation::Execute(ProcessMonitor *monitor) { } } -//------------------------------------------------------------------------------ /// \class WriteDebugRegOperation /// Implements ProcessMonitor::WriteDebugRegisterValue. class WriteDebugRegOperation : public Operation { @@ -406,7 +398,6 @@ void WriteDebugRegOperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class ReadGPROperation /// Implements ProcessMonitor::ReadGPR. class ReadGPROperation : public Operation { @@ -433,7 +424,6 @@ void ReadGPROperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class ReadFPROperation /// Implements ProcessMonitor::ReadFPR. class ReadFPROperation : public Operation { @@ -456,7 +446,6 @@ void ReadFPROperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class WriteGPROperation /// Implements ProcessMonitor::WriteGPR. class WriteGPROperation : public Operation { @@ -479,7 +468,6 @@ void WriteGPROperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class WriteFPROperation /// Implements ProcessMonitor::WriteFPR. class WriteFPROperation : public Operation { @@ -502,7 +490,6 @@ void WriteFPROperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class ResumeOperation /// Implements ProcessMonitor::Resume. class ResumeOperation : public Operation { @@ -533,7 +520,6 @@ void ResumeOperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class SingleStepOperation /// Implements ProcessMonitor::SingleStep. class SingleStepOperation : public Operation { @@ -561,7 +547,6 @@ void SingleStepOperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class LwpInfoOperation /// Implements ProcessMonitor::GetLwpInfo. class LwpInfoOperation : public Operation { @@ -590,7 +575,6 @@ void LwpInfoOperation::Execute(ProcessMonitor *monitor) { } } -//------------------------------------------------------------------------------ /// \class ThreadSuspendOperation /// Implements ProcessMonitor::ThreadSuspend. class ThreadSuspendOperation : public Operation { @@ -610,7 +594,6 @@ void ThreadSuspendOperation::Execute(ProcessMonitor *monitor) { m_result = !PTRACE(m_suspend ? PT_SUSPEND : PT_RESUME, m_tid, NULL, 0); } -//------------------------------------------------------------------------------ /// \class EventMessageOperation /// Implements ProcessMonitor::GetEventMessage. class EventMessageOperation : public Operation { @@ -640,7 +623,6 @@ void EventMessageOperation::Execute(ProcessMonitor *monitor) { } } -//------------------------------------------------------------------------------ /// \class KillOperation /// Implements ProcessMonitor::Kill. class KillOperation : public Operation { @@ -662,7 +644,6 @@ void KillOperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class DetachOperation /// Implements ProcessMonitor::Detach. class DetachOperation : public Operation { @@ -708,7 +689,6 @@ ProcessMonitor::AttachArgs::AttachArgs(ProcessMonitor *monitor, lldb::pid_t pid) ProcessMonitor::AttachArgs::~AttachArgs() {} -//------------------------------------------------------------------------------ /// The basic design of the ProcessMonitor is built around two threads. /// /// One thread (@see SignalThread) simply blocks on a call to waitpid() @@ -805,7 +785,6 @@ ProcessMonitor::ProcessMonitor(ProcessFreeBSD *process, lldb::pid_t pid, ProcessMonitor::~ProcessMonitor() { StopMonitor(); } -//------------------------------------------------------------------------------ // Thread setup and tear down. void ProcessMonitor::StartLaunchOpThread(LaunchArgs *args, Status &error) { static const char *g_thread_name = "lldb.process.freebsd.operation"; diff --git a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h index c9bfe0948e9..cf52a065232 100644 --- a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h +++ b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h @@ -13,7 +13,6 @@ #include "lldb/Target/RegisterContext.h" #include "lldb/Utility/ArchSpec.h" -//------------------------------------------------------------------------------ /// \class POSIXBreakpointProtocol /// /// Extends RegisterClass with a few virtual operations useful on POSIX. diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index bab2a71de3d..d85ec214218 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -206,9 +206,7 @@ static Status EnsureFDFlags(int fd, int flags) { return error; } -// ----------------------------------------------------------------------------- // Public Static Methods -// ----------------------------------------------------------------------------- llvm::Expected<std::unique_ptr<NativeProcessProtocol>> NativeProcessLinux::Factory::Launch(ProcessLaunchInfo &launch_info, @@ -284,9 +282,7 @@ NativeProcessLinux::Factory::Attach( pid, -1, native_delegate, Info.GetArchitecture(), mainloop, *tids_or)); } -// ----------------------------------------------------------------------------- // Public Instance Methods -// ----------------------------------------------------------------------------- NativeProcessLinux::NativeProcessLinux(::pid_t pid, int terminal_fd, NativeDelegate &delegate, diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h index 044f16754ff..006ae000168 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h @@ -49,9 +49,7 @@ public: MainLoop &mainloop) const override; }; - // --------------------------------------------------------------------- // NativeProcessProtocol Interface - // --------------------------------------------------------------------- Status Resume(const ResumeActionList &resume_actions) override; Status Halt() override; @@ -120,9 +118,7 @@ public: Status GetTraceConfig(lldb::user_id_t traceid, TraceOptions &config) override; - // --------------------------------------------------------------------- // 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); @@ -146,9 +142,7 @@ private: // the relevan breakpoint std::map<lldb::tid_t, lldb::addr_t> m_threads_stepping_with_breakpoint; - // --------------------------------------------------------------------- // Private Instance Methods - // --------------------------------------------------------------------- NativeProcessLinux(::pid_t pid, int terminal_fd, NativeDelegate &delegate, const ArchSpec &arch, MainLoop &mainloop, llvm::ArrayRef<::pid_t> tids); diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h index b7d77403ba5..d64bcdc82df 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h @@ -40,9 +40,7 @@ public: Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override; - //------------------------------------------------------------------ // Hardware breakpoints/watchpoint management functions - //------------------------------------------------------------------ uint32_t NumSupportedHardwareBreakpoints() override; diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h index 57af505db94..005843eebd7 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h @@ -40,9 +40,7 @@ public: Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override; - //------------------------------------------------------------------ // Hardware breakpoints/watchpoint management functions - //------------------------------------------------------------------ uint32_t NumSupportedHardwareBreakpoints() override; diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp index 590e8075a44..3ca9b436baf 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp @@ -87,9 +87,7 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( (GetRegisterInfoInterface().GetGPRSize() + sizeof(FPR_linux_mips) + \ sizeof(MSA_linux_mips)) -// ---------------------------------------------------------------------------- // NativeRegisterContextLinux_mips64 members. -// ---------------------------------------------------------------------------- static RegisterInfoInterface * CreateRegisterInfoInterface(const ArchSpec &target_arch) { diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h index ff3a740b99a..37f9f5f63f9 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h @@ -47,9 +47,7 @@ public: Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override; - //------------------------------------------------------------------ // Hardware watchpoint management functions - //------------------------------------------------------------------ uint32_t NumSupportedHardwareWatchpoints() override; diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp index f5565893c10..5d135574722 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp @@ -25,9 +25,7 @@ using namespace lldb_private; using namespace lldb_private::process_linux; -// ---------------------------------------------------------------------------- // Private namespace. -// ---------------------------------------------------------------------------- namespace { // s390x 64-bit general purpose registers. @@ -89,9 +87,7 @@ static const RegisterSet g_reg_sets_s390x[k_num_register_sets] = { #define REG_CONTEXT_SIZE (sizeof(s390_regs) + sizeof(s390_fp_regs) + 4) -// ---------------------------------------------------------------------------- // Required ptrace defines. -// ---------------------------------------------------------------------------- #define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */ #define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */ @@ -103,9 +99,7 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( native_thread); } -// ---------------------------------------------------------------------------- // NativeRegisterContextLinux_s390x members. -// ---------------------------------------------------------------------------- static RegisterInfoInterface * CreateRegisterInfoInterface(const ArchSpec &target_arch) { diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp index b7d5b6b6c1b..ad2d4329f85 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp @@ -24,9 +24,7 @@ using namespace lldb_private; using namespace lldb_private::process_linux; -// ---------------------------------------------------------------------------- // Private namespace. -// ---------------------------------------------------------------------------- namespace { // x86 32-bit general purpose registers. @@ -207,9 +205,7 @@ static const RegisterSet g_reg_sets_x86_64[k_num_register_sets] = { #define REG_CONTEXT_SIZE (GetRegisterInfoInterface().GetGPRSize() + sizeof(FPR)) -// ---------------------------------------------------------------------------- // Required ptrace defines. -// ---------------------------------------------------------------------------- // Support ptrace extensions even when compiled without required kernel support #ifndef NT_X86_XSTATE @@ -225,18 +221,14 @@ static inline unsigned int fxsr_regset(const ArchSpec &arch) { return arch.GetAddressByteSize() == 8 ? NT_PRFPREG : NT_PRXFPREG; } -// ---------------------------------------------------------------------------- // Required MPX define. -// ---------------------------------------------------------------------------- // Support MPX extensions also if compiled with compiler without MPX support. #ifndef bit_MPX #define bit_MPX 0x4000 #endif -// ---------------------------------------------------------------------------- // XCR0 extended register sets masks. -// ---------------------------------------------------------------------------- #define mask_XSTATE_AVX (1ULL << 2) #define mask_XSTATE_BNDREGS (1ULL << 3) #define mask_XSTATE_BNDCFG (1ULL << 4) @@ -249,9 +241,7 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( new NativeRegisterContextLinux_x86_64(target_arch, native_thread)); } -// ---------------------------------------------------------------------------- // NativeRegisterContextLinux_x86_64 members. -// ---------------------------------------------------------------------------- static RegisterInfoInterface * CreateRegisterInfoInterface(const ArchSpec &target_arch) { diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h index e92908baeb5..fd43c89489f 100644 --- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h +++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h @@ -30,9 +30,7 @@ class NativeThreadLinux : public NativeThreadProtocol { public: NativeThreadLinux(NativeProcessLinux &process, lldb::tid_t tid); - // --------------------------------------------------------------------- // NativeThreadProtocol Interface - // --------------------------------------------------------------------- std::string GetName() override; lldb::StateType GetState() override; @@ -54,9 +52,7 @@ public: Status RemoveHardwareBreakpoint(lldb::addr_t addr) override; private: - // --------------------------------------------------------------------- // Interface for friend classes - // --------------------------------------------------------------------- /// Resumes the thread. If \p signo is anything but /// LLDB_INVALID_SIGNAL_NUMBER, deliver that signal to the thread. @@ -91,18 +87,14 @@ private: Status RequestStop(); - // --------------------------------------------------------------------- // Private interface - // --------------------------------------------------------------------- void MaybeLogStateChange(lldb::StateType new_state); NativeProcessLinux &GetProcess(); void SetStopped(); - // --------------------------------------------------------------------- // Member Variables - // --------------------------------------------------------------------- lldb::StateType m_state; ThreadStopInfo m_stop_info; std::unique_ptr<NativeRegisterContextLinux> m_reg_context_up; diff --git a/lldb/source/Plugins/Process/Linux/ProcessorTrace.h b/lldb/source/Plugins/Process/Linux/ProcessorTrace.h index d105555705c..de9bd8c78e1 100644 --- a/lldb/source/Plugins/Process/Linux/ProcessorTrace.h +++ b/lldb/source/Plugins/Process/Linux/ProcessorTrace.h @@ -23,7 +23,6 @@ namespace lldb_private { namespace process_linux { -// --------------------------------------------------------------------- // This class keeps track of one tracing instance of // Intel(R) Processor Trace on Linux OS. There is a map keeping track // of different tracing instances on each thread, which enables trace @@ -36,7 +35,6 @@ namespace process_linux { // The trace id could map to trace instances for a group of threads // (spanning to all the threads in the process) or a single thread. // The kernel interface for us is the perf_event_open. -// --------------------------------------------------------------------- class ProcessorTraceMonitor; typedef std::unique_ptr<ProcessorTraceMonitor> ProcessorTraceMonitorUP; @@ -115,7 +113,6 @@ public: Status GetTraceConfig(TraceOptions &config) const; - // --------------------------------------------------------------------- /// Read data from a cyclic buffer /// /// \param[in] [out] buf @@ -130,7 +127,6 @@ public: /// /// \param[in] offset /// The offset to begin reading the data in the cyclic buffer. - // --------------------------------------------------------------------- static void ReadCyclicBuffer(llvm::MutableArrayRef<uint8_t> &dst, llvm::MutableArrayRef<uint8_t> src, size_t src_cyc_index, size_t offset); diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp index 5da835d3525..ded0983fac7 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp @@ -28,9 +28,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // CommunicationKDP constructor -//---------------------------------------------------------------------- CommunicationKDP::CommunicationKDP(const char *comm_name) : Communication(comm_name), m_addr_byte_size(4), m_byte_order(eByteOrderLittle), m_packet_timeout(5), m_sequence_mutex(), @@ -39,9 +37,7 @@ CommunicationKDP::CommunicationKDP(const char *comm_name) m_kdp_version_feature(0u), m_kdp_hostinfo_cpu_mask(0u), m_kdp_hostinfo_cpu_type(0u), m_kdp_hostinfo_cpu_subtype(0u) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CommunicationKDP::~CommunicationKDP() { if (IsConnected()) { Disconnect(); diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h index b5aa146ac39..fed6128c17f 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h @@ -76,9 +76,7 @@ public: ePacketTypeMask = 0x80u, eCommandTypeMask = 0x7fu } PacketType; - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CommunicationKDP(const char *comm_name); virtual ~CommunicationKDP(); @@ -96,14 +94,12 @@ public: lldb_private::DataExtractor &packet); bool IsRunning() const { return m_is_running.GetValue(); } - //------------------------------------------------------------------ // Set the global packet timeout. // // For clients, this is the timeout that gets used when sending // packets and waiting for responses. For servers, this might not // get used, and if it doesn't this should be moved to the // CommunicationKDPClient. - //------------------------------------------------------------------ std::chrono::seconds SetPacketTimeout(std::chrono::seconds packet_timeout) { const auto old_packet_timeout = m_packet_timeout; m_packet_timeout = packet_timeout; @@ -112,9 +108,7 @@ public: std::chrono::seconds GetPacketTimeout() const { return m_packet_timeout; } - //------------------------------------------------------------------ // Public Request Packets - //------------------------------------------------------------------ bool SendRequestConnect(uint16_t reply_port, uint16_t exc_port, const char *greeting); @@ -188,10 +182,8 @@ protected: PacketStreamType &request_packet, uint16_t request_length); - //------------------------------------------------------------------ // Protected Request Packets (use public accessors which will cache // results. - //------------------------------------------------------------------ bool SendRequestVersion(); bool SendRequestHostInfo(); @@ -228,9 +220,7 @@ protected: bool SendRequestAndGetReply(const CommandType command, const PacketStreamType &request_packet, lldb_private::DataExtractor &reply_packet); - //------------------------------------------------------------------ // Classes that inherit from CommunicationKDP can see and modify these - //------------------------------------------------------------------ uint32_t m_addr_byte_size; lldb::ByteOrder m_byte_order; std::chrono::seconds m_packet_timeout; @@ -250,9 +240,7 @@ protected: // hang the KDP connection... lldb::addr_t m_last_read_memory_addr; // Last memory read address for logging private: - //------------------------------------------------------------------ // For CommunicationKDP only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(CommunicationKDP); }; diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp index 605194d0726..c9e024fc498 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp @@ -143,9 +143,7 @@ bool ProcessKDP::CanDebug(TargetSP target_sp, bool plugin_specified_by_name) { return false; } -//---------------------------------------------------------------------- // ProcessKDP constructor -//---------------------------------------------------------------------- ProcessKDP::ProcessKDP(TargetSP target_sp, ListenerSP listener_sp) : Process(target_sp, listener_sp), m_comm("lldb.process.kdp-remote.communication"), @@ -162,9 +160,7 @@ ProcessKDP::ProcessKDP(TargetSP target_sp, ListenerSP listener_sp) m_comm.SetPacketTimeout(std::chrono::seconds(timeout_seconds)); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- ProcessKDP::~ProcessKDP() { Clear(); // We need to call finalize on the process before destroying ourselves to @@ -174,9 +170,7 @@ ProcessKDP::~ProcessKDP() { Finalize(); } -//---------------------------------------------------------------------- // PluginInterface -//---------------------------------------------------------------------- lldb_private::ConstString ProcessKDP::GetPluginName() { return GetPluginNameStatic(); } @@ -369,9 +363,7 @@ Status ProcessKDP::DoConnectRemote(Stream *strm, llvm::StringRef remote_url) { return error; } -//---------------------------------------------------------------------- // Process Control -//---------------------------------------------------------------------- Status ProcessKDP::DoLaunch(Module *exe_module, ProcessLaunchInfo &launch_info) { Status error; @@ -595,17 +587,13 @@ Status ProcessKDP::DoDestroy() { return DoDetach(keep_stopped); } -//------------------------------------------------------------------ // Process Queries -//------------------------------------------------------------------ bool ProcessKDP::IsAlive() { return m_comm.IsConnected() && Process::IsAlive(); } -//------------------------------------------------------------------ // Process Memory -//------------------------------------------------------------------ size_t ProcessKDP::DoReadMemory(addr_t addr, void *buf, size_t size, Status &error) { uint8_t *data_buffer = (uint8_t *)buf; diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h index 31de54c4665..a7f8466f984 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h @@ -30,9 +30,7 @@ class ThreadKDP; class ProcessKDP : public lldb_private::Process { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ static lldb::ProcessSP CreateInstance(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const lldb_private::FileSpec *crash_file_path); @@ -47,23 +45,17 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ ProcessKDP(lldb::TargetSP target_sp, lldb::ListenerSP listener); ~ProcessKDP() override; - //------------------------------------------------------------------ // Check if a given Process - //------------------------------------------------------------------ bool CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) override; lldb_private::CommandObject *GetPluginCommandObject() override; - //------------------------------------------------------------------ // Creating a new process, or attaching to an existing one - //------------------------------------------------------------------ lldb_private::Status WillLaunch(lldb_private::Module *module) override; lldb_private::Status @@ -93,16 +85,12 @@ public: lldb_private::DynamicLoader *GetDynamicLoader() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - //------------------------------------------------------------------ // Process Control - //------------------------------------------------------------------ lldb_private::Status WillResume() override; lldb_private::Status DoResume() override; @@ -117,14 +105,10 @@ public: void RefreshStateAfterStop() override; - //------------------------------------------------------------------ // Process Queries - //------------------------------------------------------------------ bool IsAlive() override; - //------------------------------------------------------------------ // Process Memory - //------------------------------------------------------------------ size_t DoReadMemory(lldb::addr_t addr, void *buf, size_t size, lldb_private::Status &error) override; @@ -136,18 +120,14 @@ public: lldb_private::Status DoDeallocateMemory(lldb::addr_t ptr) override; - //---------------------------------------------------------------------- // Process Breakpoints - //---------------------------------------------------------------------- lldb_private::Status EnableBreakpointSite(lldb_private::BreakpointSite *bp_site) override; lldb_private::Status DisableBreakpointSite(lldb_private::BreakpointSite *bp_site) override; - //---------------------------------------------------------------------- // Process Watchpoints - //---------------------------------------------------------------------- lldb_private::Status EnableWatchpoint(lldb_private::Watchpoint *wp, bool notify = true) override; @@ -160,9 +140,7 @@ protected: friend class ThreadKDP; friend class CommunicationKDP; - //---------------------------------------------------------------------- // Accessors - //---------------------------------------------------------------------- bool IsRunning(lldb::StateType state) { return state == lldb::eStateRunning || IsStepping(state); } @@ -191,9 +169,7 @@ protected: lldb::ThreadSP GetKernelThread(); - //------------------------------------------------------------------ /// Broadcaster event bits definitions. - //------------------------------------------------------------------ CommunicationKDP m_comm; lldb_private::Broadcaster m_async_broadcaster; lldb_private::HostThread m_async_thread; @@ -209,9 +185,7 @@ protected: static void *AsyncThread(void *arg); private: - //------------------------------------------------------------------ // For ProcessKDP only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(ProcessKDP); }; diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp index 341c6329ad6..77361ef705f 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp @@ -34,9 +34,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Thread Registers -//---------------------------------------------------------------------- ThreadKDP::ThreadKDP(Process &process, lldb::tid_t tid) : Thread(process, tid), m_thread_name(), m_dispatch_queue_name(), diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.h b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.h index e7330f223ff..9971ea765a3 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.h +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.h @@ -60,16 +60,12 @@ public: protected: friend class ProcessKDP; - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ std::string m_thread_name; std::string m_dispatch_queue_name; lldb::addr_t m_thread_dispatch_qaddr; lldb::StopInfoSP m_cached_stop_info_sp; - //------------------------------------------------------------------ // Protected member functions. - //------------------------------------------------------------------ virtual bool CalculateStopInfo(); }; diff --git a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp index e9eceb0124f..5179f83c07e 100644 --- a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp +++ b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp @@ -54,9 +54,7 @@ static Status EnsureFDFlags(int fd, int flags) { return error; } -// ----------------------------------------------------------------------------- // Public Static Methods -// ----------------------------------------------------------------------------- llvm::Expected<std::unique_ptr<NativeProcessProtocol>> NativeProcessNetBSD::Factory::Launch(ProcessLaunchInfo &launch_info, @@ -136,9 +134,7 @@ NativeProcessNetBSD::Factory::Attach( return std::move(process_up); } -// ----------------------------------------------------------------------------- // Public Instance Methods -// ----------------------------------------------------------------------------- NativeProcessNetBSD::NativeProcessNetBSD(::pid_t pid, int terminal_fd, NativeDelegate &delegate, diff --git a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h index 2e7b62d2ae2..e85ca3b7a92 100644 --- a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h +++ b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h @@ -38,9 +38,7 @@ public: MainLoop &mainloop) const override; }; - // --------------------------------------------------------------------- // NativeProcessProtocol Interface - // --------------------------------------------------------------------- Status Resume(const ResumeActionList &resume_actions) override; Status Halt() override; @@ -83,9 +81,7 @@ public: llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> GetAuxvData() const override; - // --------------------------------------------------------------------- // Interface used by NativeRegisterContext-derived classes. - // --------------------------------------------------------------------- static Status PtraceWrapper(int req, lldb::pid_t pid, void *addr = nullptr, int data = 0, int *result = nullptr); @@ -95,9 +91,7 @@ private: LazyBool m_supports_mem_region = eLazyBoolCalculate; std::vector<std::pair<MemoryRegionInfo, FileSpec>> m_mem_region_cache; - // --------------------------------------------------------------------- // Private Instance Methods - // --------------------------------------------------------------------- NativeProcessNetBSD(::pid_t pid, int terminal_fd, NativeDelegate &delegate, const ArchSpec &arch, MainLoop &mainloop); diff --git a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp index 8c8e265aa4d..2c9eaaab010 100644 --- a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp +++ b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp @@ -31,9 +31,7 @@ using namespace lldb_private; using namespace lldb_private::process_netbsd; -// ---------------------------------------------------------------------------- // Private namespace. -// ---------------------------------------------------------------------------- namespace { // x86 64-bit general purpose registers. @@ -152,9 +150,7 @@ NativeRegisterContextNetBSD::CreateHostNativeRegisterContextNetBSD( return new NativeRegisterContextNetBSD_x86_64(target_arch, native_thread); } -// ---------------------------------------------------------------------------- // NativeRegisterContextNetBSD_x86_64 members. -// ---------------------------------------------------------------------------- static RegisterInfoInterface * CreateRegisterInfoInterface(const ArchSpec &target_arch) { diff --git a/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h b/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h index 01d169d661a..015d8995db3 100644 --- a/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h +++ b/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h @@ -26,9 +26,7 @@ class NativeThreadNetBSD : public NativeThreadProtocol { public: NativeThreadNetBSD(NativeProcessNetBSD &process, lldb::tid_t tid); - // --------------------------------------------------------------------- // NativeThreadProtocol Interface - // --------------------------------------------------------------------- std::string GetName() override; lldb::StateType GetState() override; @@ -48,9 +46,7 @@ public: Status RemoveHardwareBreakpoint(lldb::addr_t addr) override; private: - // --------------------------------------------------------------------- // Interface for friend classes - // --------------------------------------------------------------------- void SetStoppedBySignal(uint32_t signo, const siginfo_t *info = nullptr); void SetStoppedByBreakpoint(); @@ -61,9 +57,7 @@ private: void SetRunning(); void SetStepping(); - // --------------------------------------------------------------------- // Member Variables - // --------------------------------------------------------------------- lldb::StateType m_state; ThreadStopInfo m_stop_info; std::unique_ptr<NativeRegisterContext> m_reg_context_up; diff --git a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.h b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.h index 116224a1af6..aacf547e187 100644 --- a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.h +++ b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.h @@ -64,9 +64,7 @@ public: void Clear(); protected: - //------------------------------------------------------------------ // Classes that inherit from DynamicRegisterInfo can see and modify these - //------------------------------------------------------------------ typedef std::vector<lldb_private::RegisterInfo> reg_collection; typedef std::vector<lldb_private::RegisterSet> set_collection; typedef std::vector<uint32_t> reg_num_collection; diff --git a/lldb/source/Plugins/Process/Utility/HistoryThread.h b/lldb/source/Plugins/Process/Utility/HistoryThread.h index cbbb3fc3eef..2345d85da0e 100644 --- a/lldb/source/Plugins/Process/Utility/HistoryThread.h +++ b/lldb/source/Plugins/Process/Utility/HistoryThread.h @@ -22,7 +22,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class HistoryThread HistoryThread.h "HistoryThread.h" /// A thread object representing a backtrace from a previous point in the /// process execution @@ -31,7 +30,6 @@ namespace lldb_private { /// process execution. It is given a backtrace list of pc addresses and /// optionally a stop_id of when those pc addresses were collected, and it /// will create stack frames for them. -//---------------------------------------------------------------------- class HistoryThread : public lldb_private::Thread { public: diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp index 10609ce88fa..ea950cee75a 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp @@ -960,11 +960,9 @@ const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums); const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums); const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums); -//---------------------------------------------------------------------- // Register set definitions. The first definitions at register set index of // zero is for all registers, followed by other registers sets. The register // information for the all register set need not be filled in. -//---------------------------------------------------------------------- static const RegisterSet g_reg_sets[] = { { "General Purpose Registers", "gpr", k_num_gpr_registers, g_gpr_regnums, @@ -984,9 +982,7 @@ const RegisterSet *RegisterContextDarwin_arm::GetRegisterSet(size_t reg_set) { return NULL; } -//---------------------------------------------------------------------- // Register information definitions for 32 bit i386. -//---------------------------------------------------------------------- int RegisterContextDarwin_arm::GetSetForNativeRegNum(int reg) { if (reg < fpu_s0) return GPRRegSet; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp index 0f9e1e6b758..c264831c0dd 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp @@ -67,9 +67,7 @@ using namespace lldb_private; sizeof(RegisterContextDarwin_arm64::FPU) + \ sizeof(RegisterContextDarwin_arm64::EXC)) -//----------------------------------------------------------------------------- // Include RegisterInfos_arm64 to declare our g_register_infos_arm64 structure. -//----------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_ARM64_STRUCT #include "RegisterInfos_arm64.h" #undef DECLARE_REGISTER_INFOS_ARM64_STRUCT @@ -140,11 +138,9 @@ const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums); const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums); const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums); -//---------------------------------------------------------------------- // Register set definitions. The first definitions at register set index of // zero is for all registers, followed by other registers sets. The register // information for the all register set need not be filled in. -//---------------------------------------------------------------------- static const RegisterSet g_reg_sets[] = { { "General Purpose Registers", "gpr", k_num_gpr_registers, g_gpr_regnums, @@ -164,9 +160,7 @@ const RegisterSet *RegisterContextDarwin_arm64::GetRegisterSet(size_t reg_set) { return NULL; } -//---------------------------------------------------------------------- // Register information definitions for arm64 -//---------------------------------------------------------------------- int RegisterContextDarwin_arm64::GetSetForNativeRegNum(int reg) { if (reg < fpu_v0) return GPRRegSet; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp index 161af9f8c32..130a2673fde 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp @@ -460,11 +460,9 @@ const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums); const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums); const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums); -//---------------------------------------------------------------------- // Register set definitions. The first definitions at register set index of // zero is for all registers, followed by other registers sets. The register // information for the all register set need not be filled in. -//---------------------------------------------------------------------- static const RegisterSet g_reg_sets[] = { { "General Purpose Registers", "gpr", k_num_gpr_registers, g_gpr_regnums, @@ -484,9 +482,7 @@ const RegisterSet *RegisterContextDarwin_i386::GetRegisterSet(size_t reg_set) { return NULL; } -//---------------------------------------------------------------------- // Register information definitions for 32 bit i386. -//---------------------------------------------------------------------- int RegisterContextDarwin_i386::GetSetForNativeRegNum(int reg_num) { if (reg_num < fpu_fcw) return GPRRegSet; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp index c611f6239b8..4a37454ba8c 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp @@ -521,11 +521,9 @@ const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums); const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums); const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums); -//---------------------------------------------------------------------- // Register set definitions. The first definitions at register set index of // zero is for all registers, followed by other registers sets. The register // information for the all register set need not be filled in. -//---------------------------------------------------------------------- static const RegisterSet g_reg_sets[] = { { "General Purpose Registers", "gpr", k_num_gpr_registers, g_gpr_regnums, diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDummy.h b/lldb/source/Plugins/Process/Utility/RegisterContextDummy.h index 70d842389df..bdaa2217d20 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDummy.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDummy.h @@ -51,9 +51,7 @@ public: uint32_t num) override; private: - //------------------------------------------------------------------ // For RegisterContextLLDB only - //------------------------------------------------------------------ lldb_private::RegisterSet m_reg_set0; // register set 0 (PC only) lldb_private::RegisterInfo m_pc_reg_info; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp index 41896615bb0..1c3f33d287c 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp @@ -53,9 +53,7 @@ struct UserArea { #define DR_SIZE sizeof(uint32_t) #define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(dbreg, dr[reg_index])) -//--------------------------------------------------------------------------- // Include RegisterInfos_i386 to declare our g_register_infos_i386 structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_I386_STRUCT #include "RegisterInfos_i386.h" #undef DECLARE_REGISTER_INFOS_I386_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_mips64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_mips64.cpp index 7c186ad3ca3..4331ef5ad14 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_mips64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_mips64.cpp @@ -79,10 +79,8 @@ typedef struct _GPR { uint64_t dummy; } GPR_freebsd_mips; -//--------------------------------------------------------------------------- // Include RegisterInfos_mips64 to declare our g_register_infos_mips64 // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_MIPS64_STRUCT #include "RegisterInfos_mips64.h" #undef DECLARE_REGISTER_INFOS_MIPS64_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp index d1b9e59b0c1..a0c314653af 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp @@ -168,10 +168,8 @@ typedef struct _VMX { uint32_t vscr; } VMX; -//--------------------------------------------------------------------------- // Include RegisterInfos_powerpc to declare our g_register_infos_powerpc // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_POWERPC_STRUCT #include "RegisterInfos_powerpc.h" #undef DECLARE_REGISTER_INFOS_POWERPC_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp index eedfdbbedfb..bcf3951ee07 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp @@ -61,10 +61,8 @@ struct UserArea { #define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(DBG, dr[reg_index])) -//--------------------------------------------------------------------------- // Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64 // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_X86_64_STRUCT #include "RegisterInfos_x86_64.h" #undef DECLARE_REGISTER_INFOS_X86_64_STRUCT @@ -88,10 +86,8 @@ GetRegisterInfo_i386(const lldb_private::ArchSpec &arch) { g_register_infos.insert(g_register_infos.end(), &base_info[0], &base_info[k_num_registers_i386]); -//--------------------------------------------------------------------------- // Include RegisterInfos_x86_64 to update the g_register_infos structure // with x86_64 offsets. -//--------------------------------------------------------------------------- #define UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS #include "RegisterInfos_x86_64.h" #undef UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextHistory.h b/lldb/source/Plugins/Process/Utility/RegisterContextHistory.h index 8c29f1fe634..952e4263d95 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextHistory.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextHistory.h @@ -51,9 +51,7 @@ public: uint32_t num) override; private: - //------------------------------------------------------------------ // For RegisterContextLLDB only - //------------------------------------------------------------------ lldb_private::RegisterSet m_reg_set0; // register set 0 (PC only) lldb_private::RegisterInfo m_pc_reg_info; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h index 06100161c73..64dd394d233 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h @@ -110,7 +110,6 @@ private: // user somehow. bool IsSkipFrame() const; - //------------------------------------------------------------------ /// Determines if a SymbolContext is a trap handler or not /// /// Given a SymbolContext, determines if this is a trap handler function @@ -118,7 +117,6 @@ private: /// /// \return /// Returns true if the SymbolContext is a trap handler. - //------------------------------------------------------------------ bool IsTrapHandlerSymbol(lldb_private::Process *process, const lldb_private::SymbolContext &m_sym_ctx) const; @@ -154,7 +152,6 @@ private: const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value); - //------------------------------------------------------------------ /// If the unwind has to the caller frame has failed, try something else /// /// If lldb is using an assembly language based UnwindPlan for a frame and @@ -165,10 +162,8 @@ private: /// /// \return /// Returns true if a fallback unwindplan was found & was installed. - //------------------------------------------------------------------ bool TryFallbackUnwindPlan(); - //------------------------------------------------------------------ /// Switch to the fallback unwind plan unconditionally without any safety /// checks that it is providing better results than the normal unwind plan. /// @@ -176,7 +171,6 @@ private: /// found to be fundamentally incorrect/impossible. /// /// Returns true if it was able to install the fallback unwind plan. - //------------------------------------------------------------------ bool ForceSwitchToFallbackUnwindPlan(); // Get the contents of a general purpose (address-size) register for this @@ -249,9 +243,7 @@ private: lldb_private::UnwindLLDB &m_parent_unwind; // The UnwindLLDB that is creating // this RegisterContextLLDB - //------------------------------------------------------------------ // For RegisterContextLLDB only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(RegisterContextLLDB); }; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp index 5b9f69a0671..1210a7e3857 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp @@ -81,9 +81,7 @@ struct UserArea { #define DR_OFFSET(reg_index) (DR_0_OFFSET + (reg_index * 4)) #define FPR_SIZE(reg) sizeof(((FPR_i386 *)NULL)->reg) -//--------------------------------------------------------------------------- // Include RegisterInfos_i386 to declare our g_register_infos_i386 structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_I386_STRUCT #include "RegisterInfos_i386.h" #undef DECLARE_REGISTER_INFOS_I386_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp index c2e3d959a88..4797afbc0ee 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp @@ -21,9 +21,7 @@ using namespace lldb_private; using namespace lldb; -//--------------------------------------------------------------------------- // Include RegisterInfos_mips to declare our g_register_infos_mips structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_MIPS_STRUCT #include "RegisterInfos_mips.h" #undef DECLARE_REGISTER_INFOS_MIPS_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp index 9eab9cf59a2..3927883c47a 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp @@ -22,19 +22,15 @@ using namespace lldb; using namespace lldb_private; -//--------------------------------------------------------------------------- // Include RegisterInfos_mips64 to declare our g_register_infos_mips64 // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_MIPS64_STRUCT #define LINUX_MIPS64 #include "RegisterInfos_mips64.h" #undef LINUX_MIPS64 #undef DECLARE_REGISTER_INFOS_MIPS64_STRUCT -//--------------------------------------------------------------------------- // Include RegisterInfos_mips to declare our g_register_infos_mips structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_MIPS_STRUCT #include "RegisterInfos_mips.h" #undef DECLARE_REGISTER_INFOS_MIPS_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp index 672567acf3a..d6401d788ab 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp @@ -12,9 +12,7 @@ using namespace lldb_private; using namespace lldb; -//--------------------------------------------------------------------------- // Include RegisterInfos_s390x to declare our g_register_infos_s390x structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_S390X_STRUCT #include "RegisterInfos_s390x.h" #undef DECLARE_REGISTER_INFOS_S390X_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp index 5a6e766d999..6f78f84e93f 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp @@ -75,10 +75,8 @@ struct UserArea { (LLVM_EXTENSION offsetof(UserArea, dbg) + \ LLVM_EXTENSION offsetof(DBG, dr[reg_index])) -//--------------------------------------------------------------------------- // Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64 // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_X86_64_STRUCT #include "RegisterInfos_x86_64.h" #undef DECLARE_REGISTER_INFOS_X86_64_STRUCT @@ -102,10 +100,8 @@ GetRegisterInfo_i386(const lldb_private::ArchSpec &arch) { g_register_infos.insert(g_register_infos.end(), &base_info[0], &base_info[k_num_registers_i386]); -//--------------------------------------------------------------------------- // Include RegisterInfos_x86_64 to update the g_register_infos structure // with x86_64 offsets. -//--------------------------------------------------------------------------- #define UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS #include "RegisterInfos_x86_64.h" #undef UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp index e60a03a09ee..bc78c1d6160 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp @@ -19,18 +19,14 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // RegisterContextMacOSXFrameBackchain constructor -//---------------------------------------------------------------------- RegisterContextMacOSXFrameBackchain::RegisterContextMacOSXFrameBackchain( Thread &thread, uint32_t concrete_frame_idx, const UnwindMacOSXFrameBackchain::Cursor &cursor) : RegisterContext(thread, concrete_frame_idx), m_cursor(cursor), m_cursor_is_valid(true) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- RegisterContextMacOSXFrameBackchain::~RegisterContextMacOSXFrameBackchain() {} void RegisterContextMacOSXFrameBackchain::InvalidateAllRegisters() { diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp index 533bcb420ad..946d4fa9f8e 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp @@ -18,9 +18,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // RegisterContextMemory constructor -//---------------------------------------------------------------------- RegisterContextMemory::RegisterContextMemory(Thread &thread, uint32_t concrete_frame_idx, DynamicRegisterInfo ®_infos, @@ -40,9 +38,7 @@ RegisterContextMemory::RegisterContextMemory(Thread &thread, m_reg_data.SetData(reg_data_sp); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- RegisterContextMemory::~RegisterContextMemory() {} void RegisterContextMemory::InvalidateAllRegisters() { diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h index 072e8b3eac4..68223eaeffd 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h @@ -39,13 +39,11 @@ public: uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override; - //------------------------------------------------------------------ // If all of the thread register are in a contiguous buffer in // memory, then the default ReadRegister/WriteRegister and // ReadAllRegisterValues/WriteAllRegisterValues will work. If thread // registers are not contiguous, clients will want to subclass this // class and modify the read/write functions as needed. - //------------------------------------------------------------------ bool ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue ®_value) override; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp index d0dc0becfed..e620ff66c92 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp @@ -77,10 +77,8 @@ struct UserArea { LLVM_EXTENSION offsetof(DBG, dr[reg_index])) -//--------------------------------------------------------------------------- // Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64 // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_X86_64_STRUCT #include "RegisterInfos_x86_64.h" #undef DECLARE_REGISTER_INFOS_X86_64_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp index 6d2bc1a2f9b..c1f141cf2d6 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp @@ -50,9 +50,7 @@ struct UserArea { #define DR_SIZE sizeof(uint32_t) #define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(dbreg, dr[reg_index])) -//--------------------------------------------------------------------------- // Include RegisterInfos_i386 to declare our g_register_infos_i386 structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_I386_STRUCT #include "RegisterInfos_i386.h" #undef DECLARE_REGISTER_INFOS_I386_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.cpp index a2e82cca1f5..e210196d921 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.cpp @@ -58,10 +58,8 @@ struct UserArea { #define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(DBG, dr[reg_index])) -//--------------------------------------------------------------------------- // Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64 // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_X86_64_STRUCT #include "RegisterInfos_x86_64.h" #undef DECLARE_REGISTER_INFOS_X86_64_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h index dbb3e6fa628..1a21a717b22 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h @@ -16,9 +16,7 @@ class ProcessMonitor; -// --------------------------------------------------------------------------- // Internal codes for all powerpc registers. -// --------------------------------------------------------------------------- enum { k_first_gpr_powerpc, gpr_r0_powerpc = k_first_gpr_powerpc, diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h index 1642d52021c..932f97bb567 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h @@ -50,9 +50,7 @@ public: uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override; - //--------------------------------------------------------------------------- // Note: prefer kernel definitions over user-land - //--------------------------------------------------------------------------- enum FPRType { eNotValid = 0, eFSAVE, // TODO diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp index 9cc90f0bce5..c21c02f2497 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp @@ -54,9 +54,7 @@ void RegisterContextThreadMemory::UpdateRegisterContext() { } } -//------------------------------------------------------------------ // Subclasses must override these functions -//------------------------------------------------------------------ void RegisterContextThreadMemory::InvalidateAllRegisters() { UpdateRegisterContext(); if (m_reg_ctx_sp) diff --git a/lldb/source/Plugins/Process/Utility/RegisterContext_s390x.h b/lldb/source/Plugins/Process/Utility/RegisterContext_s390x.h index 87e7b7d5e38..2cf39e9eb8e 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContext_s390x.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContext_s390x.h @@ -9,9 +9,7 @@ #ifndef liblldb_RegisterContext_s390x_h_ #define liblldb_RegisterContext_s390x_h_ -//--------------------------------------------------------------------------- // SystemZ ehframe, dwarf regnums -//--------------------------------------------------------------------------- // EHFrame and DWARF Register numbers (eRegisterKindEHFrame & // eRegisterKindDWARF) diff --git a/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h b/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h index ad004c8c824..c3b1caba73d 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h @@ -16,9 +16,7 @@ #include "llvm/Support/Compiler.h" namespace lldb_private { -//--------------------------------------------------------------------------- // i386 ehframe, dwarf regnums -//--------------------------------------------------------------------------- // Register numbers seen in eh_frame (eRegisterKindEHFrame) on i386 systems // (non-Darwin) @@ -131,9 +129,7 @@ enum { dwarf_bnd3_i386, }; -//--------------------------------------------------------------------------- // AMD x86_64, AMD64, Intel EM64T, or Intel 64 ehframe, dwarf regnums -//--------------------------------------------------------------------------- // EHFrame and DWARF Register numbers (eRegisterKindEHFrame & // eRegisterKindDWARF) @@ -241,9 +237,7 @@ enum { // dwarf_k7_x86_64, }; -//--------------------------------------------------------------------------- // Generic floating-point registers -//--------------------------------------------------------------------------- struct MMSReg { uint8_t bytes[10]; @@ -282,9 +276,7 @@ struct FXSAVE { uint8_t padding2[40]; }; -//--------------------------------------------------------------------------- // Extended floating-point registers -//--------------------------------------------------------------------------- struct YMMHReg { uint8_t bytes[16]; // 16 * 8 bits for the high bytes of each YMM register diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoInterface.h b/lldb/source/Plugins/Process/Utility/RegisterInfoInterface.h index 3d8787515bf..4b58e749adc 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterInfoInterface.h +++ b/lldb/source/Plugins/Process/Utility/RegisterInfoInterface.h @@ -15,11 +15,9 @@ namespace lldb_private { -///------------------------------------------------------------------------------ /// \class RegisterInfoInterface /// /// RegisterInfo interface to patch RegisterInfo structure for archs. -///------------------------------------------------------------------------------ class RegisterInfoInterface { public: RegisterInfoInterface(const lldb_private::ArchSpec &target_arch) diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp index 1355c65442e..118c9ffe654 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp @@ -43,9 +43,7 @@ using namespace lldb_private; (sizeof(RegisterInfoPOSIX_arm::GPR) + sizeof(RegisterInfoPOSIX_arm::FPU) + \ sizeof(RegisterInfoPOSIX_arm::EXC)) -//----------------------------------------------------------------------------- // Include RegisterInfos_arm to declare our g_register_infos_arm structure. -//----------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_ARM_STRUCT #include "RegisterInfos_arm.h" #undef DECLARE_REGISTER_INFOS_ARM_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp index e422bef4d46..14d11190264 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp @@ -48,9 +48,7 @@ sizeof(RegisterInfoPOSIX_arm64::FPU) + \ sizeof(RegisterInfoPOSIX_arm64::EXC)) -//----------------------------------------------------------------------------- // Include RegisterInfos_arm64 to declare our g_register_infos_arm64 structure. -//----------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_ARM64_STRUCT #include "RegisterInfos_arm64.h" #undef DECLARE_REGISTER_INFOS_ARM64_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp index a0da646a3d1..63d35c291e9 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp @@ -15,9 +15,7 @@ #include "RegisterInfoPOSIX_ppc64le.h" -//----------------------------------------------------------------------------- // Include RegisterInfoPOSIX_ppc64le to declare our g_register_infos_ppc64le -//----------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_PPC64LE_STRUCT #include "RegisterInfos_ppc64le.h" #undef DECLARE_REGISTER_INFOS_PPC64LE_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/StopInfoMachException.h b/lldb/source/Plugins/Process/Utility/StopInfoMachException.h index 7fa2e0feb49..74c05812ab0 100644 --- a/lldb/source/Plugins/Process/Utility/StopInfoMachException.h +++ b/lldb/source/Plugins/Process/Utility/StopInfoMachException.h @@ -17,9 +17,7 @@ namespace lldb_private { class StopInfoMachException : public StopInfo { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ StopInfoMachException(Thread &thread, uint32_t exc_type, uint32_t exc_data_count, uint64_t exc_code, uint64_t exc_subcode) diff --git a/lldb/source/Plugins/Process/Utility/UnwindLLDB.h b/lldb/source/Plugins/Process/Utility/UnwindLLDB.h index 808ef947b66..c512929c185 100644 --- a/lldb/source/Plugins/Process/Utility/UnwindLLDB.h +++ b/lldb/source/Plugins/Process/Utility/UnwindLLDB.h @@ -93,7 +93,6 @@ protected: uint32_t lldb_regnum, lldb_private::UnwindLLDB::RegisterLocation ®loc, uint32_t starting_frame_num, bool pc_register); - //------------------------------------------------------------------ /// Provide the list of user-specified trap handler functions /// /// The Platform is one source of trap handler function names; that @@ -104,7 +103,6 @@ protected: /// \return /// Vector of ConstStrings of trap handler function names. May be /// empty. - //------------------------------------------------------------------ const std::vector<ConstString> &GetUserSpecifiedTrapHandlerFunctionNames() { return m_user_supplied_trap_handler_functions; } @@ -138,12 +136,10 @@ private: std::vector<ConstString> m_user_supplied_trap_handler_functions; - //----------------------------------------------------------------- // Check if Full UnwindPlan of First frame is valid or not. // If not then try Fallback UnwindPlan of the frame. If Fallback // UnwindPlan succeeds then update the Full UnwindPlan with the // Fallback UnwindPlan. - //----------------------------------------------------------------- void UpdateUnwindPlanForFirstFrameIfInvalid(ABI *abi); CursorSP GetOneMoreFrame(ABI *abi); @@ -152,9 +148,7 @@ private: bool AddFirstFrame(); - //------------------------------------------------------------------ // For UnwindLLDB only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(UnwindLLDB); }; diff --git a/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h b/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h index 573b6beb224..2208bcc2f2e 100644 --- a/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h +++ b/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h @@ -46,9 +46,7 @@ private: size_t GetStackFrameData_x86_64(const lldb_private::ExecutionContext &exe_ctx); - //------------------------------------------------------------------ // For UnwindMacOSXFrameBackchain only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(UnwindMacOSXFrameBackchain); }; diff --git a/lldb/source/Plugins/Process/Utility/lldb-arm-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-arm-register-enums.h index 969449d838e..39cbf01ea9d 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-arm-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-arm-register-enums.h @@ -12,9 +12,7 @@ namespace lldb_private { // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -//--------------------------------------------------------------------------- // Internal codes for all ARM registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_arm = 0, gpr_r0_arm = k_first_gpr_arm, diff --git a/lldb/source/Plugins/Process/Utility/lldb-arm64-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-arm64-register-enums.h index ea60db790d4..cc414dcde3c 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-arm64-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-arm64-register-enums.h @@ -12,9 +12,7 @@ namespace lldb_private { // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -//--------------------------------------------------------------------------- // Internal codes for all ARM64 registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_arm64, gpr_x0_arm64 = k_first_gpr_arm64, diff --git a/lldb/source/Plugins/Process/Utility/lldb-mips-freebsd-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-mips-freebsd-register-enums.h index 42bc4b54a52..d97f7712242 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-mips-freebsd-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-mips-freebsd-register-enums.h @@ -12,9 +12,7 @@ namespace lldb_private { // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -//--------------------------------------------------------------------------- // Internal codes for all mips registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_mips64, gpr_zero_mips64 = k_first_gpr_mips64, diff --git a/lldb/source/Plugins/Process/Utility/lldb-mips-linux-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-mips-linux-register-enums.h index 92a1e6e1ef2..2f68b8022c9 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-mips-linux-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-mips-linux-register-enums.h @@ -13,9 +13,7 @@ namespace lldb_private { // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -//--------------------------------------------------------------------------- // Internal codes for all mips registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_mips, gpr_zero_mips = k_first_gpr_mips, @@ -148,9 +146,7 @@ enum { k_num_msa_registers_mips }; -//--------------------------------------------------------------------------- // Internal codes for all mips64 registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_mips64, gpr_zero_mips64 = k_first_gpr_mips64, diff --git a/lldb/source/Plugins/Process/Utility/lldb-ppc64-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-ppc64-register-enums.h index fb7eb267fea..6edf7ee3864 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-ppc64-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-ppc64-register-enums.h @@ -11,9 +11,7 @@ // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -// --------------------------------------------------------------------------- // Internal codes for all ppc64 registers. -// --------------------------------------------------------------------------- enum { k_first_gpr_ppc64, gpr_r0_ppc64 = k_first_gpr_ppc64, diff --git a/lldb/source/Plugins/Process/Utility/lldb-ppc64le-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-ppc64le-register-enums.h index 11b22f48796..0c381a5f391 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-ppc64le-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-ppc64le-register-enums.h @@ -11,9 +11,7 @@ // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -// --------------------------------------------------------------------------- // Internal codes for all ppc64le registers. -// --------------------------------------------------------------------------- enum { k_first_gpr_ppc64le, gpr_r0_ppc64le = k_first_gpr_ppc64le, diff --git a/lldb/source/Plugins/Process/Utility/lldb-s390x-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-s390x-register-enums.h index 97baf81a59b..bd662610829 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-s390x-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-s390x-register-enums.h @@ -12,9 +12,7 @@ namespace lldb_private { // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -//--------------------------------------------------------------------------- // Internal codes for all s390x registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_s390x, lldb_r0_s390x = k_first_gpr_s390x, diff --git a/lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h index 760aa275895..0d2149c8357 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h @@ -12,9 +12,7 @@ namespace lldb_private { // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -//--------------------------------------------------------------------------- // Internal codes for all i386 registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_i386, lldb_eax_i386 = k_first_gpr_i386, @@ -135,9 +133,7 @@ enum { k_num_mpx_registers_i386, }; -//--------------------------------------------------------------------------- // Internal codes for all x86_64 registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_x86_64, lldb_rax_x86_64 = k_first_gpr_x86_64, diff --git a/lldb/source/Plugins/Process/Windows/Common/DebuggerThread.h b/lldb/source/Plugins/Process/Windows/Common/DebuggerThread.h index 04da09317cb..56701307fd7 100644 --- a/lldb/source/Plugins/Process/Windows/Common/DebuggerThread.h +++ b/lldb/source/Plugins/Process/Windows/Common/DebuggerThread.h @@ -20,12 +20,10 @@ namespace lldb_private { -//---------------------------------------------------------------------- // DebuggerThread // // Debugs a single process, notifying listeners as appropriate when interesting // things occur. -//---------------------------------------------------------------------- class DebuggerThread : public std::enable_shared_from_this<DebuggerThread> { public: DebuggerThread(DebugDelegateSP debug_delegate); diff --git a/lldb/source/Plugins/Process/Windows/Common/ExceptionRecord.h b/lldb/source/Plugins/Process/Windows/Common/ExceptionRecord.h index bc03b9784bf..dcff8d34712 100644 --- a/lldb/source/Plugins/Process/Windows/Common/ExceptionRecord.h +++ b/lldb/source/Plugins/Process/Windows/Common/ExceptionRecord.h @@ -18,12 +18,10 @@ namespace lldb_private { -//---------------------------------------------------------------------- // ExceptionRecord // // ExceptionRecord defines an interface which allows implementors to receive // notification of events that happen in a debugged process. -//---------------------------------------------------------------------- class ExceptionRecord { public: ExceptionRecord(const EXCEPTION_RECORD &record, lldb::tid_t thread_id) { diff --git a/lldb/source/Plugins/Process/Windows/Common/IDebugDelegate.h b/lldb/source/Plugins/Process/Windows/Common/IDebugDelegate.h index 59f5cd92f5e..aff2dd610ee 100644 --- a/lldb/source/Plugins/Process/Windows/Common/IDebugDelegate.h +++ b/lldb/source/Plugins/Process/Windows/Common/IDebugDelegate.h @@ -18,12 +18,10 @@ namespace lldb_private { class Status; class HostThread; -//---------------------------------------------------------------------- // IDebugDelegate // // IDebugDelegate defines an interface which allows implementors to receive // notification of events that happen in a debugged process. -//---------------------------------------------------------------------- class IDebugDelegate { public: virtual ~IDebugDelegate() {} diff --git a/lldb/source/Plugins/Process/Windows/Common/LocalDebugDelegate.h b/lldb/source/Plugins/Process/Windows/Common/LocalDebugDelegate.h index 305ba9e0ad7..7494dbbb0cf 100644 --- a/lldb/source/Plugins/Process/Windows/Common/LocalDebugDelegate.h +++ b/lldb/source/Plugins/Process/Windows/Common/LocalDebugDelegate.h @@ -20,7 +20,6 @@ namespace lldb_private { class ProcessWindows; typedef std::shared_ptr<ProcessWindows> ProcessWindowsSP; -//---------------------------------------------------------------------- // LocalDebugDelegate // // LocalDebugDelegate creates a connection between a ProcessWindows and the @@ -39,7 +38,6 @@ typedef std::shared_ptr<ProcessWindows> ProcessWindowsSP; // a ProcessSP (which is exactly what we are trying to decouple from the // driver), so this adapter serves as a way to transparently hold the // ProcessSP while still keeping it decoupled from the driver. -//---------------------------------------------------------------------- class LocalDebugDelegate : public IDebugDelegate { public: explicit LocalDebugDelegate(lldb::ProcessWP process); diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp index e9146b558ef..e891f6c2367 100644 --- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp @@ -136,7 +136,6 @@ const char *ProcessWindows::GetPluginDescriptionStatic() { return "Process plugin for Windows"; } -//------------------------------------------------------------------------------ // Constructors and destructors. ProcessWindows::ProcessWindows(lldb::TargetSP target_sp, @@ -161,7 +160,6 @@ size_t ProcessWindows::PutSTDIN(const char *buf, size_t buf_size, return 0; } -//------------------------------------------------------------------------------ // ProcessInterface protocol. lldb_private::ConstString ProcessWindows::GetPluginName() { diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h index 3ef6d56dd2e..1b1f173a364 100644 --- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h +++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h @@ -25,9 +25,7 @@ class ProcessWindowsData; class ProcessWindows : public Process, public IDebugDelegate { public: - //------------------------------------------------------------------ // Static functions. - //------------------------------------------------------------------ static lldb::ProcessSP CreateInstance(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const FileSpec *); @@ -40,9 +38,7 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // Constructors and destructors - //------------------------------------------------------------------ ProcessWindows(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp); ~ProcessWindows(); diff --git a/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp index 8ca1b5c2821..d46d3382917 100644 --- a/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp @@ -23,9 +23,7 @@ using namespace lldb_private; const DWORD kWinContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER; -//------------------------------------------------------------------ // Constructors and Destructors -//------------------------------------------------------------------ RegisterContextWindows::RegisterContextWindows(Thread &thread, uint32_t concrete_frame_idx) : RegisterContext(thread, concrete_frame_idx), m_context(), @@ -78,9 +76,7 @@ uint32_t RegisterContextWindows::ConvertRegisterKindToRegisterNumber( return LLDB_INVALID_REGNUM; } -//------------------------------------------------------------------ // Subclasses can these functions if desired -//------------------------------------------------------------------ uint32_t RegisterContextWindows::NumSupportedHardwareBreakpoints() { // Support for hardware breakpoints not yet implemented. return 0; diff --git a/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.h b/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.h index e269af95ed8..916f9f3a156 100644 --- a/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.h +++ b/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.h @@ -18,16 +18,12 @@ class Thread; class RegisterContextWindows : public lldb_private::RegisterContext { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ RegisterContextWindows(Thread &thread, uint32_t concrete_frame_idx); virtual ~RegisterContextWindows(); - //------------------------------------------------------------------ // Subclasses must override these functions - //------------------------------------------------------------------ void InvalidateAllRegisters() override; bool ReadAllRegisterValues(lldb::DataBufferSP &data_sp) override; @@ -37,9 +33,7 @@ public: uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override; - //------------------------------------------------------------------ // Subclasses can override these functions if desired - //------------------------------------------------------------------ uint32_t NumSupportedHardwareBreakpoints() override; uint32_t SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override; diff --git a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp index 6c92d098e73..9b0e1d4de8f 100644 --- a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp @@ -172,9 +172,7 @@ RegisterSet g_register_sets[] = { }; } -//------------------------------------------------------------------ // Constructors and Destructors -//------------------------------------------------------------------ RegisterContextWindows_x64::RegisterContextWindows_x64( Thread &thread, uint32_t concrete_frame_idx) : RegisterContextWindows(thread, concrete_frame_idx) {} diff --git a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h index 68793bffa0f..5f252e16293 100644 --- a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h +++ b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h @@ -18,16 +18,12 @@ class Thread; class RegisterContextWindows_x64 : public RegisterContextWindows { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ RegisterContextWindows_x64(Thread &thread, uint32_t concrete_frame_idx); virtual ~RegisterContextWindows_x64(); - //------------------------------------------------------------------ // Subclasses must override these functions - //------------------------------------------------------------------ size_t GetRegisterCount() override; const RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override; diff --git a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp index b2c64a9199e..0c25853e1c1 100644 --- a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp @@ -142,9 +142,7 @@ RegisterSet g_register_sets[] = { }; } -//------------------------------------------------------------------ // Constructors and Destructors -//------------------------------------------------------------------ RegisterContextWindows_x86::RegisterContextWindows_x86( Thread &thread, uint32_t concrete_frame_idx) : RegisterContextWindows(thread, concrete_frame_idx) {} diff --git a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h index 7823ff98b8c..8dca1dc995b 100644 --- a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h +++ b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h @@ -18,16 +18,12 @@ class Thread; class RegisterContextWindows_x86 : public RegisterContextWindows { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ RegisterContextWindows_x86(Thread &thread, uint32_t concrete_frame_idx); virtual ~RegisterContextWindows_x86(); - //------------------------------------------------------------------ // Subclasses must override these functions - //------------------------------------------------------------------ size_t GetRegisterCount() override; const RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override; diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp index 21c9be552cf..25074f85492 100644 --- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp +++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp @@ -90,17 +90,13 @@ bool ProcessElfCore::CanDebug(lldb::TargetSP target_sp, return false; } -//---------------------------------------------------------------------- // ProcessElfCore constructor -//---------------------------------------------------------------------- ProcessElfCore::ProcessElfCore(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const FileSpec &core_file) : Process(target_sp, listener_sp), m_core_file(core_file) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- ProcessElfCore::~ProcessElfCore() { Clear(); // We need to call finalize on the process before destroying ourselves to @@ -110,9 +106,7 @@ ProcessElfCore::~ProcessElfCore() { Finalize(); } -//---------------------------------------------------------------------- // PluginInterface -//---------------------------------------------------------------------- ConstString ProcessElfCore::GetPluginName() { return GetPluginNameStatic(); } uint32_t ProcessElfCore::GetPluginVersion() { return 1; } @@ -146,9 +140,7 @@ lldb::addr_t ProcessElfCore::AddAddressRangeFromLoadSegment( return addr; } -//---------------------------------------------------------------------- // Process Control -//---------------------------------------------------------------------- Status ProcessElfCore::DoLoadCore() { Status error; if (!m_core_module_sp) { @@ -279,15 +271,11 @@ void ProcessElfCore::RefreshStateAfterStop() {} Status ProcessElfCore::DoDestroy() { return Status(); } -//------------------------------------------------------------------ // Process Queries -//------------------------------------------------------------------ bool ProcessElfCore::IsAlive() { return true; } -//------------------------------------------------------------------ // Process Memory -//------------------------------------------------------------------ size_t ProcessElfCore::ReadMemory(lldb::addr_t addr, void *buf, size_t size, Status &error) { // Don't allow the caching that lldb_private::Process::ReadMemory does since diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.h b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.h index 328474eb475..6828f5a42ff 100644 --- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.h +++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.h @@ -30,9 +30,7 @@ struct ThreadData; class ProcessElfCore : public lldb_private::Process { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ static lldb::ProcessSP CreateInstance(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const lldb_private::FileSpec *crash_file_path); @@ -45,37 +43,27 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ ProcessElfCore(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const lldb_private::FileSpec &core_file); ~ProcessElfCore() override; - //------------------------------------------------------------------ // Check if a given Process - //------------------------------------------------------------------ bool CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) override; - //------------------------------------------------------------------ // Creating a new process, or attaching to an existing one - //------------------------------------------------------------------ lldb_private::Status DoLoadCore() override; lldb_private::DynamicLoader *GetDynamicLoader() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - //------------------------------------------------------------------ // Process Control - //------------------------------------------------------------------ lldb_private::Status DoDestroy() override; void RefreshStateAfterStop() override; @@ -88,16 +76,12 @@ public: return error; } - //------------------------------------------------------------------ // Process Queries - //------------------------------------------------------------------ bool IsAlive() override; bool WarnBeforeDetach() const override { return false; } - //------------------------------------------------------------------ // Process Memory - //------------------------------------------------------------------ size_t ReadMemory(lldb::addr_t addr, void *buf, size_t size, lldb_private::Status &error) override; @@ -131,9 +115,7 @@ private: lldb_private::ConstString path; }; - //------------------------------------------------------------------ // For ProcessElfCore only - //------------------------------------------------------------------ typedef lldb_private::Range<lldb::addr_t, lldb::addr_t> FileRange; typedef lldb_private::RangeDataVector<lldb::addr_t, lldb::addr_t, FileRange> VMRangeToFileOffset; diff --git a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp index 948f52ca008..a5d1fc4a7bf 100644 --- a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp +++ b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp @@ -43,9 +43,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Construct a Thread object with given data -//---------------------------------------------------------------------- ThreadElfCore::ThreadElfCore(Process &process, const ThreadData &td) : Thread(process, td.tid), m_thread_name(td.name), m_thread_reg_ctx_sp(), m_signo(td.signo), m_gpregset_data(td.gpregset), m_notes(td.notes) {} @@ -248,9 +246,7 @@ bool ThreadElfCore::CalculateStopInfo() { return false; } -//---------------------------------------------------------------- // Parse PRSTATUS from NOTE entry -//---------------------------------------------------------------- ELFLinuxPrStatus::ELFLinuxPrStatus() { memset(this, 0, sizeof(ELFLinuxPrStatus)); } @@ -324,9 +320,7 @@ Status ELFLinuxPrStatus::Parse(const DataExtractor &data, return error; } -//---------------------------------------------------------------- // Parse PRPSINFO from NOTE entry -//---------------------------------------------------------------- ELFLinuxPrPsInfo::ELFLinuxPrPsInfo() { memset(this, 0, sizeof(ELFLinuxPrPsInfo)); } @@ -402,9 +396,7 @@ Status ELFLinuxPrPsInfo::Parse(const DataExtractor &data, return error; } -//---------------------------------------------------------------- // Parse SIGINFO from NOTE entry -//---------------------------------------------------------------- ELFLinuxSigInfo::ELFLinuxSigInfo() { memset(this, 0, sizeof(ELFLinuxSigInfo)); } size_t ELFLinuxSigInfo::GetSize(const lldb_private::ArchSpec &arch) { diff --git a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h index f0cc4daba20..13291d56a0c 100644 --- a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h +++ b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h @@ -161,9 +161,7 @@ public: } protected: - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ std::string m_thread_name; lldb::RegisterContextSP m_thread_reg_ctx_sp; diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index 228b79768fc..c5a449783bd 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -53,9 +53,7 @@ using namespace lldb; using namespace lldb_private; using namespace lldb_private::process_gdb_remote; -//---------------------------------------------------------------------- // GDBRemoteCommunication constructor -//---------------------------------------------------------------------- GDBRemoteCommunication::GDBRemoteCommunication(const char *comm_name, const char *listener_name) : Communication(comm_name), @@ -69,9 +67,7 @@ GDBRemoteCommunication::GDBRemoteCommunication(const char *comm_name, m_listen_url() { } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- GDBRemoteCommunication::~GDBRemoteCommunication() { if (IsConnected()) { Disconnect(); @@ -300,7 +296,6 @@ GDBRemoteCommunication::WaitForPacketNoLock(StringExtractorGDBRemote &packet, case eConnectionStatusTimedOut: case eConnectionStatusInterrupted: if (sync_on_timeout) { - //------------------------------------------------------------------ /// Sync the remote GDB server and make sure we get a response that /// corresponds to what we send. /// @@ -323,7 +318,6 @@ GDBRemoteCommunication::WaitForPacketNoLock(StringExtractorGDBRemote &packet, /// packets. So if we timeout, we need to ensure that we can get /// back on track. If we can't get back on track, we must /// disconnect. - //------------------------------------------------------------------ bool sync_success = false; bool got_actual_response = false; // We timed out, we need to sync back up with the diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h index 4ef22240614..e3dc9d2d1d7 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h @@ -109,13 +109,11 @@ public: bool GetSendAcks() { return m_send_acks; } - //------------------------------------------------------------------ // Set the global packet timeout. // // For clients, this is the timeout that gets used when sending // packets and waiting for responses. For servers, this is used when waiting // for ACKs. - //------------------------------------------------------------------ std::chrono::seconds SetPacketTimeout(std::chrono::seconds packet_timeout) { const auto old_packet_timeout = m_packet_timeout; m_packet_timeout = packet_timeout; @@ -124,10 +122,8 @@ public: std::chrono::seconds GetPacketTimeout() const { return m_packet_timeout; } - //------------------------------------------------------------------ // Start a debugserver instance on the current host using the // supplied connection URL. - //------------------------------------------------------------------ Status StartDebugserverProcess( const char *url, Platform *platform, // If non nullptr, then check with the platform for diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 60d33cc74e3..5e310aac98a 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -48,9 +48,7 @@ using namespace lldb_private; using namespace lldb_private::process_gdb_remote; using namespace std::chrono; -//---------------------------------------------------------------------- // GDBRemoteCommunicationClient constructor -//---------------------------------------------------------------------- GDBRemoteCommunicationClient::GDBRemoteCommunicationClient() : GDBRemoteClientBase("gdb-remote.client", "gdb-remote.client.rx_packet"), m_supports_not_sending_acks(eLazyBoolCalculate), @@ -105,9 +103,7 @@ GDBRemoteCommunicationClient::GDBRemoteCommunicationClient() m_supported_async_json_packets_sp(), m_qXfer_memory_map(), m_qXfer_memory_map_loaded(false) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- GDBRemoteCommunicationClient::~GDBRemoteCommunicationClient() { if (IsConnected()) Disconnect(); diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h index 6cbb44dad99..0210aac3c47 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h @@ -33,10 +33,8 @@ public: ~GDBRemoteCommunicationClient() override; - //------------------------------------------------------------------ // After connecting, send the handshake to the server to make sure // we are communicating with it. - //------------------------------------------------------------------ bool HandshakeWithServer(Status *error_ptr); // For packets which specify a range of output to be returned, @@ -84,7 +82,6 @@ public: bool KillSpawnedProcess(lldb::pid_t pid); - //------------------------------------------------------------------ /// Sends a GDB remote protocol 'A' packet that delivers program /// arguments to the remote server. /// @@ -97,10 +94,8 @@ public: /// the response was "Exx" where xx are two hex digits, or /// -1 if the call is unsupported or any other unexpected /// response was received. - //------------------------------------------------------------------ int SendArgumentsPacket(const ProcessLaunchInfo &launch_info); - //------------------------------------------------------------------ /// Sends a "QEnvironment:NAME=VALUE" packet that will build up the /// environment that will get used when launching an application /// in conjunction with the 'A' packet. This function can be called @@ -116,7 +111,6 @@ public: /// the response was "Exx" where xx are two hex digits, or /// -1 if the call is unsupported or any other unexpected /// response was received. - //------------------------------------------------------------------ int SendEnvironmentPacket(char const *name_equal_value); int SendEnvironment(const Environment &env); @@ -125,7 +119,6 @@ public: int SendLaunchEventDataPacket(const char *data, bool *was_supported = nullptr); - //------------------------------------------------------------------ /// Sends a "vAttach:PID" where PID is in hex. /// /// \param[in] pid @@ -139,10 +132,8 @@ public: /// \return /// Zero if the attach was successful, or an error indicating /// an error code. - //------------------------------------------------------------------ int SendAttach(lldb::pid_t pid, StringExtractorGDBRemote &response); - //------------------------------------------------------------------ /// Sends a GDB remote protocol 'I' packet that delivers stdin /// data to the remote process. /// @@ -155,10 +146,8 @@ public: /// \return /// Zero if the attach was successful, or an error indicating /// an error code. - //------------------------------------------------------------------ int SendStdinNotification(const char *data, size_t data_len); - //------------------------------------------------------------------ /// Sets the path to use for stdin/out/err for a process /// that will be launched with the 'A' packet. /// @@ -167,12 +156,10 @@ public: /// /// \return /// Zero if the for success, or an error code for failure. - //------------------------------------------------------------------ int SetSTDIN(const FileSpec &file_spec); int SetSTDOUT(const FileSpec &file_spec); int SetSTDERR(const FileSpec &file_spec); - //------------------------------------------------------------------ /// Sets the disable ASLR flag to \a enable for a process that will /// be launched with the 'A' packet. /// @@ -181,10 +168,8 @@ public: /// /// \return /// Zero if the for success, or an error code for failure. - //------------------------------------------------------------------ int SetDisableASLR(bool enable); - //------------------------------------------------------------------ /// Sets the DetachOnError flag to \a enable for the process controlled by the /// stub. /// @@ -193,10 +178,8 @@ public: /// /// \return /// Zero if the for success, or an error code for failure. - //------------------------------------------------------------------ int SetDetachOnError(bool enable); - //------------------------------------------------------------------ /// Sets the working directory to \a path for a process that will /// be launched with the 'A' packet for non platform based /// connections. If this packet is sent to a GDB server that @@ -208,10 +191,8 @@ public: /// /// \return /// Zero if the for success, or an error code for failure. - //------------------------------------------------------------------ int SetWorkingDir(const FileSpec &working_dir); - //------------------------------------------------------------------ /// Gets the current working directory of a remote platform GDB /// server. /// @@ -220,7 +201,6 @@ public: /// /// \return /// Boolean for success - //------------------------------------------------------------------ bool GetWorkingDir(FileSpec &working_dir); lldb::addr_t AllocateMemory(size_t size, uint32_t permissions); @@ -455,7 +435,6 @@ public: // Sends QPassSignals packet to the server with given signals to ignore. Status SendSignalsToIgnore(llvm::ArrayRef<int32_t> signals); - //------------------------------------------------------------------ /// Return the feature set supported by the gdb-remote server. /// /// This method returns the remote side's response to the qSupported @@ -464,12 +443,10 @@ public: /// /// \return /// The string returned by the server to the qSupported query. - //------------------------------------------------------------------ const std::string &GetServerSupportedFeatures() const { return m_qSupported_response; } - //------------------------------------------------------------------ /// Return the array of async JSON packet types supported by the remote. /// /// This method returns the remote side's array of supported JSON @@ -487,14 +464,11 @@ public: /// /// \return /// The string returned by the server to the qSupported query. - //------------------------------------------------------------------ lldb_private::StructuredData::Array *GetSupportedStructuredDataPlugins(); - //------------------------------------------------------------------ /// Configure a StructuredData feature on the remote end. /// /// \see \b Process::ConfigureStructuredData(...) for details. - //------------------------------------------------------------------ Status ConfigureRemoteStructuredData(ConstString type_name, const StructuredData::ObjectSP &config_sp); diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp index 5bc0c25c587..3e8fb9f4749 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp @@ -55,9 +55,7 @@ const static uint32_t g_default_packet_timeout_sec = 20; // seconds const static uint32_t g_default_packet_timeout_sec = 0; // not specified #endif -//---------------------------------------------------------------------- // GDBRemoteCommunicationServerCommon constructor -//---------------------------------------------------------------------- GDBRemoteCommunicationServerCommon::GDBRemoteCommunicationServerCommon( const char *comm_name, const char *listener_name) : GDBRemoteCommunicationServer(comm_name, listener_name), @@ -176,9 +174,7 @@ GDBRemoteCommunicationServerCommon::GDBRemoteCommunicationServerCommon( &GDBRemoteCommunicationServerCommon::Handle_vFile_unlink); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- GDBRemoteCommunicationServerCommon::~GDBRemoteCommunicationServerCommon() {} GDBRemoteCommunication::PacketResult diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h index d0615869d03..bc322118063 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h @@ -131,7 +131,6 @@ protected: }); } - //------------------------------------------------------------------ /// Launch a process with the current launch settings. /// /// This method supports running an lldb-gdbserver or similar @@ -141,7 +140,6 @@ protected: /// \return /// An Status object indicating the success or failure of the /// launch. - //------------------------------------------------------------------ virtual Status LaunchProcess() = 0; virtual FileSpec FindModuleFile(const std::string &module_path, diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp index c4b5c69f761..045f4b43b40 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -51,9 +51,7 @@ using namespace lldb_private; using namespace lldb_private::process_gdb_remote; using namespace llvm; -//---------------------------------------------------------------------- // GDBRemote Errors -//---------------------------------------------------------------------- namespace { enum GDBRemoteServerError { @@ -65,9 +63,7 @@ enum GDBRemoteServerError { }; } -//---------------------------------------------------------------------- // GDBRemoteCommunicationServerLLGS constructor -//---------------------------------------------------------------------- GDBRemoteCommunicationServerLLGS::GDBRemoteCommunicationServerLLGS( MainLoop &mainloop, const NativeProcessProtocol::Factory &process_factory) : GDBRemoteCommunicationServerCommon("gdb-remote.server", diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h index 786910ed93f..1609174b1d3 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h @@ -31,16 +31,13 @@ class GDBRemoteCommunicationServerLLGS : public GDBRemoteCommunicationServerCommon, public NativeProcessProtocol::NativeDelegate { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ GDBRemoteCommunicationServerLLGS( MainLoop &mainloop, const NativeProcessProtocol::Factory &process_factory); void SetLaunchInfo(const ProcessLaunchInfo &info); - //------------------------------------------------------------------ /// Launch a process with the current launch settings. /// /// This method supports running an lldb-gdbserver or similar @@ -50,10 +47,8 @@ public: /// \return /// An Status object indicating the success or failure of the /// launch. - //------------------------------------------------------------------ Status LaunchProcess() override; - //------------------------------------------------------------------ /// Attach to a process. /// /// This method supports attaching llgs to a process accessible via the @@ -62,12 +57,9 @@ public: /// \return /// An Status object indicating the success or failure of the /// attach operation. - //------------------------------------------------------------------ Status AttachToProcess(lldb::pid_t pid); - //------------------------------------------------------------------ // NativeProcessProtocol::NativeDelegate overrides - //------------------------------------------------------------------ void InitializeDelegate(NativeProcessProtocol *process) override; void ProcessStateChanged(NativeProcessProtocol *process, @@ -222,9 +214,7 @@ private: void StopSTDIOForwarding(); - //------------------------------------------------------------------ // For GDBRemoteCommunicationServerLLGS only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(GDBRemoteCommunicationServerLLGS); }; diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp index e19eb23ced5..32e4452483e 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp @@ -40,9 +40,7 @@ using namespace lldb; using namespace lldb_private; using namespace lldb_private::process_gdb_remote; -//---------------------------------------------------------------------- // GDBRemoteCommunicationServerPlatform constructor -//---------------------------------------------------------------------- GDBRemoteCommunicationServerPlatform::GDBRemoteCommunicationServerPlatform( const Socket::SocketProtocol socket_protocol, const char *socket_scheme) : GDBRemoteCommunicationServerCommon("gdb-remote.server", @@ -86,9 +84,7 @@ GDBRemoteCommunicationServerPlatform::GDBRemoteCommunicationServerPlatform( }); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- GDBRemoteCommunicationServerPlatform::~GDBRemoteCommunicationServerPlatform() {} Status GDBRemoteCommunicationServerPlatform::LaunchGDBServer( diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h index f0ee77dc1d6..eacc99a012d 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h @@ -35,7 +35,6 @@ public: // a port chosen by the OS. void SetPortMap(PortMap &&port_map); - //---------------------------------------------------------------------- // If we are using a port map where we can only use certain ports, // get the next available port. // @@ -43,7 +42,6 @@ public: // // If we aren't using a port map, return 0 to indicate we should bind to // port 0 and then figure out which port we used. - //---------------------------------------------------------------------- uint16_t GetNextAvailablePort(); bool AssociatePortWithProcess(uint16_t port, lldb::pid_t pid); diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp index a51c693cbe8..56ee0a1463c 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp @@ -28,9 +28,7 @@ using namespace lldb; using namespace lldb_private; using namespace lldb_private::process_gdb_remote; -//---------------------------------------------------------------------- // GDBRemoteRegisterContext constructor -//---------------------------------------------------------------------- GDBRemoteRegisterContext::GDBRemoteRegisterContext( ThreadGDBRemote &thread, uint32_t concrete_frame_idx, GDBRemoteDynamicRegisterInfo ®_info, bool read_all_at_once) @@ -48,9 +46,7 @@ GDBRemoteRegisterContext::GDBRemoteRegisterContext( m_reg_data.SetByteOrder(thread.GetProcess()->GetByteOrder()); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- GDBRemoteRegisterContext::~GDBRemoteRegisterContext() {} void GDBRemoteRegisterContext::InvalidateAllRegisters() { diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index a5efbc01813..15975f6825d 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -288,9 +288,7 @@ bool ProcessGDBRemote::CanDebug(lldb::TargetSP target_sp, return true; } -//---------------------------------------------------------------------- // ProcessGDBRemote constructor -//---------------------------------------------------------------------- ProcessGDBRemote::ProcessGDBRemote(lldb::TargetSP target_sp, ListenerSP listener_sp) : Process(target_sp, listener_sp), @@ -353,9 +351,7 @@ ProcessGDBRemote::ProcessGDBRemote(lldb::TargetSP target_sp, m_gdb_comm.SetPacketTimeout(std::chrono::seconds(timeout_seconds)); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- ProcessGDBRemote::~ProcessGDBRemote() { // m_mach_process.UnregisterNotificationCallbacks (this); Clear(); @@ -373,9 +369,7 @@ ProcessGDBRemote::~ProcessGDBRemote() { KillDebugserverProcess(); } -//---------------------------------------------------------------------- // PluginInterface -//---------------------------------------------------------------------- ConstString ProcessGDBRemote::GetPluginName() { return GetPluginNameStatic(); } uint32_t ProcessGDBRemote::GetPluginVersion() { return 1; } @@ -809,9 +803,7 @@ Status ProcessGDBRemote::WillLaunchOrAttach() { return error; } -//---------------------------------------------------------------------- // Process Control -//---------------------------------------------------------------------- Status ProcessGDBRemote::DoLaunch(lldb_private::Module *exe_module, ProcessLaunchInfo &launch_info) { Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS)); @@ -2724,9 +2716,7 @@ void ProcessGDBRemote::SetUnixSignals(const UnixSignalsSP &signals_sp) { Process::SetUnixSignals(std::make_shared<GDBRemoteSignals>(signals_sp)); } -//------------------------------------------------------------------ // Process Queries -//------------------------------------------------------------------ bool ProcessGDBRemote::IsAlive() { return m_gdb_comm.IsConnected() && Process::IsAlive(); @@ -2770,9 +2760,7 @@ void ProcessGDBRemote::WillPublicStop() { } } -//------------------------------------------------------------------ // Process Memory -//------------------------------------------------------------------ size_t ProcessGDBRemote::DoReadMemory(addr_t addr, void *buf, size_t size, Status &error) { GetMaxMemorySize(); @@ -3133,9 +3121,7 @@ Status ProcessGDBRemote::DoDeallocateMemory(lldb::addr_t addr) { return error; } -//------------------------------------------------------------------ // Process STDIO -//------------------------------------------------------------------ size_t ProcessGDBRemote::PutSTDIN(const char *src, size_t src_len, Status &error) { if (m_stdio_communication.IsConnected()) { diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h index efa7d28f178..a82b0950a6e 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h @@ -67,17 +67,13 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // Check if a given Process - //------------------------------------------------------------------ bool CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) override; CommandObject *GetPluginCommandObject() override; - //------------------------------------------------------------------ // Creating a new process, or attaching to an existing one - //------------------------------------------------------------------ Status WillLaunch(Module *module) override; Status DoLaunch(Module *exe_module, ProcessLaunchInfo &launch_info) override; @@ -102,16 +98,12 @@ public: void DidAttach(ArchSpec &process_arch) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - //------------------------------------------------------------------ // Process Control - //------------------------------------------------------------------ Status WillResume() override; Status DoResume() override; @@ -130,18 +122,14 @@ public: void SetUnixSignals(const lldb::UnixSignalsSP &signals_sp); - //------------------------------------------------------------------ // Process Queries - //------------------------------------------------------------------ bool IsAlive() override; lldb::addr_t GetImageInfoAddress() override; void WillPublicStop() override; - //------------------------------------------------------------------ // Process Memory - //------------------------------------------------------------------ size_t DoReadMemory(lldb::addr_t addr, void *buf, size_t size, Status &error) override; @@ -159,21 +147,15 @@ public: Status DoDeallocateMemory(lldb::addr_t ptr) override; - //------------------------------------------------------------------ // Process STDIO - //------------------------------------------------------------------ size_t PutSTDIN(const char *buf, size_t buf_size, Status &error) override; - //---------------------------------------------------------------------- // Process Breakpoints - //---------------------------------------------------------------------- Status EnableBreakpointSite(BreakpointSite *bp_site) override; Status DisableBreakpointSite(BreakpointSite *bp_site) override; - //---------------------------------------------------------------------- // Process Watchpoints - //---------------------------------------------------------------------- Status EnableWatchpoint(Watchpoint *wp, bool notify = true) override; Status DisableWatchpoint(Watchpoint *wp, bool notify = true) override; @@ -205,9 +187,7 @@ public: Status SendEventData(const char *data) override; - //---------------------------------------------------------------------- // Override DidExit so we can disconnect from the remote GDB server - //---------------------------------------------------------------------- void DidExit() override; void SetUserSpecifiedMaxMemoryTransferSize(uint64_t user_specified_max); @@ -255,9 +235,7 @@ protected: friend class GDBRemoteCommunicationClient; friend class GDBRemoteRegisterContext; - //------------------------------------------------------------------ /// Broadcaster event bits definitions. - //------------------------------------------------------------------ enum { eBroadcastBitAsyncContinue = (1 << 0), eBroadcastBitAsyncThreadShouldExit = (1 << 1), @@ -312,9 +290,7 @@ protected: using FlashRange = FlashRangeVector::Entry; FlashRangeVector m_erased_flash_ranges; - //---------------------------------------------------------------------- // Accessors - //---------------------------------------------------------------------- bool IsRunning(lldb::StateType state) { return state == lldb::eStateRunning || IsStepping(state); } @@ -427,9 +403,7 @@ protected: bool HasErased(FlashRange range); private: - //------------------------------------------------------------------ // For ProcessGDBRemote only - //------------------------------------------------------------------ std::string m_partial_profile_data; std::map<uint64_t, uint32_t> m_thread_id_to_used_usec_map; uint64_t m_last_signals_version = 0; @@ -439,9 +413,7 @@ private: lldb::user_id_t break_id, lldb::user_id_t break_loc_id); - //------------------------------------------------------------------ // ContinueDelegate interface - //------------------------------------------------------------------ void HandleAsyncStdout(llvm::StringRef out) override; void HandleAsyncMisc(llvm::StringRef data) override; void HandleStopReply() override; diff --git a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp index 9f9fcca71bc..6607bce4488 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp @@ -31,9 +31,7 @@ using namespace lldb; using namespace lldb_private; using namespace lldb_private::process_gdb_remote; -//---------------------------------------------------------------------- // Thread Registers -//---------------------------------------------------------------------- ThreadGDBRemote::ThreadGDBRemote(Process &process, lldb::tid_t tid) : Thread(process, tid), m_thread_name(), m_dispatch_queue_name(), diff --git a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp index ed2cb7f2a97..f27c80b5d1a 100644 --- a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp +++ b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp @@ -104,9 +104,7 @@ bool ProcessMachCore::CanDebug(lldb::TargetSP target_sp, return false; } -//---------------------------------------------------------------------- // ProcessMachCore constructor -//---------------------------------------------------------------------- ProcessMachCore::ProcessMachCore(lldb::TargetSP target_sp, ListenerSP listener_sp, const FileSpec &core_file) @@ -115,9 +113,7 @@ ProcessMachCore::ProcessMachCore(lldb::TargetSP target_sp, m_dyld_addr(LLDB_INVALID_ADDRESS), m_mach_kernel_addr(LLDB_INVALID_ADDRESS), m_dyld_plugin_name() {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- ProcessMachCore::~ProcessMachCore() { Clear(); // We need to call finalize on the process before destroying ourselves to @@ -127,9 +123,7 @@ ProcessMachCore::~ProcessMachCore() { Finalize(); } -//---------------------------------------------------------------------- // PluginInterface -//---------------------------------------------------------------------- ConstString ProcessMachCore::GetPluginName() { return GetPluginNameStatic(); } uint32_t ProcessMachCore::GetPluginVersion() { return 1; } @@ -191,9 +185,7 @@ bool ProcessMachCore::GetDynamicLoaderAddress(lldb::addr_t addr) { return false; } -//---------------------------------------------------------------------- // Process Control -//---------------------------------------------------------------------- Status ProcessMachCore::DoLoadCore() { Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER | LIBLLDB_LOG_PROCESS)); @@ -493,17 +485,13 @@ void ProcessMachCore::RefreshStateAfterStop() { Status ProcessMachCore::DoDestroy() { return Status(); } -//------------------------------------------------------------------ // Process Queries -//------------------------------------------------------------------ bool ProcessMachCore::IsAlive() { return true; } bool ProcessMachCore::WarnBeforeDetach() const { return false; } -//------------------------------------------------------------------ // Process Memory -//------------------------------------------------------------------ size_t ProcessMachCore::ReadMemory(addr_t addr, void *buf, size_t size, Status &error) { // Don't allow the caching that lldb_private::Process::ReadMemory does since @@ -517,7 +505,6 @@ size_t ProcessMachCore::DoReadMemory(addr_t addr, void *buf, size_t size, size_t bytes_read = 0; if (core_objfile) { - //---------------------------------------------------------------------- // Segments are not always contiguous in mach-o core files. We have core // files that have segments like: // Address Size File off File size @@ -534,7 +521,6 @@ size_t ProcessMachCore::DoReadMemory(addr_t addr, void *buf, size_t size, // We would attempt to read 32 bytes from 0xf6ff0 but would only get 16 // unless we loop through consecutive memory ranges that are contiguous in // the address space, but not in the file data. - //---------------------------------------------------------------------- while (bytes_read < size) { const addr_t curr_addr = addr + bytes_read; const VMRangeToFileOffset::Entry *core_memory_entry = diff --git a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.h b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.h index e973679557a..3e446f67e12 100644 --- a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.h +++ b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.h @@ -20,9 +20,7 @@ class ThreadKDP; class ProcessMachCore : public lldb_private::Process { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ ProcessMachCore(lldb::TargetSP target_sp, lldb::ListenerSP listener, const lldb_private::FileSpec &core_file); @@ -40,43 +38,31 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // Check if a given Process - //------------------------------------------------------------------ bool CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) override; - //------------------------------------------------------------------ // Creating a new process, or attaching to an existing one - //------------------------------------------------------------------ lldb_private::Status DoLoadCore() override; lldb_private::DynamicLoader *GetDynamicLoader() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - //------------------------------------------------------------------ // Process Control - //------------------------------------------------------------------ lldb_private::Status DoDestroy() override; void RefreshStateAfterStop() override; - //------------------------------------------------------------------ // Process Queries - //------------------------------------------------------------------ bool IsAlive() override; bool WarnBeforeDetach() const override; - //------------------------------------------------------------------ // Process Memory - //------------------------------------------------------------------ size_t ReadMemory(lldb::addr_t addr, void *buf, size_t size, lldb_private::Status &error) override; @@ -107,7 +93,6 @@ private: eKernelCorefile } CorefilePreferences; - //------------------------------------------------------------------ /// If a core file can be interpreted multiple ways, this establishes /// which style wins. /// @@ -117,7 +102,6 @@ private: /// memory. Or it could be a user process coredump of lldb while doing /// kernel debugging - so a copy of the kernel is in its heap. This /// should become a setting so it can be over-ridden when necessary. - //------------------------------------------------------------------ CorefilePreference GetCorefilePreference() { // For now, if both user process and kernel binaries a present, // assume this is a kernel coredump which has a copy of a user @@ -125,9 +109,7 @@ private: return eKernelCorefile; } - //------------------------------------------------------------------ // For ProcessMachCore only - //------------------------------------------------------------------ typedef lldb_private::Range<lldb::addr_t, lldb::addr_t> FileRange; typedef lldb_private::RangeDataVector<lldb::addr_t, lldb::addr_t, FileRange> VMRangeToFileOffset; diff --git a/lldb/source/Plugins/Process/mach-core/ThreadMachCore.cpp b/lldb/source/Plugins/Process/mach-core/ThreadMachCore.cpp index 3b128dbca8c..b71e48449b7 100644 --- a/lldb/source/Plugins/Process/mach-core/ThreadMachCore.cpp +++ b/lldb/source/Plugins/Process/mach-core/ThreadMachCore.cpp @@ -28,9 +28,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Thread Registers -//---------------------------------------------------------------------- ThreadMachCore::ThreadMachCore(Process &process, lldb::tid_t tid) : Thread(process, tid), m_thread_name(), m_dispatch_queue_name(), diff --git a/lldb/source/Plugins/Process/mach-core/ThreadMachCore.h b/lldb/source/Plugins/Process/mach-core/ThreadMachCore.h index baaec422cf5..ac5957e9020 100644 --- a/lldb/source/Plugins/Process/mach-core/ThreadMachCore.h +++ b/lldb/source/Plugins/Process/mach-core/ThreadMachCore.h @@ -52,17 +52,13 @@ public: protected: friend class ProcessMachCore; - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ std::string m_thread_name; std::string m_dispatch_queue_name; lldb::addr_t m_thread_dispatch_qaddr; lldb::RegisterContextSP m_thread_reg_ctx_sp; - //------------------------------------------------------------------ // Protected member functions. - //------------------------------------------------------------------ bool CalculateStopInfo() override; }; |