diff options
Diffstat (limited to 'include/lldb/API/SBProcess.h')
-rw-r--r-- | include/lldb/API/SBProcess.h | 97 |
1 files changed, 31 insertions, 66 deletions
diff --git a/include/lldb/API/SBProcess.h b/include/lldb/API/SBProcess.h index 69cf8b4ce854..863cb3ced674 100644 --- a/include/lldb/API/SBProcess.h +++ b/include/lldb/API/SBProcess.h @@ -1,9 +1,8 @@ //===-- SBProcess.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 // //===----------------------------------------------------------------------===// @@ -23,9 +22,7 @@ class SBEvent; class LLDB_API SBProcess { public: - //------------------------------------------------------------------ /// Broadcaster event bits definitions. - //------------------------------------------------------------------ FLAGS_ANONYMOUS_ENUM(){eBroadcastBitStateChanged = (1 << 0), eBroadcastBitInterrupt = (1 << 1), eBroadcastBitSTDOUT = (1 << 2), @@ -52,6 +49,8 @@ public: void Clear(); + explicit operator bool() const; + bool IsValid() const; lldb::SBTarget GetTarget() const; @@ -71,11 +70,9 @@ public: void AppendEventStateReport(const lldb::SBEvent &event, lldb::SBCommandReturnObject &result); - //------------------------------------------------------------------ /// Remote connection related functions. These will fail if the /// process is not in eStateConnected. They are intended for use /// when connecting to an externally managed debugserver instance. - //------------------------------------------------------------------ bool RemoteAttachToProcessWithID(lldb::pid_t pid, lldb::SBError &error); bool RemoteLaunch(char const **argv, char const **envp, @@ -84,9 +81,7 @@ public: uint32_t launch_flags, bool stop_at_entry, lldb::SBError &error); - //------------------------------------------------------------------ // Thread related functions - //------------------------------------------------------------------ uint32_t GetNumThreads(); lldb::SBThread GetThreadAtIndex(size_t index); @@ -97,12 +92,10 @@ public: lldb::SBThread GetSelectedThread() const; - //------------------------------------------------------------------ // Function for lazily creating a thread using the current OS plug-in. This // function will be removed in the future when there are APIs to create // SBThread objects through the interface and add them to the process through // the SBProcess API. - //------------------------------------------------------------------ lldb::SBThread CreateOSPluginThread(lldb::tid_t tid, lldb::addr_t context); bool SetSelectedThread(const lldb::SBThread &thread); @@ -111,16 +104,12 @@ public: bool SetSelectedThreadByIndexID(uint32_t index_id); - //------------------------------------------------------------------ // Queue related functions - //------------------------------------------------------------------ uint32_t GetNumQueues(); lldb::SBQueue GetQueueAtIndex(size_t index); - //------------------------------------------------------------------ // Stepping related functions - //------------------------------------------------------------------ lldb::StateType GetState(); @@ -128,7 +117,6 @@ public: const char *GetExitDescription(); - //------------------------------------------------------------------ /// Gets the process ID /// /// Returns the process identifier for the process as it is known @@ -136,15 +124,13 @@ public: /// this is typically the same as if you called "getpid()" in the /// process. /// - /// @return + /// \return /// Returns LLDB_INVALID_PROCESS_ID if this object does not /// contain a valid process object, or if the process has not /// been launched. Returns a valid process ID if the process is /// valid. - //------------------------------------------------------------------ lldb::pid_t GetProcessID(); - //------------------------------------------------------------------ /// Gets the unique ID associated with this process object /// /// Unique IDs start at 1 and increment up with each new process @@ -152,11 +138,10 @@ public: /// create a process with the same process ID, there needs to be a /// way to tell two process instances apart. /// - /// @return + /// \return /// Returns a non-zero integer ID if this object contains a /// valid process object, zero if this object does not contain /// a valid process object. - //------------------------------------------------------------------ uint32_t GetUniqueID(); uint32_t GetAddressByteSize() const; @@ -181,18 +166,16 @@ public: uint32_t GetStopID(bool include_expression_stops = false); - //------------------------------------------------------------------ /// Gets the stop event corresponding to stop ID. // /// Note that it wasn't fully implemented and tracks only the stop /// event for the last natural stop ID. /// - /// @param [in] stop_id + /// \param [in] stop_id /// The ID of the stop event to return. /// - /// @return + /// \return /// The stop event corresponding to stop ID. - //------------------------------------------------------------------ lldb::SBEvent GetStopEventForStopID(uint32_t stop_id); size_t ReadMemory(addr_t addr, void *buf, size_t size, lldb::SBError &error); @@ -235,10 +218,9 @@ public: bool GetDescription(lldb::SBStream &description); - //------------------------------------------------------------------ /// Start Tracing with the given SBTraceOptions. /// - /// @param[in] options + /// \param[in] options /// Class containing trace options like trace buffer size, meta /// data buffer size, TraceType and any custom parameters /// {formatted as a JSON Dictionary}. In case of errors in @@ -253,95 +235,88 @@ public: /// parameters, only the parameters recognized by the target /// would be used and others would be ignored. /// - /// @param[out] error + /// \param[out] error /// An error explaining what went wrong. /// - /// @return + /// \return /// A SBTrace instance, which should be used /// to get the trace data or other trace related operations. - //------------------------------------------------------------------ lldb::SBTrace StartTrace(SBTraceOptions &options, lldb::SBError &error); uint32_t GetNumSupportedHardwareWatchpoints(lldb::SBError &error) const; - //------------------------------------------------------------------ /// Load a shared library into this process. /// - /// @param[in] remote_image_spec + /// \param[in] remote_image_spec /// The path for the shared library on the target what you want /// to load. /// - /// @param[out] error + /// \param[out] error /// An error object that gets filled in with any errors that /// might occur when trying to load the shared library. /// - /// @return + /// \return /// A token that represents the shared library that can be /// later used to unload the shared library. A value of /// LLDB_INVALID_IMAGE_TOKEN will be returned if the shared /// library can't be opened. - //------------------------------------------------------------------ uint32_t LoadImage(lldb::SBFileSpec &remote_image_spec, lldb::SBError &error); - //------------------------------------------------------------------ /// Load a shared library into this process. /// - /// @param[in] local_image_spec + /// \param[in] local_image_spec /// The file spec that points to the shared library that you /// want to load if the library is located on the host. The /// library will be copied over to the location specified by /// remote_image_spec or into the current working directory with /// the same filename if the remote_image_spec isn't specified. /// - /// @param[in] remote_image_spec + /// \param[in] remote_image_spec /// If local_image_spec is specified then the location where the /// library should be copied over from the host. If /// local_image_spec isn't specified, then the path for the /// shared library on the target what you want to load. /// - /// @param[out] error + /// \param[out] error /// An error object that gets filled in with any errors that /// might occur when trying to load the shared library. /// - /// @return + /// \return /// A token that represents the shared library that can be /// later used to unload the shared library. A value of /// LLDB_INVALID_IMAGE_TOKEN will be returned if the shared /// library can't be opened. - //------------------------------------------------------------------ uint32_t LoadImage(const lldb::SBFileSpec &local_image_spec, const lldb::SBFileSpec &remote_image_spec, lldb::SBError &error); - //------------------------------------------------------------------ /// Load a shared library into this process, starting with a /// library name and a list of paths, searching along the list of /// paths till you find a matching library. /// - /// @param[in] image_spec + /// \param[in] image_spec /// The name of the shared library that you want to load. /// If image_spec is a relative path, the relative path will be /// appended to the search paths. /// If the image_spec is an absolute path, just the basename is used. /// - /// @param[in] paths + /// \param[in] paths /// A list of paths to search for the library whose basename is /// local_spec. /// - /// @param[out] loaded_path + /// \param[out] loaded_path /// If the library was found along the paths, this will store the /// full path to the found library. /// - /// @param[out] error + /// \param[out] error /// An error object that gets filled in with any errors that /// might occur when trying to search for the shared library. /// - /// @return + /// \return /// A token that represents the shared library that can be /// later passed to UnloadImage. A value of /// LLDB_INVALID_IMAGE_TOKEN will be returned if the shared /// library can't be opened. - //------------------------------------------------------------------ uint32_t LoadImageUsingPaths(const lldb::SBFileSpec &image_spec, SBStringList &paths, lldb::SBFileSpec &loaded_path, @@ -351,7 +326,6 @@ public: lldb::SBError SendEventData(const char *data); - //------------------------------------------------------------------ /// Return the number of different thread-origin extended backtraces /// this process can support. /// @@ -360,25 +334,22 @@ public: /// or the work item was enqueued to it (in the case of a libdispatch /// queue). /// - /// @return + /// \return /// The number of thread-origin extended backtrace types that may be /// available. - //------------------------------------------------------------------ uint32_t GetNumExtendedBacktraceTypes(); - //------------------------------------------------------------------ /// Return the name of one of the thread-origin extended backtrace /// methods. /// - /// @param [in] idx + /// \param [in] idx /// The index of the name to return. They will be returned in /// the order that the user will most likely want to see them. /// e.g. if the type at index 0 is not available for a thread, /// see if the type at index 1 provides an extended backtrace. /// - /// @return + /// \return /// The name at that index. - //------------------------------------------------------------------ const char *GetExtendedBacktraceTypeAtIndex(uint32_t idx); lldb::SBThreadCollection GetHistoryThreads(addr_t addr); @@ -388,40 +359,34 @@ public: /// Save the state of the process in a core file (or mini dump on Windows). lldb::SBError SaveCore(const char *file_name); - //------------------------------------------------------------------ /// Query the address load_addr and store the details of the memory /// region that contains it in the supplied SBMemoryRegionInfo object. /// To iterate over all memory regions use GetMemoryRegionList. /// - /// @param[in] load_addr + /// \param[in] load_addr /// The address to be queried. /// - /// @param[out] region_info + /// \param[out] region_info /// A reference to an SBMemoryRegionInfo object that will contain /// the details of the memory region containing load_addr. /// - /// @return + /// \return /// An error object describes any errors that occurred while /// querying load_addr. - //------------------------------------------------------------------ lldb::SBError GetMemoryRegionInfo(lldb::addr_t load_addr, lldb::SBMemoryRegionInfo ®ion_info); - //------------------------------------------------------------------ /// Return the list of memory regions within the process. /// - /// @return + /// \return /// A list of all witin the process memory regions. - //------------------------------------------------------------------ lldb::SBMemoryRegionInfoList GetMemoryRegions(); - //------------------------------------------------------------------ /// Return information about the process. /// /// Valid process info will only be returned when the process is /// alive, use SBProcessInfo::IsValid() to check returned info is /// valid. - //------------------------------------------------------------------ lldb::SBProcessInfo GetProcessInfo(); protected: |