diff options
Diffstat (limited to 'include/lldb/Breakpoint/WatchpointOptions.h')
-rw-r--r-- | include/lldb/Breakpoint/WatchpointOptions.h | 77 |
1 files changed, 19 insertions, 58 deletions
diff --git a/include/lldb/Breakpoint/WatchpointOptions.h b/include/lldb/Breakpoint/WatchpointOptions.h index 0f4f399b5e4d..b395dde21901 100644 --- a/include/lldb/Breakpoint/WatchpointOptions.h +++ b/include/lldb/Breakpoint/WatchpointOptions.h @@ -1,9 +1,8 @@ //===-- WatchpointOptions.h -------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -19,49 +18,38 @@ namespace lldb_private { -//---------------------------------------------------------------------- -/// @class WatchpointOptions WatchpointOptions.h +/// \class WatchpointOptions WatchpointOptions.h /// "lldb/Breakpoint/WatchpointOptions.h" Class that manages the options on a /// watchpoint. -//---------------------------------------------------------------------- class WatchpointOptions { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Default constructor. The watchpoint is enabled, and has no condition, /// callback, ignore count, etc... - //------------------------------------------------------------------ WatchpointOptions(); WatchpointOptions(const WatchpointOptions &rhs); static WatchpointOptions *CopyOptionsNoCallback(WatchpointOptions &rhs); - //------------------------------------------------------------------ /// This constructor allows you to specify all the watchpoint options. /// - /// @param[in] callback + /// \param[in] callback /// This is the plugin for some code that gets run, returns \b true if we /// are to stop. /// - /// @param[in] baton + /// \param[in] baton /// Client data that will get passed to the callback. /// - /// @param[in] thread_id + /// \param[in] thread_id /// Only stop if \a thread_id hits the watchpoint. - //------------------------------------------------------------------ WatchpointOptions(WatchpointHitCallback callback, void *baton, lldb::tid_t thread_id = LLDB_INVALID_THREAD_ID); virtual ~WatchpointOptions(); - //------------------------------------------------------------------ // Operators - //------------------------------------------------------------------ const WatchpointOptions &operator=(const WatchpointOptions &rhs); - //------------------------------------------------------------------ // Callbacks // // Watchpoint callbacks come in two forms, synchronous and asynchronous. @@ -89,36 +77,30 @@ public: // take a bit of plumbing to get // that to work. // - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Adds a callback to the watchpoint option set. /// - /// @param[in] callback + /// \param[in] callback /// The function to be called when the watchpoint gets hit. /// - /// @param[in] baton_sp + /// \param[in] baton_sp /// A baton which will get passed back to the callback when it is invoked. /// - /// @param[in] synchronous + /// \param[in] synchronous /// Whether this is a synchronous or asynchronous callback. See discussion /// above. - //------------------------------------------------------------------ void SetCallback(WatchpointHitCallback callback, const lldb::BatonSP &baton_sp, bool synchronous = false); - //------------------------------------------------------------------ /// Remove the callback from this option set. - //------------------------------------------------------------------ void ClearCallback(); // The rest of these functions are meant to be used only within the // watchpoint handling mechanism. - //------------------------------------------------------------------ /// Use this function to invoke the callback for a specific stop. /// - /// @param[in] context + /// \param[in] context /// The context in which the callback is to be invoked. This includes the /// stop event, the /// execution context of the stop (since you might hit the same watchpoint @@ -126,77 +108,60 @@ public: /// whether we are currently executing synchronous or asynchronous /// callbacks. /// - /// @param[in] watch_id + /// \param[in] watch_id /// The watchpoint ID that owns this option set. /// - /// @return + /// \return /// The callback return value. - //------------------------------------------------------------------ bool InvokeCallback(StoppointCallbackContext *context, lldb::user_id_t watch_id); - //------------------------------------------------------------------ /// Used in InvokeCallback to tell whether it is the right time to run this /// kind of callback. /// - /// @return + /// \return /// The synchronicity of our callback. - //------------------------------------------------------------------ bool IsCallbackSynchronous() { return m_callback_is_synchronous; } - //------------------------------------------------------------------ /// Fetch the baton from the callback. /// - /// @return + /// \return /// The baton. - //------------------------------------------------------------------ Baton *GetBaton(); - //------------------------------------------------------------------ /// Fetch a const version of the baton from the callback. /// - /// @return + /// \return /// The baton. - //------------------------------------------------------------------ const Baton *GetBaton() const; - //------------------------------------------------------------------ /// Return the current thread spec for this option. This will return nullptr /// if the no thread specifications have been set for this Option yet. - /// @return + /// \return /// The thread specification pointer for this option, or nullptr if none /// has /// been set yet. - //------------------------------------------------------------------ const ThreadSpec *GetThreadSpecNoCreate() const; - //------------------------------------------------------------------ /// Returns a pointer to the ThreadSpec for this option, creating it. if it /// hasn't been created already. This API is used for setting the /// ThreadSpec items for this option. - //------------------------------------------------------------------ ThreadSpec *GetThreadSpec(); void SetThreadID(lldb::tid_t thread_id); void GetDescription(Stream *s, lldb::DescriptionLevel level) const; - //------------------------------------------------------------------ /// Get description for callback only. - //------------------------------------------------------------------ void GetCallbackDescription(Stream *s, lldb::DescriptionLevel level) const; - //------------------------------------------------------------------ /// Returns true if the watchpoint option has a callback set. - //------------------------------------------------------------------ bool HasCallback(); - //------------------------------------------------------------------ /// This is the default empty callback. - /// @return + /// \return /// The thread id for which the watchpoint hit will stop, /// LLDB_INVALID_THREAD_ID for all threads. - //------------------------------------------------------------------ static bool NullCallback(void *baton, StoppointCallbackContext *context, lldb::user_id_t watch_id); @@ -219,19 +184,15 @@ public: }; protected: - //------------------------------------------------------------------ // Classes that inherit from WatchpointOptions can see and modify these - //------------------------------------------------------------------ private: - //------------------------------------------------------------------ // For WatchpointOptions only - //------------------------------------------------------------------ WatchpointHitCallback m_callback; // This is the callback function pointer lldb::BatonSP m_callback_baton_sp; // This is the client data for the callback bool m_callback_is_synchronous; std::unique_ptr<ThreadSpec> - m_thread_spec_ap; // Thread for which this watchpoint will take + m_thread_spec_up; // Thread for which this watchpoint will take }; } // namespace lldb_private |