diff options
1714 files changed, 48380 insertions, 46824 deletions
diff --git a/LICENSE.TXT b/LICENSE.TXT index 1f0309419d78..029b1d9aae1d 100644 --- a/LICENSE.TXT +++ b/LICENSE.TXT @@ -1,3 +1,241 @@ +============================================================================== +The LLVM Project is under the Apache License v2.0 with LLVM Exceptions: +============================================================================== + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +---- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. + +============================================================================== +Software from third parties included in the LLVM Project: +============================================================================== +The LLVM Project contains third party software which is under different license +terms. All such code will be identified clearly using at least one of two +mechanisms: +1) It will be in a separate directory tree with its own `LICENSE.txt` or + `LICENSE` file at the top containing the specific license and restrictions + which apply to that software, or +2) It will contain specific license and restriction terms at the top of every + file. + +============================================================================== +Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy): +============================================================================== University of Illinois/NCSA Open Source License diff --git a/include/lldb/API/LLDB.h b/include/lldb/API/LLDB.h index 2b3dd96aef0e..0806ab700a94 100644 --- a/include/lldb/API/LLDB.h +++ b/include/lldb/API/LLDB.h @@ -1,9 +1,8 @@ //===-- LLDB.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 // //===----------------------------------------------------------------------===// @@ -49,6 +48,7 @@ #include "lldb/API/SBProcessInfo.h" #include "lldb/API/SBQueue.h" #include "lldb/API/SBQueueItem.h" +#include "lldb/API/SBReproducer.h" #include "lldb/API/SBSection.h" #include "lldb/API/SBSourceManager.h" #include "lldb/API/SBStream.h" diff --git a/include/lldb/API/SBAddress.h b/include/lldb/API/SBAddress.h index 891324254cd6..2874a3602af2 100644 --- a/include/lldb/API/SBAddress.h +++ b/include/lldb/API/SBAddress.h @@ -1,9 +1,8 @@ //===-- SBAddress.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 // //===----------------------------------------------------------------------===// @@ -30,6 +29,12 @@ public: const lldb::SBAddress &operator=(const lldb::SBAddress &rhs); + explicit operator bool() const; + + // operator== is a free function + + bool operator!=(const SBAddress &rhs) const; + bool IsValid() const; void Clear(); @@ -115,7 +120,7 @@ protected: void SetAddress(const lldb_private::Address *lldb_object_ptr); private: - std::unique_ptr<lldb_private::Address> m_opaque_ap; + std::unique_ptr<lldb_private::Address> m_opaque_up; }; bool LLDB_API operator==(const SBAddress &lhs, const SBAddress &rhs); diff --git a/include/lldb/API/SBAttachInfo.h b/include/lldb/API/SBAttachInfo.h index 7ae006908ccc..3c20a08cb4a9 100644 --- a/include/lldb/API/SBAttachInfo.h +++ b/include/lldb/API/SBAttachInfo.h @@ -1,9 +1,8 @@ //===-- SBAttachInfo.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 // //===----------------------------------------------------------------------===// @@ -22,35 +21,32 @@ public: SBAttachInfo(lldb::pid_t pid); - //------------------------------------------------------------------ /// Attach to a process by name. /// /// This function implies that a future call to SBTarget::Attach(...) /// will be synchronous. /// - /// @param[in] path + /// \param[in] path /// A full or partial name for the process to attach to. /// - /// @param[in] wait_for + /// \param[in] wait_for /// If \b false, attach to an existing process whose name matches. /// If \b true, then wait for the next process whose name matches. - //------------------------------------------------------------------ SBAttachInfo(const char *path, bool wait_for); - //------------------------------------------------------------------ /// Attach to a process by name. /// /// Future calls to SBTarget::Attach(...) will be synchronous or /// asynchronous depending on the \a async argument. /// - /// @param[in] path + /// \param[in] path /// A full or partial name for the process to attach to. /// - /// @param[in] wait_for + /// \param[in] wait_for /// If \b false, attach to an existing process whose name matches. /// If \b true, then wait for the next process whose name matches. /// - /// @param[in] async + /// \param[in] async /// If \b false, then the SBTarget::Attach(...) call will be a /// synchronous call with no way to cancel the attach in /// progress. @@ -60,7 +56,6 @@ public: /// eventually found. If the client wants to cancel the event, /// SBProcess::Stop() can be called and an eStateExited process /// event will be delivered. - //------------------------------------------------------------------ SBAttachInfo(const char *path, bool wait_for, bool async); SBAttachInfo(const SBAttachInfo &rhs); @@ -79,31 +74,28 @@ public: bool GetWaitForLaunch(); - //------------------------------------------------------------------ /// Set attach by process name settings. /// /// Designed to be used after a call to SBAttachInfo::SetExecutable(). /// This function implies that a call to SBTarget::Attach(...) will /// be synchronous. /// - /// @param[in] b + /// \param[in] b /// If \b false, attach to an existing process whose name matches. /// If \b true, then wait for the next process whose name matches. - //------------------------------------------------------------------ void SetWaitForLaunch(bool b); - //------------------------------------------------------------------ /// Set attach by process name settings. /// /// Designed to be used after a call to SBAttachInfo::SetExecutable(). /// Future calls to SBTarget::Attach(...) will be synchronous or /// asynchronous depending on the \a async argument. /// - /// @param[in] b + /// \param[in] b /// If \b false, attach to an existing process whose name matches. /// If \b true, then wait for the next process whose name matches. /// - /// @param[in] async + /// \param[in] async /// If \b false, then the SBTarget::Attach(...) call will be a /// synchronous call with no way to cancel the attach in /// progress. @@ -113,7 +105,6 @@ public: /// eventually found. If the client wants to cancel the event, /// SBProcess::Stop() can be called and an eStateExited process /// event will be delivered. - //------------------------------------------------------------------ void SetWaitForLaunch(bool b, bool async); bool GetIgnoreExisting(); @@ -158,23 +149,19 @@ public: bool ParentProcessIDIsValid(); - //---------------------------------------------------------------------- /// Get the listener that will be used to receive process events. /// /// If no listener has been set via a call to /// SBAttachInfo::SetListener(), then an invalid SBListener will be /// returned (SBListener::IsValid() will return false). If a listener /// has been set, then the valid listener object will be returned. - //---------------------------------------------------------------------- SBListener GetListener(); - //---------------------------------------------------------------------- /// Set the listener that will be used to receive process events. /// /// By default the SBDebugger, which has a listener, that the SBTarget /// belongs to will listen for the process events. Calling this function /// allows a different listener to be used to listen for process events. - //---------------------------------------------------------------------- void SetListener(SBListener &listener); protected: diff --git a/include/lldb/API/SBBlock.h b/include/lldb/API/SBBlock.h index 112de9673423..0ca92ff0c6ac 100644 --- a/include/lldb/API/SBBlock.h +++ b/include/lldb/API/SBBlock.h @@ -1,9 +1,8 @@ //===-- SBBlock.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 // //===----------------------------------------------------------------------===// @@ -29,6 +28,8 @@ public: bool IsInlined() const; + explicit operator bool() const; + bool IsValid() const; const char *GetInlinedName() const; @@ -59,16 +60,14 @@ public: lldb::SBValueList GetVariables(lldb::SBTarget &target, bool arguments, bool locals, bool statics); - //------------------------------------------------------------------ /// Get the inlined block that contains this block. /// - /// @return + /// \return /// If this block is inlined, it will return this block, else /// parent blocks will be searched to see if any contain this /// block and are themselves inlined. An invalid SBBlock will /// be returned if this block nor any parent blocks are inlined /// function blocks. - //------------------------------------------------------------------ lldb::SBBlock GetContainingInlinedBlock(); bool GetDescription(lldb::SBStream &description); diff --git a/include/lldb/API/SBBreakpoint.h b/include/lldb/API/SBBreakpoint.h index 2c93bf103e3e..75c0e69a4821 100644 --- a/include/lldb/API/SBBreakpoint.h +++ b/include/lldb/API/SBBreakpoint.h @@ -1,9 +1,8 @@ //===-- SBBreakpoint.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 // //===----------------------------------------------------------------------===// @@ -37,6 +36,8 @@ public: break_id_t GetID() const; + explicit operator bool() const; + bool IsValid() const; void ClearAllBreakpointSites(); diff --git a/include/lldb/API/SBBreakpointLocation.h b/include/lldb/API/SBBreakpointLocation.h index 4b34bcbf1f28..085bed9399b9 100644 --- a/include/lldb/API/SBBreakpointLocation.h +++ b/include/lldb/API/SBBreakpointLocation.h @@ -1,9 +1,8 @@ //===-- SBBreakpointLocation.h ----------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -28,6 +27,8 @@ public: break_id_t GetID(); + explicit operator bool() const; + bool IsValid() const; lldb::SBAddress GetAddress(); diff --git a/include/lldb/API/SBBreakpointName.h b/include/lldb/API/SBBreakpointName.h index 321f0d784d6f..018238bcd074 100644 --- a/include/lldb/API/SBBreakpointName.h +++ b/include/lldb/API/SBBreakpointName.h @@ -1,9 +1,8 @@ //===-- SBBreakpointName.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 // //===----------------------------------------------------------------------===// @@ -40,6 +39,8 @@ public: bool operator!=(const lldb::SBBreakpointName &rhs); + explicit operator bool() const; + bool IsValid() const; const char *GetName() const; diff --git a/include/lldb/API/SBBroadcaster.h b/include/lldb/API/SBBroadcaster.h index dc6c50ec0a8a..fc5e8880e9f2 100644 --- a/include/lldb/API/SBBroadcaster.h +++ b/include/lldb/API/SBBroadcaster.h @@ -1,9 +1,8 @@ //===-- SBBroadcaster.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 // //===----------------------------------------------------------------------===// @@ -26,6 +25,8 @@ public: ~SBBroadcaster(); + explicit operator bool() const; + bool IsValid() const; void Clear(); diff --git a/include/lldb/API/SBCommandInterpreter.h b/include/lldb/API/SBCommandInterpreter.h index f98894478811..6c80e8eb26dc 100644 --- a/include/lldb/API/SBCommandInterpreter.h +++ b/include/lldb/API/SBCommandInterpreter.h @@ -1,9 +1,8 @@ //===-- SBCommandInterpreter.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 // //===----------------------------------------------------------------------===// @@ -88,6 +87,8 @@ public: static bool EventIsCommandInterpreterEvent(const lldb::SBEvent &event); + explicit operator bool() const; + bool IsValid() const; bool CommandExists(const char *cmd); @@ -189,16 +190,13 @@ public: lldb_private::CommandInterpreter *interpreter_ptr = nullptr); // Access using SBDebugger::GetCommandInterpreter(); - //---------------------------------------------------------------------- /// Return true if the command interpreter is the active IO handler. /// /// This indicates that any input coming into the debugger handles will /// go to the command interpreter and will result in LLDB command line /// commands being executed. - //---------------------------------------------------------------------- bool IsActive(); - //---------------------------------------------------------------------- /// Get the string that needs to be written to the debugger stdin file /// handle when a control character is typed. /// @@ -207,43 +205,34 @@ public: /// terminal, so this function allows GUI programs to emulate this /// functionality. /// - /// @param[in] ch + /// \param[in] ch /// The character that was typed along with the control key /// - /// @return + /// \return /// The string that should be written into the file handle that is /// feeding the input stream for the debugger, or nullptr if there is /// no string for this control key. - //---------------------------------------------------------------------- const char *GetIOHandlerControlSequence(char ch); bool GetPromptOnQuit(); void SetPromptOnQuit(bool b); - //---------------------------------------------------------------------- /// Sets whether the command interpreter should allow custom exit codes /// for the 'quit' command. - //---------------------------------------------------------------------- void AllowExitCodeOnQuit(bool allow); - //---------------------------------------------------------------------- /// Returns true if the user has called the 'quit' command with a custom exit /// code. - //---------------------------------------------------------------------- bool HasCustomQuitExitCode(); - //---------------------------------------------------------------------- /// Returns the exit code that the user has specified when running the /// 'quit' command. Returns 0 if the user hasn't called 'quit' at all or /// without a custom exit code. - //---------------------------------------------------------------------- int GetQuitStatus(); - //---------------------------------------------------------------------- /// Resolve the command just as HandleCommand would, expanding abbreviations /// and aliases. If successful, result->GetOutput has the full expansion. - //---------------------------------------------------------------------- void ResolveCommand(const char *command_line, SBCommandReturnObject &result); protected: @@ -256,8 +245,6 @@ protected: private: friend class SBDebugger; - static void InitializeSWIG(); - lldb_private::CommandInterpreter *m_opaque_ptr; }; @@ -275,6 +262,8 @@ class SBCommand { public: SBCommand(); + explicit operator bool() const; + bool IsValid(); const char *GetName(); diff --git a/include/lldb/API/SBCommandReturnObject.h b/include/lldb/API/SBCommandReturnObject.h index 798aa92a7ef2..2877afb9b8b0 100644 --- a/include/lldb/API/SBCommandReturnObject.h +++ b/include/lldb/API/SBCommandReturnObject.h @@ -1,9 +1,8 @@ //===-- SBCommandReturnObject.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 // //===----------------------------------------------------------------------===// @@ -33,6 +32,8 @@ public: lldb_private::CommandReturnObject *Release(); + explicit operator bool() const; + bool IsValid() const; const char *GetOutput(); @@ -100,7 +101,7 @@ protected: void SetLLDBObjectPtr(lldb_private::CommandReturnObject *ptr); private: - std::unique_ptr<lldb_private::CommandReturnObject> m_opaque_ap; + std::unique_ptr<lldb_private::CommandReturnObject> m_opaque_up; }; } // namespace lldb diff --git a/include/lldb/API/SBCommunication.h b/include/lldb/API/SBCommunication.h index f0016275b634..5b803fc6017c 100644 --- a/include/lldb/API/SBCommunication.h +++ b/include/lldb/API/SBCommunication.h @@ -1,9 +1,8 @@ //===-- SBCommunication.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 // //===----------------------------------------------------------------------===// @@ -38,6 +37,8 @@ public: SBCommunication(const char *broadcaster_name); ~SBCommunication(); + explicit operator bool() const; + bool IsValid() const; lldb::SBBroadcaster GetBroadcaster(); diff --git a/include/lldb/API/SBCompileUnit.h b/include/lldb/API/SBCompileUnit.h index 4d5f9f36f246..b6b138207d60 100644 --- a/include/lldb/API/SBCompileUnit.h +++ b/include/lldb/API/SBCompileUnit.h @@ -1,9 +1,8 @@ //===-- SBCompileUnit.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 // //===----------------------------------------------------------------------===// @@ -25,6 +24,8 @@ public: const lldb::SBCompileUnit &operator=(const lldb::SBCompileUnit &rhs); + explicit operator bool() const; + bool IsValid() const; lldb::SBFileSpec GetFileSpec() const; @@ -47,11 +48,10 @@ public: uint32_t FindSupportFileIndex(uint32_t start_idx, const SBFileSpec &sb_file, bool full); - //------------------------------------------------------------------ /// Get all types matching \a type_mask from debug info in this /// compile unit. /// - /// @param[in] type_mask + /// \param[in] type_mask /// A bitfield that consists of one or more bits logically OR'ed /// together from the lldb::TypeClass enumeration. This allows /// you to request only structure types, or only class, struct @@ -59,9 +59,8 @@ public: /// all types found in the debug information for this compile /// unit. /// - /// @return + /// \return /// A list of types in this compile unit that match \a type_mask - //------------------------------------------------------------------ lldb::SBTypeList GetTypes(uint32_t type_mask = lldb::eTypeClassAny); lldb::LanguageType GetLanguage(); diff --git a/include/lldb/API/SBData.h b/include/lldb/API/SBData.h index 7ff619e68667..886fe829a469 100644 --- a/include/lldb/API/SBData.h +++ b/include/lldb/API/SBData.h @@ -1,9 +1,8 @@ //===-- SBData.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 // //===----------------------------------------------------------------------===// @@ -30,6 +29,8 @@ public: void Clear(); + explicit operator bool() const; + bool IsValid(); size_t GetByteSize(); diff --git a/include/lldb/API/SBDebugger.h b/include/lldb/API/SBDebugger.h index 3f31bf16da8d..417cead24a8c 100644 --- a/include/lldb/API/SBDebugger.h +++ b/include/lldb/API/SBDebugger.h @@ -1,9 +1,8 @@ //===-- SBDebugger.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 // //===----------------------------------------------------------------------===// @@ -13,7 +12,6 @@ #include <stdio.h> #include "lldb/API/SBDefines.h" -#include "lldb/API/SBInitializerOptions.h" #include "lldb/API/SBPlatform.h" namespace lldb { @@ -23,12 +21,12 @@ public: SBInputReader() = default; ~SBInputReader() = default; - SBError Initialize(lldb::SBDebugger &, - unsigned long (*)(void *, lldb::SBInputReader *, - lldb::InputReaderAction, char const *, - unsigned long), - void *, lldb::InputReaderGranularity, char const *, - char const *, bool); + SBError Initialize(lldb::SBDebugger &sb_debugger, + unsigned long (*callback)(void *, lldb::SBInputReader *, + lldb::InputReaderAction, + char const *, unsigned long), + void *a, lldb::InputReaderGranularity b, char const *c, + char const *d, bool e); void SetIsDone(bool); bool IsActive() const; }; @@ -46,7 +44,8 @@ public: lldb::SBDebugger &operator=(const lldb::SBDebugger &rhs); static void Initialize(); - static lldb::SBError Initialize(SBInitializerOptions &options); + + static lldb::SBError InitializeWithErrorHandling(); static void Terminate(); @@ -63,6 +62,8 @@ public: static void MemoryPressureDetected(); + explicit operator bool() const; + bool IsValid() const; void Clear(); @@ -150,7 +151,7 @@ public: /// Get the name and description of one of the available platforms. /// - /// @param[in] idx + /// \param[in] idx /// Zero-based index of the platform for which info should be retrieved, /// must be less than the value returned by GetNumAvailablePlatforms(). lldb::SBStructuredData GetAvailablePlatformInfoAtIndex(uint32_t idx); @@ -254,15 +255,11 @@ public: SBTypeFormat GetFormatForType(SBTypeNameSpecifier); -#ifndef LLDB_DISABLE_PYTHON SBTypeSummary GetSummaryForType(SBTypeNameSpecifier); -#endif SBTypeFilter GetFilterForType(SBTypeNameSpecifier); -#ifndef LLDB_DISABLE_PYTHON SBTypeSynthetic GetSyntheticForType(SBTypeNameSpecifier); -#endif void RunCommandInterpreter(bool auto_handle_events, bool spawn_thread); diff --git a/include/lldb/API/SBDeclaration.h b/include/lldb/API/SBDeclaration.h index 42cf76963847..d2b423e40fec 100644 --- a/include/lldb/API/SBDeclaration.h +++ b/include/lldb/API/SBDeclaration.h @@ -1,10 +1,9 @@ //===-- SBDeclaration.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 // //===----------------------------------------------------------------------===// @@ -26,6 +25,8 @@ public: const lldb::SBDeclaration &operator=(const lldb::SBDeclaration &rhs); + explicit operator bool() const; + bool IsValid() const; lldb::SBFileSpec GetFileSpec() const; @@ -62,7 +63,7 @@ private: void SetDeclaration(const lldb_private::Declaration &lldb_object_ref); - std::unique_ptr<lldb_private::Declaration> m_opaque_ap; + std::unique_ptr<lldb_private::Declaration> m_opaque_up; }; } // namespace lldb diff --git a/include/lldb/API/SBDefines.h b/include/lldb/API/SBDefines.h index c5c9851272f2..838c84cece6d 100644 --- a/include/lldb/API/SBDefines.h +++ b/include/lldb/API/SBDefines.h @@ -1,9 +1,8 @@ //===-- SBDefines.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 // //===----------------------------------------------------------------------===// @@ -17,10 +16,6 @@ #include "lldb/lldb-types.h" #include "lldb/lldb-versioning.h" -#ifdef SWIG -#define LLDB_API -#endif - // Forward Declarations namespace lldb { @@ -51,7 +46,6 @@ class LLDB_API SBFileSpecList; class LLDB_API SBFrame; class LLDB_API SBFunction; class LLDB_API SBHostOS; -class LLDB_API SBInitializerOptions; class LLDB_API SBInstruction; class LLDB_API SBInstructionList; class LLDB_API SBLanguageRuntime; diff --git a/include/lldb/API/SBError.h b/include/lldb/API/SBError.h index a27d2d042690..b076f87b7669 100644 --- a/include/lldb/API/SBError.h +++ b/include/lldb/API/SBError.h @@ -1,9 +1,8 @@ //===-- SBError.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 // //===----------------------------------------------------------------------===// @@ -47,27 +46,30 @@ public: int SetErrorStringWithFormat(const char *format, ...) __attribute__((format(printf, 2, 3))); + explicit operator bool() const; + bool IsValid() const; bool GetDescription(lldb::SBStream &description); protected: + friend class SBBreakpoint; + friend class SBBreakpointLocation; + friend class SBBreakpointName; friend class SBCommandReturnObject; + friend class SBCommunication; friend class SBData; friend class SBDebugger; - friend class SBCommunication; friend class SBHostOS; friend class SBPlatform; friend class SBProcess; + friend class SBReproducer; friend class SBStructuredData; + friend class SBTarget; friend class SBThread; friend class SBTrace; - friend class SBTarget; friend class SBValue; friend class SBWatchpoint; - friend class SBBreakpoint; - friend class SBBreakpointLocation; - friend class SBBreakpointName; lldb_private::Status *get(); @@ -80,7 +82,7 @@ protected: void SetError(const lldb_private::Status &lldb_error); private: - std::unique_ptr<lldb_private::Status> m_opaque_ap; + std::unique_ptr<lldb_private::Status> m_opaque_up; void CreateIfNeeded(); }; diff --git a/include/lldb/API/SBEvent.h b/include/lldb/API/SBEvent.h index ff15716d853e..d297cbeff671 100644 --- a/include/lldb/API/SBEvent.h +++ b/include/lldb/API/SBEvent.h @@ -1,9 +1,8 @@ //===-- SBEvent.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 // //===----------------------------------------------------------------------===// @@ -36,6 +35,8 @@ public: const SBEvent &operator=(const lldb::SBEvent &rhs); + explicit operator bool() const; + bool IsValid() const; const char *GetDataFlavor(); diff --git a/include/lldb/API/SBExecutionContext.h b/include/lldb/API/SBExecutionContext.h index c19d539bc80a..45c0b1b7f97b 100644 --- a/include/lldb/API/SBExecutionContext.h +++ b/include/lldb/API/SBExecutionContext.h @@ -1,10 +1,9 @@ //===-- SBExecutionContext.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 // //===----------------------------------------------------------------------===// @@ -51,8 +50,6 @@ public: SBFrame GetFrame() const; protected: - ExecutionContextRefSP &GetSP() const; - void reset(lldb::ExecutionContextRefSP &event_sp); lldb_private::ExecutionContextRef *get() const; diff --git a/include/lldb/API/SBExpressionOptions.h b/include/lldb/API/SBExpressionOptions.h index b861436caf98..04cd74f730f2 100644 --- a/include/lldb/API/SBExpressionOptions.h +++ b/include/lldb/API/SBExpressionOptions.h @@ -1,9 +1,8 @@ -//===-- SBEvent.h -----------------------------------------------*- C++ -*-===// +//===-- SBExpressionOptions.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 // //===----------------------------------------------------------------------===// @@ -90,17 +89,14 @@ public: bool GetTopLevel(); void SetTopLevel(bool b = true); - + // Gets whether we will JIT an expression if it cannot be interpreted bool GetAllowJIT(); - + // Sets whether we will JIT an expression if it cannot be interpreted void SetAllowJIT(bool allow); protected: - SBExpressionOptions( - lldb_private::EvaluateExpressionOptions &expression_options); - lldb_private::EvaluateExpressionOptions *get() const; lldb_private::EvaluateExpressionOptions &ref() const; @@ -111,7 +107,7 @@ protected: private: // This auto_pointer is made in the constructor and is always valid. - mutable std::unique_ptr<lldb_private::EvaluateExpressionOptions> m_opaque_ap; + mutable std::unique_ptr<lldb_private::EvaluateExpressionOptions> m_opaque_up; }; } // namespace lldb diff --git a/include/lldb/API/SBFileSpec.h b/include/lldb/API/SBFileSpec.h index 9ad1a5df0cfa..27149775901e 100644 --- a/include/lldb/API/SBFileSpec.h +++ b/include/lldb/API/SBFileSpec.h @@ -1,9 +1,8 @@ //===-- SBFileSpec.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 // //===----------------------------------------------------------------------===// @@ -29,6 +28,12 @@ public: const SBFileSpec &operator=(const lldb::SBFileSpec &rhs); + explicit operator bool() const; + + bool operator==(const SBFileSpec &rhs) const; + + bool operator!=(const SBFileSpec &rhs) const; + bool IsValid() const; bool Exists() const; @@ -59,7 +64,6 @@ private: friend class SBDeclaration; friend class SBFileSpecList; friend class SBHostOS; - friend class SBInitializerOptions; friend class SBLaunchInfo; friend class SBLineEntry; friend class SBModule; @@ -83,7 +87,7 @@ private: const lldb_private::FileSpec &ref() const; - std::unique_ptr<lldb_private::FileSpec> m_opaque_ap; + std::unique_ptr<lldb_private::FileSpec> m_opaque_up; }; } // namespace lldb diff --git a/include/lldb/API/SBFileSpecList.h b/include/lldb/API/SBFileSpecList.h index 97f843adbb5f..5a131509d269 100644 --- a/include/lldb/API/SBFileSpecList.h +++ b/include/lldb/API/SBFileSpecList.h @@ -1,10 +1,9 @@ //===-- SBFileSpecList.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 // //===----------------------------------------------------------------------===// @@ -50,7 +49,7 @@ private: const lldb_private::FileSpecList &ref() const; - std::unique_ptr<lldb_private::FileSpecList> m_opaque_ap; + std::unique_ptr<lldb_private::FileSpecList> m_opaque_up; }; } // namespace lldb diff --git a/include/lldb/API/SBFrame.h b/include/lldb/API/SBFrame.h index 1123dade5de2..b213f8985510 100644 --- a/include/lldb/API/SBFrame.h +++ b/include/lldb/API/SBFrame.h @@ -1,9 +1,8 @@ //===-- SBFrame.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 // //===----------------------------------------------------------------------===// @@ -27,6 +26,8 @@ public: bool IsEqual(const lldb::SBFrame &that) const; + explicit operator bool() const; + bool IsValid() const; uint32_t GetFrameID() const; diff --git a/include/lldb/API/SBFunction.h b/include/lldb/API/SBFunction.h index 23da02102cfb..43f01d7e57de 100644 --- a/include/lldb/API/SBFunction.h +++ b/include/lldb/API/SBFunction.h @@ -1,9 +1,8 @@ //===-- SBFunction.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 // //===----------------------------------------------------------------------===// @@ -26,6 +25,8 @@ public: ~SBFunction(); + explicit operator bool() const; + bool IsValid() const; const char *GetName() const; diff --git a/include/lldb/API/SBHostOS.h b/include/lldb/API/SBHostOS.h index 1671917f865c..ecd7920f2c14 100644 --- a/include/lldb/API/SBHostOS.h +++ b/include/lldb/API/SBHostOS.h @@ -1,9 +1,8 @@ //===-- SBHostOS.h ----------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/include/lldb/API/SBInitializerOptions.h b/include/lldb/API/SBInitializerOptions.h deleted file mode 100644 index 184c82df4f86..000000000000 --- a/include/lldb/API/SBInitializerOptions.h +++ /dev/null @@ -1,43 +0,0 @@ -//===-- SBInitializerOptions.h ----------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLDB_SBInitializerOptuions_h_ -#define LLDB_SBInitializerOptuions_h_ - -#include "lldb/API/SBDefines.h" -#include "lldb/API/SBFileSpec.h" - -namespace lldb_private { -struct InitializerOptions; -} - -namespace lldb { - -class LLDB_API SBInitializerOptions { -public: - SBInitializerOptions(); - SBInitializerOptions(const lldb::SBInitializerOptions &rhs); - ~SBInitializerOptions(); - const SBInitializerOptions &operator=(const lldb::SBInitializerOptions &rhs); - - void SetCaptureReproducer(bool b); - void SetReplayReproducer(bool b); - void SetReproducerPath(const char *path); - - lldb_private::InitializerOptions &ref() const; - -private: - friend class SBDebugger; - - std::unique_ptr<lldb_private::InitializerOptions> m_opaque_up; -}; - -} // namespace lldb - -#endif // LLDB_SBInitializerOptuions_h_ diff --git a/include/lldb/API/SBInstruction.h b/include/lldb/API/SBInstruction.h index 5ef02b8f696a..0bb587795607 100644 --- a/include/lldb/API/SBInstruction.h +++ b/include/lldb/API/SBInstruction.h @@ -1,9 +1,8 @@ //===-- SBInstruction.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 // //===----------------------------------------------------------------------===// @@ -32,6 +31,8 @@ public: ~SBInstruction(); + explicit operator bool() const; + bool IsValid(); SBAddress GetAddress(); diff --git a/include/lldb/API/SBInstructionList.h b/include/lldb/API/SBInstructionList.h index c8fed5c83192..4434d50f471f 100644 --- a/include/lldb/API/SBInstructionList.h +++ b/include/lldb/API/SBInstructionList.h @@ -1,9 +1,8 @@ //===-- SBInstructionList.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 // //===----------------------------------------------------------------------===// @@ -26,17 +25,17 @@ public: ~SBInstructionList(); + explicit operator bool() const; + bool IsValid() const; size_t GetSize(); lldb::SBInstruction GetInstructionAtIndex(uint32_t idx); - // ---------------------------------------------------------------------- // Returns the number of instructions between the start and end address. If // canSetBreakpoint is true then the count will be the number of // instructions on which a breakpoint can be set. - // ---------------------------------------------------------------------- size_t GetInstructionsCount(const SBAddress &start, const SBAddress &end, bool canSetBreakpoint = false); diff --git a/include/lldb/API/SBLanguageRuntime.h b/include/lldb/API/SBLanguageRuntime.h index 3912f352491b..d28c441593ea 100644 --- a/include/lldb/API/SBLanguageRuntime.h +++ b/include/lldb/API/SBLanguageRuntime.h @@ -1,9 +1,8 @@ //===-- SBLanguageRuntime.h -------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/include/lldb/API/SBLaunchInfo.h b/include/lldb/API/SBLaunchInfo.h index 80eea7e42921..c7b381ffdf97 100644 --- a/include/lldb/API/SBLaunchInfo.h +++ b/include/lldb/API/SBLaunchInfo.h @@ -1,9 +1,8 @@ //===-- SBLaunchInfo.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 // //===----------------------------------------------------------------------===// @@ -43,7 +42,6 @@ public: SBFileSpec GetExecutableFile(); - //---------------------------------------------------------------------- /// Set the executable file that will be used to launch the process and /// optionally set it as the first argument in the argument vector. /// @@ -58,33 +56,28 @@ public: /// SBTarget::Launch(...), the target will use the resolved executable /// path that was used to create the target. /// - /// @param[in] exe_file + /// \param[in] exe_file /// The override path to use when launching the executable. /// - /// @param[in] add_as_first_arg + /// \param[in] add_as_first_arg /// If true, then the path will be inserted into the argument vector /// prior to launching. Otherwise the argument vector will be left /// alone. - //---------------------------------------------------------------------- void SetExecutableFile(SBFileSpec exe_file, bool add_as_first_arg); - //---------------------------------------------------------------------- /// Get the listener that will be used to receive process events. /// /// If no listener has been set via a call to /// SBLaunchInfo::SetListener(), then an invalid SBListener will be /// returned (SBListener::IsValid() will return false). If a listener /// has been set, then the valid listener object will be returned. - //---------------------------------------------------------------------- SBListener GetListener(); - //---------------------------------------------------------------------- /// Set the listener that will be used to receive process events. /// /// By default the SBDebugger, which has a listener, that the SBTarget /// belongs to will listen for the process events. Calling this function /// allows a different listener to be used to listen for process events. - //---------------------------------------------------------------------- void SetListener(SBListener &listener); uint32_t GetNumArguments(); diff --git a/include/lldb/API/SBLineEntry.h b/include/lldb/API/SBLineEntry.h index 3d58ea8278ea..855c28d14b83 100644 --- a/include/lldb/API/SBLineEntry.h +++ b/include/lldb/API/SBLineEntry.h @@ -1,9 +1,8 @@ //===-- SBLineEntry.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 // //===----------------------------------------------------------------------===// @@ -30,6 +29,8 @@ public: lldb::SBAddress GetEndAddress() const; + explicit operator bool() const; + bool IsValid() const; lldb::SBFileSpec GetFileSpec() const; @@ -69,7 +70,7 @@ private: void SetLineEntry(const lldb_private::LineEntry &lldb_object_ref); - std::unique_ptr<lldb_private::LineEntry> m_opaque_ap; + std::unique_ptr<lldb_private::LineEntry> m_opaque_up; }; } // namespace lldb diff --git a/include/lldb/API/SBListener.h b/include/lldb/API/SBListener.h index a2f82a83c3ed..21aface97bd1 100644 --- a/include/lldb/API/SBListener.h +++ b/include/lldb/API/SBListener.h @@ -1,9 +1,8 @@ //===-- SBListener.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 // //===----------------------------------------------------------------------===// @@ -30,6 +29,8 @@ public: void Clear(); + explicit operator bool() const; + bool IsValid() const; uint32_t StartListeningForEventClass(SBDebugger &debugger, diff --git a/include/lldb/API/SBMemoryRegionInfo.h b/include/lldb/API/SBMemoryRegionInfo.h index 5675d93b8eaf..2a9ae94218f2 100644 --- a/include/lldb/API/SBMemoryRegionInfo.h +++ b/include/lldb/API/SBMemoryRegionInfo.h @@ -1,9 +1,8 @@ //===-- SBMemoryRegionInfo.h ------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -28,64 +27,50 @@ public: void Clear(); - //------------------------------------------------------------------ /// Get the base address of this memory range. /// - /// @return + /// \return /// The base address of this memory range. - //------------------------------------------------------------------ lldb::addr_t GetRegionBase(); - //------------------------------------------------------------------ /// Get the end address of this memory range. /// - /// @return + /// \return /// The base address of this memory range. - //------------------------------------------------------------------ lldb::addr_t GetRegionEnd(); - //------------------------------------------------------------------ /// Check if this memory address is marked readable to the process. /// - /// @return + /// \return /// true if this memory address is marked readable - //------------------------------------------------------------------ bool IsReadable(); - //------------------------------------------------------------------ /// Check if this memory address is marked writable to the process. /// - /// @return + /// \return /// true if this memory address is marked writable - //------------------------------------------------------------------ bool IsWritable(); - //------------------------------------------------------------------ /// Check if this memory address is marked executable to the process. /// - /// @return + /// \return /// true if this memory address is marked executable - //------------------------------------------------------------------ bool IsExecutable(); - //------------------------------------------------------------------ /// Check if this memory address is mapped into the process address /// space. /// - /// @return + /// \return /// true if this memory address is in the process address space. - //------------------------------------------------------------------ bool IsMapped(); - //------------------------------------------------------------------ /// Returns the name of the memory region mapped at the given /// address. /// - /// @return + /// \return /// In case of memory mapped files it is the absolute path of /// the file otherwise it is a name associated with the memory /// region. If no name can be determined the returns nullptr. - //------------------------------------------------------------------ const char *GetName(); bool operator==(const lldb::SBMemoryRegionInfo &rhs) const; @@ -105,7 +90,7 @@ private: // Unused. SBMemoryRegionInfo(const lldb_private::MemoryRegionInfo *lldb_object_ptr); - lldb::MemoryRegionInfoUP m_opaque_ap; + lldb::MemoryRegionInfoUP m_opaque_up; }; } // namespace lldb diff --git a/include/lldb/API/SBMemoryRegionInfoList.h b/include/lldb/API/SBMemoryRegionInfoList.h index 1e67997cdaf1..5592efef4851 100644 --- a/include/lldb/API/SBMemoryRegionInfoList.h +++ b/include/lldb/API/SBMemoryRegionInfoList.h @@ -1,9 +1,8 @@ //===-- SBMemoryRegionInfoList.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 // //===----------------------------------------------------------------------===// @@ -48,7 +47,7 @@ private: const lldb_private::MemoryRegionInfos &ref() const; - std::unique_ptr<MemoryRegionInfoListImpl> m_opaque_ap; + std::unique_ptr<MemoryRegionInfoListImpl> m_opaque_up; }; } // namespace lldb diff --git a/include/lldb/API/SBModule.h b/include/lldb/API/SBModule.h index 7a10e9fc96b3..d2b6a18db84d 100644 --- a/include/lldb/API/SBModule.h +++ b/include/lldb/API/SBModule.h @@ -1,9 +1,8 @@ //===-- SBModule.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 // //===----------------------------------------------------------------------===// @@ -32,23 +31,22 @@ public: ~SBModule(); + explicit operator bool() const; + bool IsValid() const; void Clear(); - //------------------------------------------------------------------ /// Get const accessor for the module file specification. /// /// This function returns the file for the module on the host system /// that is running LLDB. This can differ from the path on the /// platform since we might be doing remote debugging. /// - /// @return + /// \return /// A const reference to the file specification object. - //------------------------------------------------------------------ lldb::SBFileSpec GetFileSpec() const; - //------------------------------------------------------------------ /// Get accessor for the module platform file specification. /// /// Platform file refers to the path of the module as it is known on @@ -60,14 +58,12 @@ public: /// '/tmp/lldb/platform-cache/remote.host.computer/usr/lib/liba.dylib' /// The file could also be cached in a local developer kit directory. /// - /// @return + /// \return /// A const reference to the file specification object. - //------------------------------------------------------------------ lldb::SBFileSpec GetPlatformFileSpec() const; bool SetPlatformFileSpec(const lldb::SBFileSpec &platform_file); - //------------------------------------------------------------------ /// Get accessor for the remote install path for a module. /// /// When debugging to a remote platform by connecting to a remote @@ -76,12 +72,10 @@ public: /// the target will install this module on the remote platform prior /// to launching. /// - /// @return + /// \return /// A file specification object. - //------------------------------------------------------------------ lldb::SBFileSpec GetRemoteInstallFileSpec(); - //------------------------------------------------------------------ /// Set accessor for the remote install path for a module. /// /// When debugging to a remote platform by connecting to a remote @@ -96,9 +90,8 @@ public: /// or "./usr/lib", then the install path will be resolved using /// the platform's current working directory as the base path. /// - /// @param[in] file + /// \param[in] file /// A file specification object. - //------------------------------------------------------------------ bool SetRemoteInstallFileSpec(lldb::SBFileSpec &file); lldb::ByteOrder GetByteOrder(); @@ -129,18 +122,16 @@ public: lldb::SBCompileUnit GetCompileUnitAtIndex(uint32_t); - //------------------------------------------------------------------ /// Find compile units related to *this module and passed source /// file. /// - /// @param[in] sb_file_spec + /// \param[in] sb_file_spec /// A lldb::SBFileSpec object that contains source file /// specification. /// - /// @return + /// \return /// A lldb::SBSymbolContextList that gets filled in with all of /// the symbol contexts for all the matches. - //------------------------------------------------------------------ lldb::SBSymbolContextList FindCompileUnits(const lldb::SBFileSpec &sb_file_spec); @@ -157,59 +148,53 @@ public: size_t GetNumSections(); lldb::SBSection GetSectionAtIndex(size_t idx); - //------------------------------------------------------------------ /// Find functions by name. /// - /// @param[in] name + /// \param[in] name /// The name of the function we are looking for. /// - /// @param[in] name_type_mask + /// \param[in] name_type_mask /// A logical OR of one or more FunctionNameType enum bits that /// indicate what kind of names should be used when doing the /// lookup. Bits include fully qualified names, base names, /// C++ methods, or ObjC selectors. /// See FunctionNameType for more details. /// - /// @return + /// \return /// A lldb::SBSymbolContextList that gets filled in with all of /// the symbol contexts for all the matches. - //------------------------------------------------------------------ lldb::SBSymbolContextList FindFunctions(const char *name, uint32_t name_type_mask = lldb::eFunctionNameTypeAny); - //------------------------------------------------------------------ /// Find global and static variables by name. /// - /// @param[in] target + /// \param[in] target /// A valid SBTarget instance representing the debuggee. /// - /// @param[in] name + /// \param[in] name /// The name of the global or static variable we are looking /// for. /// - /// @param[in] max_matches + /// \param[in] max_matches /// Allow the number of matches to be limited to \a max_matches. /// - /// @return + /// \return /// A list of matched variables in an SBValueList. - //------------------------------------------------------------------ lldb::SBValueList FindGlobalVariables(lldb::SBTarget &target, const char *name, uint32_t max_matches); - //------------------------------------------------------------------ /// Find the first global (or static) variable by name. /// - /// @param[in] target + /// \param[in] target /// A valid SBTarget instance representing the debuggee. /// - /// @param[in] name + /// \param[in] name /// The name of the global or static variable we are looking /// for. /// - /// @return + /// \return /// An SBValue that gets filled in with the found variable (if any). - //------------------------------------------------------------------ lldb::SBValue FindFirstGlobalVariable(lldb::SBTarget &target, const char *name); @@ -217,7 +202,6 @@ public: lldb::SBTypeList FindTypes(const char *type); - //------------------------------------------------------------------ /// Get a type using its type ID. /// /// Each symbol file reader will assign different user IDs to their @@ -226,34 +210,30 @@ public: /// /// For DWARF debug info, the type ID is the DIE offset. /// - /// @param[in] uid + /// \param[in] uid /// The type user ID. /// - /// @return + /// \return /// An SBType for the given type ID, or an empty SBType if the /// type was not found. - //------------------------------------------------------------------ lldb::SBType GetTypeByID(lldb::user_id_t uid); lldb::SBType GetBasicType(lldb::BasicType type); - //------------------------------------------------------------------ /// Get all types matching \a type_mask from debug info in this /// module. /// - /// @param[in] type_mask + /// \param[in] type_mask /// A bitfield that consists of one or more bits logically OR'ed /// together from the lldb::TypeClass enumeration. This allows /// you to request only structure types, or only class, struct /// and union types. Passing in lldb::eTypeClassAny will return /// all types found in the debug information for this module. /// - /// @return + /// \return /// A list of types in this module that match \a type_mask - //------------------------------------------------------------------ lldb::SBTypeList GetTypes(uint32_t type_mask = lldb::eTypeClassAny); - //------------------------------------------------------------------ /// Get the module version numbers. /// /// Many object files have a set of version numbers that describe @@ -267,7 +247,7 @@ public: /// function with a value of \a versions and \a num_versions that /// has enough storage to store some or all version numbers. /// - /// @param[out] versions + /// \param[out] versions /// A pointer to an array of uint32_t types that is \a num_versions /// long. If this value is NULL, the return value will indicate /// how many version numbers are required for a subsequent call @@ -278,7 +258,7 @@ public: /// will be filled with \a num_versions UINT32_MAX values /// and zero will be returned. /// - /// @param[in] num_versions + /// \param[in] num_versions /// The maximum number of entries to fill into \a versions. If /// this value is zero, then the return value will indicate /// how many version numbers there are in total so another call @@ -288,14 +268,12 @@ public: /// numbers in this object file, only \a num_versions will be /// filled into \a versions (if \a versions is non-NULL). /// - /// @return + /// \return /// This function always returns the number of version numbers /// that this object file has regardless of the number of /// version numbers that were copied into \a versions. - //------------------------------------------------------------------ uint32_t GetVersion(uint32_t *versions, uint32_t num_versions); - //------------------------------------------------------------------ /// Get accessor for the symbol file specification. /// /// When debugging an object file an additional debug information can @@ -303,9 +281,8 @@ public: /// like '/usr/lib/liba.dylib' then debug information can be located /// in folder like '/usr/lib/liba.dylib.dSYM/'. /// - /// @return + /// \return /// A const reference to the file specification object. - //------------------------------------------------------------------ lldb::SBFileSpec GetSymbolFileSpec() const; lldb::SBAddress GetObjectFileHeaderAddress() const; diff --git a/include/lldb/API/SBModuleSpec.h b/include/lldb/API/SBModuleSpec.h index 1a862703a702..29b3117a261d 100644 --- a/include/lldb/API/SBModuleSpec.h +++ b/include/lldb/API/SBModuleSpec.h @@ -1,9 +1,8 @@ //===-- SBModuleSpec.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 // //===----------------------------------------------------------------------===// @@ -25,25 +24,24 @@ public: const SBModuleSpec &operator=(const SBModuleSpec &rhs); + explicit operator bool() const; + bool IsValid() const; void Clear(); - //------------------------------------------------------------------ /// Get const accessor for the module file. /// /// This function returns the file for the module on the host system /// that is running LLDB. This can differ from the path on the /// platform since we might be doing remote debugging. /// - /// @return + /// \return /// A const reference to the file specification object. - //------------------------------------------------------------------ lldb::SBFileSpec GetFileSpec(); void SetFileSpec(const lldb::SBFileSpec &fspec); - //------------------------------------------------------------------ /// Get accessor for the module platform file. /// /// Platform file refers to the path of the module as it is known on @@ -55,9 +53,8 @@ public: /// '/tmp/lldb/platform-cache/remote.host.computer/usr/lib/liba.dylib' /// The file could also be cached in a local developer kit directory. /// - /// @return + /// \return /// A const reference to the file specification object. - //------------------------------------------------------------------ lldb::SBFileSpec GetPlatformFileSpec(); void SetPlatformFileSpec(const lldb::SBFileSpec &fspec); @@ -87,7 +84,7 @@ private: friend class SBModule; friend class SBTarget; - std::unique_ptr<lldb_private::ModuleSpec> m_opaque_ap; + std::unique_ptr<lldb_private::ModuleSpec> m_opaque_up; }; class SBModuleSpecList { @@ -117,7 +114,7 @@ public: bool GetDescription(lldb::SBStream &description); private: - std::unique_ptr<lldb_private::ModuleSpecList> m_opaque_ap; + std::unique_ptr<lldb_private::ModuleSpecList> m_opaque_up; }; } // namespace lldb diff --git a/include/lldb/API/SBPlatform.h b/include/lldb/API/SBPlatform.h index 952e31066319..7207b2e2a78d 100644 --- a/include/lldb/API/SBPlatform.h +++ b/include/lldb/API/SBPlatform.h @@ -1,9 +1,8 @@ //===-- SBPlatform.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 // //===----------------------------------------------------------------------===// @@ -92,6 +91,8 @@ public: ~SBPlatform(); + explicit operator bool() const; + bool IsValid() const; void Clear(); @@ -108,9 +109,7 @@ public: bool IsConnected(); - //---------------------------------------------------------------------- // The following functions will work if the platform is connected - //---------------------------------------------------------------------- const char *GetTriple(); const char *GetHostname(); 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: diff --git a/include/lldb/API/SBProcessInfo.h b/include/lldb/API/SBProcessInfo.h index 421227f82c2d..86dba9a8e116 100644 --- a/include/lldb/API/SBProcessInfo.h +++ b/include/lldb/API/SBProcessInfo.h @@ -1,9 +1,8 @@ //===-- SBProcessInfo.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,6 +22,8 @@ public: SBProcessInfo &operator=(const SBProcessInfo &rhs); + explicit operator bool() const; + bool IsValid() const; const char *GetName(); @@ -56,7 +57,7 @@ private: void SetProcessInfo(const lldb_private::ProcessInstanceInfo &proc_info_ref); - std::unique_ptr<lldb_private::ProcessInstanceInfo> m_opaque_ap; + std::unique_ptr<lldb_private::ProcessInstanceInfo> m_opaque_up; }; } // namespace lldb diff --git a/include/lldb/API/SBQueue.h b/include/lldb/API/SBQueue.h index 53612c0a125f..0124c1c90dd2 100644 --- a/include/lldb/API/SBQueue.h +++ b/include/lldb/API/SBQueue.h @@ -1,9 +1,8 @@ //===-- SBQueue.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 // //===----------------------------------------------------------------------===// @@ -29,6 +28,8 @@ public: ~SBQueue(); + explicit operator bool() const; + bool IsValid() const; void Clear(); @@ -59,10 +60,6 @@ protected: void SetQueue(const lldb::QueueSP &queue_sp); - void FetchThreads(); - - void FetchItems(); - private: std::shared_ptr<lldb_private::QueueImpl> m_opaque_sp; }; diff --git a/include/lldb/API/SBQueueItem.h b/include/lldb/API/SBQueueItem.h index 78ca3ba02db1..455a1f98379a 100644 --- a/include/lldb/API/SBQueueItem.h +++ b/include/lldb/API/SBQueueItem.h @@ -1,9 +1,8 @@ //===-- SBQueueItem.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,6 +22,8 @@ public: ~SBQueueItem(); + explicit operator bool() const; + bool IsValid() const; void Clear(); diff --git a/include/lldb/API/SBReproducer.h b/include/lldb/API/SBReproducer.h new file mode 100644 index 000000000000..0f1739d0c5bd --- /dev/null +++ b/include/lldb/API/SBReproducer.h @@ -0,0 +1,28 @@ +//===-- SBReproducer.h ------------------------------------------*- C++ -*-===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +#ifndef LLDB_API_SBREPRODUCER_H +#define LLDB_API_SBREPRODUCER_H + +#include "lldb/API/SBDefines.h" + +namespace lldb { + +/// The SBReproducer class is special because it bootstraps the capture and +/// replay of SB API calls. As a result we cannot rely on any other SB objects +/// in the interface or implementation of this class. +class LLDB_API SBReproducer { +public: + static const char *Capture(); + static const char *Capture(const char *path); + static const char *Replay(const char *path); +}; + +} // namespace lldb + +#endif diff --git a/include/lldb/API/SBSection.h b/include/lldb/API/SBSection.h index ffd8bf7c979b..06a195ee78df 100644 --- a/include/lldb/API/SBSection.h +++ b/include/lldb/API/SBSection.h @@ -1,9 +1,8 @@ //===-- SBSection.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 // //===----------------------------------------------------------------------===// @@ -25,6 +24,8 @@ public: const lldb::SBSection &operator=(const lldb::SBSection &rhs); + explicit operator bool() const; + bool IsValid() const; const char *GetName(); @@ -53,7 +54,6 @@ public: SectionType GetSectionType(); - //------------------------------------------------------------------ /// Gets the permissions (RWX) of the section of the object file /// /// Returns a mask of bits of enum lldb::Permissions for this section. @@ -62,21 +62,18 @@ public: /// i.e. for a section having read and execute permissions, the value /// returned is 6 /// - /// @return + /// \return /// Returns an unsigned value for Permissions for the section. - //------------------------------------------------------------------ uint32_t GetPermissions() const; - //------------------------------------------------------------------ /// Return the size of a target's byte represented by this section /// in numbers of host bytes. Note that certain architectures have /// varying minimum addressable unit (i.e. byte) size for their /// CODE or DATA buses. /// - /// @return + /// \return /// The number of host (8-bit) bytes needed to hold a target byte - //------------------------------------------------------------------ uint32_t GetTargetByteSize(); bool operator==(const lldb::SBSection &rhs); diff --git a/include/lldb/API/SBSourceManager.h b/include/lldb/API/SBSourceManager.h index 6f1c49504d52..3d69aa25a934 100644 --- a/include/lldb/API/SBSourceManager.h +++ b/include/lldb/API/SBSourceManager.h @@ -1,9 +1,8 @@ //===-- SBSourceManager.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 // //===----------------------------------------------------------------------===// @@ -39,10 +38,8 @@ protected: friend class SBCommandInterpreter; friend class SBDebugger; - SBSourceManager(lldb_private::SourceManager *source_manager); - private: - std::unique_ptr<lldb_private::SourceManagerImpl> m_opaque_ap; + std::unique_ptr<lldb_private::SourceManagerImpl> m_opaque_up; }; } // namespace lldb diff --git a/include/lldb/API/SBStream.h b/include/lldb/API/SBStream.h index 7364ca7797f8..8afbf4575621 100644 --- a/include/lldb/API/SBStream.h +++ b/include/lldb/API/SBStream.h @@ -1,9 +1,8 @@ //===-- SBStream.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 // //===----------------------------------------------------------------------===// @@ -24,6 +23,8 @@ public: ~SBStream(); + explicit operator bool() const; + bool IsValid() const; // If this stream is not redirected to a file, it will maintain a local cache @@ -95,7 +96,7 @@ protected: private: DISALLOW_COPY_AND_ASSIGN(SBStream); - std::unique_ptr<lldb_private::Stream> m_opaque_ap; + std::unique_ptr<lldb_private::Stream> m_opaque_up; bool m_is_file; }; diff --git a/include/lldb/API/SBStringList.h b/include/lldb/API/SBStringList.h index 943384e544cd..1df1e45f96fe 100644 --- a/include/lldb/API/SBStringList.h +++ b/include/lldb/API/SBStringList.h @@ -1,9 +1,8 @@ //===-- SBStringList.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 // //===----------------------------------------------------------------------===// @@ -24,6 +23,8 @@ public: ~SBStringList(); + explicit operator bool() const; + bool IsValid() const; void AppendString(const char *str); @@ -56,7 +57,7 @@ protected: const lldb_private::StringList &operator*() const; private: - std::unique_ptr<lldb_private::StringList> m_opaque_ap; + std::unique_ptr<lldb_private::StringList> m_opaque_up; }; } // namespace lldb diff --git a/include/lldb/API/SBStructuredData.h b/include/lldb/API/SBStructuredData.h index 629d4f3e35ee..5b10133500ef 100644 --- a/include/lldb/API/SBStructuredData.h +++ b/include/lldb/API/SBStructuredData.h @@ -1,9 +1,8 @@ //===-- SBStructuredData.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 // //===----------------------------------------------------------------------===// @@ -29,6 +28,8 @@ public: lldb::SBStructuredData &operator=(const lldb::SBStructuredData &rhs); + explicit operator bool() const; + bool IsValid() const; lldb::SBError SetFromJSON(lldb::SBStream &stream); @@ -39,69 +40,51 @@ public: lldb::SBError GetDescription(lldb::SBStream &stream) const; - //------------------------------------------------------------------ /// Return the type of data in this data structure - //------------------------------------------------------------------ lldb::StructuredDataType GetType() const; - //------------------------------------------------------------------ /// Return the size (i.e. number of elements) in this data structure /// if it is an array or dictionary type. For other types, 0 will be // returned. - //------------------------------------------------------------------ size_t GetSize() const; - //------------------------------------------------------------------ /// Fill keys with the keys in this object and return true if this data /// structure is a dictionary. Returns false otherwise. - //------------------------------------------------------------------ bool GetKeys(lldb::SBStringList &keys) const; - //------------------------------------------------------------------ /// Return the value corresponding to a key if this data structure /// is a dictionary type. - //------------------------------------------------------------------ lldb::SBStructuredData GetValueForKey(const char *key) const; - //------------------------------------------------------------------ /// Return the value corresponding to an index if this data structure /// is array. - //------------------------------------------------------------------ lldb::SBStructuredData GetItemAtIndex(size_t idx) const; - //------------------------------------------------------------------ /// Return the integer value if this data structure is an integer type. - //------------------------------------------------------------------ uint64_t GetIntegerValue(uint64_t fail_value = 0) const; - //------------------------------------------------------------------ /// Return the floating point value if this data structure is a floating /// type. - //------------------------------------------------------------------ double GetFloatValue(double fail_value = 0.0) const; - //------------------------------------------------------------------ /// Return the boolean value if this data structure is a boolean type. - //------------------------------------------------------------------ bool GetBooleanValue(bool fail_value = false) const; - //------------------------------------------------------------------ /// Provides the string value if this data structure is a string type. /// - /// @param[out] dst + /// \param[out] dst /// pointer where the string value will be written. In case it is null, - /// nothing will be written at @dst. + /// nothing will be written at \a dst. /// - /// @param[in] dst_len - /// max number of characters that can be written at @dst. In case it is - /// zero, nothing will be written at @dst. If this length is not enough - /// to write the complete string value, (dst_len-1) bytes of the string - /// value will be written at @dst followed by a null character. + /// \param[in] dst_len + /// max number of characters that can be written at \a dst. In case it is + /// zero, nothing will be written at \a dst. If this length is not enough + /// to write the complete string value, (\a dst_len - 1) bytes of the + /// string value will be written at \a dst followed by a null character. /// - /// @return + /// \return /// Returns the byte size needed to completely write the string value at - /// @dst in all cases. - //------------------------------------------------------------------ + /// \a dst in all cases. size_t GetStringValue(char *dst, size_t dst_len) const; protected: diff --git a/include/lldb/API/SBSymbol.h b/include/lldb/API/SBSymbol.h index a29ac61d2912..52486b83d1a7 100644 --- a/include/lldb/API/SBSymbol.h +++ b/include/lldb/API/SBSymbol.h @@ -1,9 +1,8 @@ //===-- SBSymbol.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 // //===----------------------------------------------------------------------===// @@ -27,6 +26,8 @@ public: const lldb::SBSymbol &operator=(const lldb::SBSymbol &rhs); + explicit operator bool() const; + bool IsValid() const; const char *GetName() const; @@ -54,16 +55,12 @@ public: bool GetDescription(lldb::SBStream &description); - //---------------------------------------------------------------------- // Returns true if the symbol is externally visible in the module that it is // defined in - //---------------------------------------------------------------------- bool IsExternal(); - //---------------------------------------------------------------------- // Returns true if the symbol was synthetically generated from something // other than the actual symbol table itself in the object file. - //---------------------------------------------------------------------- bool IsSynthetic(); protected: diff --git a/include/lldb/API/SBSymbolContext.h b/include/lldb/API/SBSymbolContext.h index 9078b5b789e0..3d16d0989ca1 100644 --- a/include/lldb/API/SBSymbolContext.h +++ b/include/lldb/API/SBSymbolContext.h @@ -1,9 +1,8 @@ //===-- SBSymbolContext.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 // //===----------------------------------------------------------------------===// @@ -30,6 +29,8 @@ public: ~SBSymbolContext(); + explicit operator bool() const; + bool IsValid() const; const lldb::SBSymbolContext &operator=(const lldb::SBSymbolContext &rhs); @@ -74,7 +75,7 @@ protected: void SetSymbolContext(const lldb_private::SymbolContext *sc_ptr); private: - std::unique_ptr<lldb_private::SymbolContext> m_opaque_ap; + std::unique_ptr<lldb_private::SymbolContext> m_opaque_up; }; } // namespace lldb diff --git a/include/lldb/API/SBSymbolContextList.h b/include/lldb/API/SBSymbolContextList.h index e7299dd5330c..577993ce96dd 100644 --- a/include/lldb/API/SBSymbolContextList.h +++ b/include/lldb/API/SBSymbolContextList.h @@ -1,9 +1,8 @@ //===-- SBSymbolContextList.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 // //===----------------------------------------------------------------------===// @@ -26,6 +25,8 @@ public: const lldb::SBSymbolContextList & operator=(const lldb::SBSymbolContextList &rhs); + explicit operator bool() const; + bool IsValid() const; uint32_t GetSize() const; @@ -49,7 +50,7 @@ protected: lldb_private::SymbolContextList &operator*() const; private: - std::unique_ptr<lldb_private::SymbolContextList> m_opaque_ap; + std::unique_ptr<lldb_private::SymbolContextList> m_opaque_up; }; } // namespace lldb diff --git a/include/lldb/API/SBTarget.h b/include/lldb/API/SBTarget.h index 18de267fee00..80a7fa00dbc5 100644 --- a/include/lldb/API/SBTarget.h +++ b/include/lldb/API/SBTarget.h @@ -1,9 +1,8 @@ //===-- SBTarget.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 // //===----------------------------------------------------------------------===// @@ -29,9 +28,7 @@ class SBPlatform; class LLDB_API SBTarget { public: - //------------------------------------------------------------------ // Broadcaster bits. - //------------------------------------------------------------------ enum { eBroadcastBitBreakpointChanged = (1 << 0), eBroadcastBitModulesLoaded = (1 << 1), @@ -40,22 +37,20 @@ public: eBroadcastBitSymbolsLoaded = (1 << 4) }; - //------------------------------------------------------------------ // Constructors - //------------------------------------------------------------------ SBTarget(); SBTarget(const lldb::SBTarget &rhs); SBTarget(const lldb::TargetSP &target_sp); - //------------------------------------------------------------------ // Destructor - //------------------------------------------------------------------ ~SBTarget(); const lldb::SBTarget &operator=(const lldb::SBTarget &rhs); + explicit operator bool() const; + bool IsValid() const; static bool EventIsTargetEvent(const lldb::SBEvent &event); @@ -71,45 +66,34 @@ public: lldb::SBProcess GetProcess(); - //------------------------------------------------------------------ /// Sets whether we should collect statistics on lldb or not. /// - /// @param[in] v + /// \param[in] v /// A boolean to control the collection. - /// @return - /// void - //------------------------------------------------------------------ void SetCollectingStats(bool v); - //------------------------------------------------------------------ /// Returns whether statistics collection are enabled. /// - /// @return + /// \return /// true if statistics are currently being collected, false /// otherwise. - //------------------------------------------------------------------ bool GetCollectingStats(); - //------------------------------------------------------------------ /// Returns a dump of the collected statistics. /// - /// @return + /// \return /// A SBStructuredData with the statistics collected. - //------------------------------------------------------------------ lldb::SBStructuredData GetStatistics(); - //------------------------------------------------------------------ /// Return the platform object associated with the target. /// /// After return, the platform object should be checked for /// validity. /// - /// @return + /// \return /// A platform object. - //------------------------------------------------------------------ lldb::SBPlatform GetPlatform(); - //------------------------------------------------------------------ /// Install any binaries that need to be installed. /// /// This function does nothing when debugging on the host system. @@ -119,13 +103,11 @@ public: /// have an install location set, it will be installed in the remote /// platform's working directory. /// - /// @return + /// \return /// An error describing anything that went wrong during /// installation. - //------------------------------------------------------------------ SBError Install(); - //------------------------------------------------------------------ /// Launch a new process. /// /// Launch a new process by spawning a new process using the @@ -135,49 +117,48 @@ public: /// optionally re-directed to \a stdin_path, \a stdout_path, and /// \a stderr_path. /// - /// @param[in] listener + /// \param[in] listener /// An optional listener that will receive all process events. /// If \a listener is valid then \a listener will listen to all /// process events. If not valid, then this target's debugger /// (SBTarget::GetDebugger()) will listen to all process events. /// - /// @param[in] argv + /// \param[in] argv /// The argument array. /// - /// @param[in] envp + /// \param[in] envp /// The environment array. /// - /// @param[in] stdin_path + /// \param[in] stdin_path /// The path to use when re-directing the STDIN of the new /// process. If all stdXX_path arguments are nullptr, a pseudo /// terminal will be used. /// - /// @param[in] stdout_path + /// \param[in] stdout_path /// The path to use when re-directing the STDOUT of the new /// process. If all stdXX_path arguments are nullptr, a pseudo /// terminal will be used. /// - /// @param[in] stderr_path + /// \param[in] stderr_path /// The path to use when re-directing the STDERR of the new /// process. If all stdXX_path arguments are nullptr, a pseudo /// terminal will be used. /// - /// @param[in] working_directory + /// \param[in] working_directory /// The working directory to have the child process run in /// - /// @param[in] launch_flags + /// \param[in] launch_flags /// Some launch options specified by logical OR'ing /// lldb::LaunchFlags enumeration values together. /// - /// @param[in] stop_at_entry + /// \param[in] stop_at_entry /// If false do not stop the inferior at the entry point. /// - /// @param[out] error + /// \param[out] error /// An error object. Contains the reason if there is some failure. /// - /// @return + /// \return /// A process object for the newly created process. - //------------------------------------------------------------------ lldb::SBProcess Launch(SBListener &listener, char const **argv, char const **envp, const char *stdin_path, const char *stdout_path, const char *stderr_path, @@ -188,16 +169,15 @@ public: SBProcess LoadCore(const char *core_file); SBProcess LoadCore(const char *core_file, lldb::SBError &error); - //------------------------------------------------------------------ /// Launch a new process with sensible defaults. /// - /// @param[in] argv + /// \param[in] argv /// The argument array. /// - /// @param[in] envp + /// \param[in] envp /// The environment array. /// - /// @param[in] working_directory + /// \param[in] working_directory /// The working directory to have the child process run in /// /// Default: listener @@ -211,9 +191,8 @@ public: /// Default: stderr_path /// A pseudo terminal will be used. /// - /// @return + /// \return /// A process object for the newly created process. - //------------------------------------------------------------------ SBProcess LaunchSimple(const char **argv, const char **envp, const char *working_directory); @@ -221,73 +200,67 @@ public: SBProcess Attach(SBAttachInfo &attach_info, SBError &error); - //------------------------------------------------------------------ /// Attach to process with pid. /// - /// @param[in] listener + /// \param[in] listener /// An optional listener that will receive all process events. /// If \a listener is valid then \a listener will listen to all /// process events. If not valid, then this target's debugger /// (SBTarget::GetDebugger()) will listen to all process events. /// - /// @param[in] pid + /// \param[in] pid /// The process ID to attach to. /// - /// @param[out] error + /// \param[out] error /// An error explaining what went wrong if attach fails. /// - /// @return + /// \return /// A process object for the attached process. - //------------------------------------------------------------------ lldb::SBProcess AttachToProcessWithID(SBListener &listener, lldb::pid_t pid, lldb::SBError &error); - //------------------------------------------------------------------ /// Attach to process with name. /// - /// @param[in] listener + /// \param[in] listener /// An optional listener that will receive all process events. /// If \a listener is valid then \a listener will listen to all /// process events. If not valid, then this target's debugger /// (SBTarget::GetDebugger()) will listen to all process events. /// - /// @param[in] name + /// \param[in] name /// Basename of process to attach to. /// - /// @param[in] wait_for + /// \param[in] wait_for /// If true wait for a new instance of 'name' to be launched. /// - /// @param[out] error + /// \param[out] error /// An error explaining what went wrong if attach fails. /// - /// @return + /// \return /// A process object for the attached process. - //------------------------------------------------------------------ lldb::SBProcess AttachToProcessWithName(SBListener &listener, const char *name, bool wait_for, lldb::SBError &error); - //------------------------------------------------------------------ /// Connect to a remote debug server with url. /// - /// @param[in] listener + /// \param[in] listener /// An optional listener that will receive all process events. /// If \a listener is valid then \a listener will listen to all /// process events. If not valid, then this target's debugger /// (SBTarget::GetDebugger()) will listen to all process events. /// - /// @param[in] url + /// \param[in] url /// The url to connect to, e.g., 'connect://localhost:12345'. /// - /// @param[in] plugin_name + /// \param[in] plugin_name /// The plugin name to be used; can be nullptr. /// - /// @param[out] error + /// \param[out] error /// An error explaining what went wrong if the connect fails. /// - /// @return + /// \return /// A process object for the connected process. - //------------------------------------------------------------------ lldb::SBProcess ConnectRemote(SBListener &listener, const char *url, const char *plugin_name, SBError &error); @@ -317,18 +290,16 @@ public: lldb::SBModule FindModule(const lldb::SBFileSpec &file_spec); - //------------------------------------------------------------------ /// Find compile units related to *this target and passed source /// file. /// - /// @param[in] sb_file_spec + /// \param[in] sb_file_spec /// A lldb::SBFileSpec object that contains source file /// specification. /// - /// @return + /// \return /// A lldb::SBSymbolContextList that gets filled in with all of /// the symbol contexts for all the matches. - //------------------------------------------------------------------ lldb::SBSymbolContextList FindCompileUnits(const lldb::SBFileSpec &sb_file_spec); @@ -338,55 +309,46 @@ public: const char *GetTriple(); - //------------------------------------------------------------------ /// Architecture data byte width accessor /// - /// @return + /// \return /// The size in 8-bit (host) bytes of a minimum addressable /// unit from the Architecture's data bus - //------------------------------------------------------------------ uint32_t GetDataByteSize(); - //------------------------------------------------------------------ /// Architecture code byte width accessor /// - /// @return + /// \return /// The size in 8-bit (host) bytes of a minimum addressable /// unit from the Architecture's code bus - //------------------------------------------------------------------ uint32_t GetCodeByteSize(); - //------------------------------------------------------------------ /// Set the base load address for a module section. /// - /// @param[in] section + /// \param[in] section /// The section whose base load address will be set within this /// target. /// - /// @param[in] section_base_addr + /// \param[in] section_base_addr /// The base address for the section. /// - /// @return + /// \return /// An error to indicate success, fail, and any reason for /// failure. - //------------------------------------------------------------------ lldb::SBError SetSectionLoadAddress(lldb::SBSection section, lldb::addr_t section_base_addr); - //------------------------------------------------------------------ /// Clear the base load address for a module section. /// - /// @param[in] section + /// \param[in] section /// The section whose base load address will be cleared within /// this target. /// - /// @return + /// \return /// An error to indicate success, fail, and any reason for /// failure. - //------------------------------------------------------------------ lldb::SBError ClearSectionLoadAddress(lldb::SBSection section); - //------------------------------------------------------------------ /// Slide all file addresses for all module sections so that \a module /// appears to loaded at these slide addresses. /// @@ -395,150 +357,132 @@ public: /// this function will allow you to easily and quickly slide all /// module sections. /// - /// @param[in] module + /// \param[in] module /// The module to load. /// - /// @param[in] sections_offset + /// \param[in] sections_offset /// An offset that will be applied to all section file addresses /// (the virtual addresses found in the object file itself). /// - /// @return + /// \return /// An error to indicate success, fail, and any reason for /// failure. - //------------------------------------------------------------------ lldb::SBError SetModuleLoadAddress(lldb::SBModule module, int64_t sections_offset); - //------------------------------------------------------------------ /// Clear the section base load addresses for all sections in a module. /// - /// @param[in] module + /// \param[in] module /// The module to unload. /// - /// @return + /// \return /// An error to indicate success, fail, and any reason for /// failure. - //------------------------------------------------------------------ lldb::SBError ClearModuleLoadAddress(lldb::SBModule module); - //------------------------------------------------------------------ /// Find functions by name. /// - /// @param[in] name + /// \param[in] name /// The name of the function we are looking for. /// - /// @param[in] name_type_mask + /// \param[in] name_type_mask /// A logical OR of one or more FunctionNameType enum bits that /// indicate what kind of names should be used when doing the /// lookup. Bits include fully qualified names, base names, /// C++ methods, or ObjC selectors. /// See FunctionNameType for more details. /// - /// @return + /// \return /// A lldb::SBSymbolContextList that gets filled in with all of /// the symbol contexts for all the matches. - //------------------------------------------------------------------ lldb::SBSymbolContextList FindFunctions(const char *name, uint32_t name_type_mask = lldb::eFunctionNameTypeAny); - //------------------------------------------------------------------ /// Find global and static variables by name. /// - /// @param[in] name + /// \param[in] name /// The name of the global or static variable we are looking /// for. /// - /// @param[in] max_matches + /// \param[in] max_matches /// Allow the number of matches to be limited to \a max_matches. /// - /// @return + /// \return /// A list of matched variables in an SBValueList. - //------------------------------------------------------------------ lldb::SBValueList FindGlobalVariables(const char *name, uint32_t max_matches); - //------------------------------------------------------------------ /// Find the first global (or static) variable by name. /// - /// @param[in] name + /// \param[in] name /// The name of the global or static variable we are looking /// for. /// - /// @return + /// \return /// An SBValue that gets filled in with the found variable (if any). - //------------------------------------------------------------------ lldb::SBValue FindFirstGlobalVariable(const char *name); - //------------------------------------------------------------------ /// Find global and static variables by pattern. /// - /// @param[in] name + /// \param[in] name /// The pattern to search for global or static variables /// - /// @param[in] max_matches + /// \param[in] max_matches /// Allow the number of matches to be limited to \a max_matches. /// - /// @param[in] matchtype + /// \param[in] matchtype /// The match type to use. /// - /// @return + /// \return /// A list of matched variables in an SBValueList. - //------------------------------------------------------------------ lldb::SBValueList FindGlobalVariables(const char *name, uint32_t max_matches, MatchType matchtype); - //------------------------------------------------------------------ /// Find global functions by their name with pattern matching. /// - /// @param[in] name + /// \param[in] name /// The pattern to search for global or static variables /// - /// @param[in] max_matches + /// \param[in] max_matches /// Allow the number of matches to be limited to \a max_matches. /// - /// @param[in] matchtype + /// \param[in] matchtype /// The match type to use. /// - /// @return + /// \return /// A list of matched variables in an SBValueList. - //------------------------------------------------------------------ lldb::SBSymbolContextList FindGlobalFunctions(const char *name, uint32_t max_matches, MatchType matchtype); void Clear(); - //------------------------------------------------------------------ /// Resolve a current file address into a section offset address. /// - /// @param[in] file_addr + /// \param[in] file_addr /// The file address to resolve. /// - /// @return + /// \return /// An SBAddress which will be valid if... - //------------------------------------------------------------------ lldb::SBAddress ResolveFileAddress(lldb::addr_t file_addr); - //------------------------------------------------------------------ /// Resolve a current load address into a section offset address. /// - /// @param[in] vm_addr + /// \param[in] vm_addr /// A virtual address from the current process state that is to /// be translated into a section offset address. /// - /// @return + /// \return /// An SBAddress which will be valid if \a vm_addr was /// successfully resolved into a section offset address, or an /// invalid SBAddress if \a vm_addr doesn't resolve to a section /// in a module. - //------------------------------------------------------------------ lldb::SBAddress ResolveLoadAddress(lldb::addr_t vm_addr); - //------------------------------------------------------------------ /// Resolve a current load address into a section offset address /// using the process stop ID to identify a time in the past. /// - /// @param[in] stop_id + /// \param[in] stop_id /// Each time a process stops, the process stop ID integer gets /// incremented. These stop IDs are used to identify past times /// and can be used in history objects as a cheap way to store @@ -546,44 +490,41 @@ public: /// UINT32_MAX will always resolve the address using the /// currently loaded sections. /// - /// @param[in] vm_addr + /// \param[in] vm_addr /// A virtual address from the current process state that is to /// be translated into a section offset address. /// - /// @return + /// \return /// An SBAddress which will be valid if \a vm_addr was /// successfully resolved into a section offset address, or an /// invalid SBAddress if \a vm_addr doesn't resolve to a section /// in a module. - //------------------------------------------------------------------ lldb::SBAddress ResolvePastLoadAddress(uint32_t stop_id, lldb::addr_t vm_addr); SBSymbolContext ResolveSymbolContextForAddress(const SBAddress &addr, uint32_t resolve_scope); - //------------------------------------------------------------------ /// Read target memory. If a target process is running then memory /// is read from here. Otherwise the memory is read from the object /// files. For a target whose bytes are sized as a multiple of host /// bytes, the data read back will preserve the target's byte order. /// - /// @param[in] addr + /// \param[in] addr /// A target address to read from. /// - /// @param[out] buf + /// \param[out] buf /// The buffer to read memory into. /// - /// @param[in] size + /// \param[in] size /// The maximum number of host bytes to read in the buffer passed /// into this call /// - /// @param[out] error + /// \param[out] error /// Status information is written here if the memory read fails. /// - /// @return + /// \return /// The amount of data read in host bytes. - //------------------------------------------------------------------ size_t ReadMemory(const SBAddress addr, void *buf, size_t size, lldb::SBError &error); @@ -684,30 +625,28 @@ public: lldb::SBBreakpoint BreakpointCreateBySBAddress(SBAddress &address); - //------------------------------------------------------------------ /// Create a breakpoint using a scripted resolver. /// - /// @param[in] class_name + /// \param[in] class_name /// This is the name of the class that implements a scripted resolver. /// - /// @param[in] extra_args + /// \param[in] extra_args /// This is an SBStructuredData object that will get passed to the /// constructor of the class in class_name. You can use this to /// reuse the same class, parametrizing with entries from this /// dictionary. /// - /// @param module_list + /// \param module_list /// If this is non-empty, this will be used as the module filter in the /// SearchFilter created for this breakpoint. /// - /// @param file_list + /// \param file_list /// If this is non-empty, this will be used as the comp unit filter in the /// SearchFilter created for this breakpoint. /// - /// @return + /// \return /// An SBBreakpoint that will set locations based on the logic in the /// resolver's search callback. - //------------------------------------------------------------------ lldb::SBBreakpoint BreakpointCreateFromScript( const char *class_name, SBStructuredData &extra_args, @@ -715,71 +654,63 @@ public: const SBFileSpecList &file_list, bool request_hardware = false); - //------------------------------------------------------------------ /// Read breakpoints from source_file and return the newly created /// breakpoints in bkpt_list. /// - /// @param[in] source_file + /// \param[in] source_file /// The file from which to read the breakpoints. /// - /// @param[out] new_bps + /// \param[out] new_bps /// A list of the newly created breakpoints. /// - /// @return + /// \return /// An SBError detailing any errors in reading in the breakpoints. - //------------------------------------------------------------------ lldb::SBError BreakpointsCreateFromFile(SBFileSpec &source_file, SBBreakpointList &new_bps); - //------------------------------------------------------------------ /// Read breakpoints from source_file and return the newly created /// breakpoints in bkpt_list. /// - /// @param[in] source_file + /// \param[in] source_file /// The file from which to read the breakpoints. /// - /// @param[in] matching_names + /// \param[in] matching_names /// Only read in breakpoints whose names match one of the names in this /// list. /// - /// @param[out] new_bps + /// \param[out] new_bps /// A list of the newly created breakpoints. /// - /// @return + /// \return /// An SBError detailing any errors in reading in the breakpoints. - //------------------------------------------------------------------ lldb::SBError BreakpointsCreateFromFile(SBFileSpec &source_file, SBStringList &matching_names, SBBreakpointList &new_bps); - //------------------------------------------------------------------ /// Write breakpoints to dest_file. /// - /// @param[in] dest_file + /// \param[in] dest_file /// The file to which to write the breakpoints. /// - /// @return + /// \return /// An SBError detailing any errors in writing in the breakpoints. - //------------------------------------------------------------------ lldb::SBError BreakpointsWriteToFile(SBFileSpec &dest_file); - //------------------------------------------------------------------ /// Write breakpoints listed in bkpt_list to dest_file. /// - /// @param[in] dest_file + /// \param[in] dest_file /// The file to which to write the breakpoints. /// - /// @param[in] bkpt_list + /// \param[in] bkpt_list /// Only write breakpoints from this list. /// - /// @param[in] append - /// If \btrue, append the breakpoints in bkpt_list to the others + /// \param[in] append + /// If \b true, append the breakpoints in bkpt_list to the others /// serialized in dest_file. If dest_file doesn't exist, then a new /// file will be created and the breakpoints in bkpt_list written to it. /// - /// @return + /// \return /// An SBError detailing any errors in writing in the breakpoints. - //------------------------------------------------------------------ lldb::SBError BreakpointsWriteToFile(SBFileSpec &dest_file, SBBreakpointList &bkpt_list, bool append = false); @@ -905,10 +836,8 @@ protected: friend class SBValue; friend class SBVariablesOptions; - //------------------------------------------------------------------ // Constructors are private, use static Target::Create function to create an // instance of this class. - //------------------------------------------------------------------ lldb::TargetSP GetSP() const; diff --git a/include/lldb/API/SBThread.h b/include/lldb/API/SBThread.h index 63816eef51b7..da8726a2a9b2 100644 --- a/include/lldb/API/SBThread.h +++ b/include/lldb/API/SBThread.h @@ -1,9 +1,8 @@ //===-- SBThread.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 // //===----------------------------------------------------------------------===// @@ -40,6 +39,8 @@ public: lldb::SBQueue GetQueue() const; + explicit operator bool() const; + bool IsValid() const; void Clear(); @@ -50,7 +51,6 @@ public: /// See also GetStopReasonDataAtIndex(). size_t GetStopReasonDataCount(); - //-------------------------------------------------------------------------- /// Get information associated with a stop reason. /// /// Breakpoint stop reasons will have data that consists of pairs of @@ -67,7 +67,6 @@ public: /// eStopReasonException N exception data /// eStopReasonExec 0 /// eStopReasonPlanComplete 0 - //-------------------------------------------------------------------------- uint64_t GetStopReasonDataAtIndex(uint32_t idx); bool GetStopReasonExtendedInfoAsJSON(lldb::SBStream &stream); @@ -133,7 +132,6 @@ public: SBError UnwindInnermostExpression(); - //-------------------------------------------------------------------------- /// LLDB currently supports process centric debugging which means when any /// thread in a process stops, all other threads are stopped. The Suspend() /// call here tells our process to suspend a thread and not let it run when @@ -153,7 +151,6 @@ public: /// Suspend() and Resume() functions are not currently reference counted, if /// anyone has the need for them to be reference counted, please let us /// know. - //-------------------------------------------------------------------------- bool Suspend(); bool Suspend(SBError &error); @@ -204,14 +201,7 @@ public: bool SafeToCallFunctions(); -#ifndef SWIG - lldb_private::Thread *operator->(); - - lldb_private::Thread *get(); - -#endif - -protected: +private: friend class SBBreakpoint; friend class SBBreakpointLocation; friend class SBBreakpointCallbackBaton; @@ -222,16 +212,18 @@ protected: friend class SBValue; friend class lldb_private::QueueImpl; friend class SBQueueItem; + friend class SBThreadPlan; void SetThread(const lldb::ThreadSP &lldb_object_sp); -#ifndef SWIG SBError ResumeNewPlan(lldb_private::ExecutionContext &exe_ctx, lldb_private::ThreadPlan *new_plan); -#endif -private: lldb::ExecutionContextRefSP m_opaque_sp; + + lldb_private::Thread *operator->(); + + lldb_private::Thread *get(); }; } // namespace lldb diff --git a/include/lldb/API/SBThreadCollection.h b/include/lldb/API/SBThreadCollection.h index 715b0826b962..1c6b4639c6ef 100644 --- a/include/lldb/API/SBThreadCollection.h +++ b/include/lldb/API/SBThreadCollection.h @@ -1,9 +1,8 @@ //===-- SBThreadCollection.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 // //===----------------------------------------------------------------------===// @@ -24,6 +23,8 @@ public: ~SBThreadCollection(); + explicit operator bool() const; + bool IsValid() const; size_t GetSize(); diff --git a/include/lldb/API/SBThreadPlan.h b/include/lldb/API/SBThreadPlan.h index 5084a427e1b8..007e9e2de21a 100644 --- a/include/lldb/API/SBThreadPlan.h +++ b/include/lldb/API/SBThreadPlan.h @@ -1,9 +1,8 @@ -//===-- SBThread.h ----------------------------------------------*- C++ -*-===// +//===-- SBThreadPlan.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 // //===----------------------------------------------------------------------===// @@ -31,6 +30,8 @@ public: ~SBThreadPlan(); + explicit operator bool() const; + bo |