diff options
Diffstat (limited to 'include/lldb/API')
25 files changed, 726 insertions, 24 deletions
diff --git a/include/lldb/API/LLDB.h b/include/lldb/API/LLDB.h index b9c3198b73e5..4026b2b61ba8 100644 --- a/include/lldb/API/LLDB.h +++ b/include/lldb/API/LLDB.h @@ -29,6 +29,7 @@ #include "lldb/API/SBDeclaration.h" #include "lldb/API/SBError.h" #include "lldb/API/SBEvent.h" +#include "lldb/API/SBExecutionContext.h" #include "lldb/API/SBFileSpec.h" #include "lldb/API/SBFrame.h" #include "lldb/API/SBFunction.h" diff --git a/include/lldb/API/SBAddress.h b/include/lldb/API/SBAddress.h index 58a7d2bfb1da..c2d07b6e9bcc 100644 --- a/include/lldb/API/SBAddress.h +++ b/include/lldb/API/SBAddress.h @@ -117,6 +117,7 @@ protected: friend class SBSymbolContext; friend class SBTarget; friend class SBThread; + friend class SBThreadPlan; friend class SBValue; friend class SBQueueItem; diff --git a/include/lldb/API/SBBreakpoint.h b/include/lldb/API/SBBreakpoint.h index 86d49c29a821..20a97a1fb5a0 100644 --- a/include/lldb/API/SBBreakpoint.h +++ b/include/lldb/API/SBBreakpoint.h @@ -123,6 +123,18 @@ public: SBError SetScriptCallbackBody (const char *script_body_text); + + bool + AddName (const char *new_name); + + void + RemoveName (const char *name_to_remove); + + bool + MatchesName (const char *name); + + void + GetNames (SBStringList &names); size_t GetNumResolvedLocations() const; diff --git a/include/lldb/API/SBCommandInterpreter.h b/include/lldb/API/SBCommandInterpreter.h index 184a6b473126..947e39164140 100644 --- a/include/lldb/API/SBCommandInterpreter.h +++ b/include/lldb/API/SBCommandInterpreter.h @@ -15,6 +15,61 @@ namespace lldb { +class SBCommandInterpreterRunOptions +{ +friend class SBDebugger; +friend class SBCommandInterpreter; + +public: + SBCommandInterpreterRunOptions(); + ~SBCommandInterpreterRunOptions(); + + bool + GetStopOnContinue () const; + + void + SetStopOnContinue (bool); + + bool + GetStopOnError () const; + + void + SetStopOnError (bool); + + bool + GetStopOnCrash () const; + + void + SetStopOnCrash (bool); + + bool + GetEchoCommands () const; + + void + SetEchoCommands (bool); + + bool + GetPrintResults () const; + + void + SetPrintResults (bool); + + bool + GetAddToHistory () const; + + void + SetAddToHistory (bool); +private: + lldb_private::CommandInterpreterRunOptions * + get () const; + + lldb_private::CommandInterpreterRunOptions & + ref () const; + + // This is set in the constructor and will always be valid. + mutable std::unique_ptr<lldb_private::CommandInterpreterRunOptions> m_opaque_up; +}; + class SBCommandInterpreter { public: @@ -85,6 +140,15 @@ public: lldb::ReturnStatus HandleCommand (const char *command_line, lldb::SBCommandReturnObject &result, bool add_to_history = false); + lldb::ReturnStatus + HandleCommand (const char *command_line, SBExecutionContext &exe_ctx, SBCommandReturnObject &result, bool add_to_history = false); + + void + HandleCommandsFromFile (lldb::SBFileSpec &file, + lldb::SBExecutionContext &override_context, + lldb::SBCommandInterpreterRunOptions &options, + lldb::SBCommandReturnObject result); + // The pointer based interface is not useful in SWIG, since the cursor & last_char arguments are string pointers INTO current_line // and you can't do that in a scripting language interface in general... @@ -175,9 +239,9 @@ class SBCommandPluginInterface { public: virtual bool - DoExecute (lldb::SBDebugger debugger, - char** command, - lldb::SBCommandReturnObject &result) + DoExecute (lldb::SBDebugger /*debugger*/, + char** /*command*/, + lldb::SBCommandReturnObject & /*result*/) { return false; } diff --git a/include/lldb/API/SBCompileUnit.h b/include/lldb/API/SBCompileUnit.h index 95af3d4722ce..e2c216445d94 100644 --- a/include/lldb/API/SBCompileUnit.h +++ b/include/lldb/API/SBCompileUnit.h @@ -78,6 +78,9 @@ public: lldb::SBTypeList GetTypes (uint32_t type_mask = lldb::eTypeClassAny); + lldb::LanguageType + GetLanguage (); + bool operator == (const lldb::SBCompileUnit &rhs) const; diff --git a/include/lldb/API/SBData.h b/include/lldb/API/SBData.h index 10c002247271..e7656a52d9c2 100644 --- a/include/lldb/API/SBData.h +++ b/include/lldb/API/SBData.h @@ -169,6 +169,7 @@ private: friend class SBInstruction; friend class SBProcess; friend class SBSection; + friend class SBTarget; friend class SBValue; lldb::DataExtractorSP m_opaque_sp; diff --git a/include/lldb/API/SBDebugger.h b/include/lldb/API/SBDebugger.h index 2386ffc968de..6e43e12f7b16 100644 --- a/include/lldb/API/SBDebugger.h +++ b/include/lldb/API/SBDebugger.h @@ -27,6 +27,7 @@ public: void SetIsDone(bool); bool IsActive() const; }; + class SBDebugger { public: @@ -321,6 +322,13 @@ public: RunCommandInterpreter (bool auto_handle_events, bool spawn_thread); + void + RunCommandInterpreter (bool auto_handle_events, + bool spawn_thread, + SBCommandInterpreterRunOptions &options, + int &num_errors, + bool &quit_requested, + bool &stopped_for_crash); private: friend class SBCommandInterpreter; diff --git a/include/lldb/API/SBDefines.h b/include/lldb/API/SBDefines.h index 30ea0dfda56e..b59b79580910 100644 --- a/include/lldb/API/SBDefines.h +++ b/include/lldb/API/SBDefines.h @@ -35,6 +35,7 @@ class LLDB_API SBBreakpointLocation; class LLDB_API SBBroadcaster; class LLDB_API SBCommand; class LLDB_API SBCommandInterpreter; +class LLDB_API SBCommandInterpreterRunOptions; class LLDB_API SBCommandPluginInterface; class LLDB_API SBCommandReturnObject; class LLDB_API SBCommunication; @@ -45,6 +46,7 @@ class LLDB_API SBDeclaration; class LLDB_API SBError; class LLDB_API SBEvent; class LLDB_API SBEventList; +class LLDB_API SBExecutionContext; class LLDB_API SBExpressionOptions; class LLDB_API SBFileSpec; class LLDB_API SBFileSpecList; @@ -70,14 +72,18 @@ class LLDB_API SBSymbolContext; class LLDB_API SBSymbolContextList; class LLDB_API SBTarget; class LLDB_API SBThread; +class LLDB_API SBThreadCollection; +class LLDB_API SBThreadPlan; class LLDB_API SBType; class LLDB_API SBTypeCategory; class LLDB_API SBTypeEnumMember; class LLDB_API SBTypeEnumMemberList; class LLDB_API SBTypeFilter; class LLDB_API SBTypeFormat; +class LLDB_API SBTypeMemberFunction; class LLDB_API SBTypeNameSpecifier; class LLDB_API SBTypeSummary; +class LLDB_API SBTypeSummaryOptions; #ifndef LLDB_DISABLE_PYTHON class LLDB_API SBTypeSynthetic; #endif diff --git a/include/lldb/API/SBEvent.h b/include/lldb/API/SBEvent.h index 6cb975a1ff7b..1706d0c009b9 100644 --- a/include/lldb/API/SBEvent.h +++ b/include/lldb/API/SBEvent.h @@ -30,6 +30,10 @@ public: // Make an event that contains a C string. SBEvent (uint32_t event, const char *cstr, uint32_t cstr_len); + SBEvent (lldb::EventSP &event_sp); + + SBEvent (lldb_private::Event *event_sp); + ~SBEvent(); const SBEvent & @@ -77,8 +81,6 @@ protected: friend class SBThread; friend class SBWatchpoint; - SBEvent (lldb::EventSP &event_sp); - lldb::EventSP & GetSP () const; diff --git a/include/lldb/API/SBExecutionContext.h b/include/lldb/API/SBExecutionContext.h new file mode 100644 index 000000000000..9d889139f5cb --- /dev/null +++ b/include/lldb/API/SBExecutionContext.h @@ -0,0 +1,74 @@ +//===-- SBExecutionContext.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_SBExecutionContext_h_ +#define LLDB_SBExecutionContext_h_ + +#include "lldb/API/SBDefines.h" + +#include <stdio.h> +#include <vector> + + +namespace lldb { + +class SBExecutionContext +{ +friend class SBCommandInterpreter; + +public: + SBExecutionContext(); + + SBExecutionContext (const lldb::SBExecutionContext &rhs); + + SBExecutionContext (lldb::ExecutionContextRefSP exe_ctx_ref_sp); + + SBExecutionContext (const lldb::SBTarget &target); + + SBExecutionContext (const lldb::SBProcess &process); + + SBExecutionContext (lldb::SBThread thread); // can't be a const& because SBThread::get() isn't itself a const function + + SBExecutionContext (const lldb::SBFrame &frame); + + ~SBExecutionContext(); + + const SBExecutionContext & + operator = (const lldb::SBExecutionContext &rhs); + + SBTarget + GetTarget () const; + + SBProcess + GetProcess () const; + + SBThread + GetThread () const; + + SBFrame + GetFrame () const; + +protected: + ExecutionContextRefSP & + GetSP () const; + + void + reset (lldb::ExecutionContextRefSP &event_sp); + + lldb_private::ExecutionContextRef * + get () const; + +private: + + mutable lldb::ExecutionContextRefSP m_exe_ctx_sp; +}; + +} // namespace lldb + +#endif // LLDB_SBExecutionContext_h_ diff --git a/include/lldb/API/SBFileSpec.h b/include/lldb/API/SBFileSpec.h index d262b98d0fd7..1eee3d10367c 100644 --- a/include/lldb/API/SBFileSpec.h +++ b/include/lldb/API/SBFileSpec.h @@ -63,6 +63,7 @@ public: private: friend class SBAttachInfo; friend class SBBlock; + friend class SBCommandInterpreter; friend class SBCompileUnit; friend class SBDeclaration; friend class SBFileSpecList; diff --git a/include/lldb/API/SBFrame.h b/include/lldb/API/SBFrame.h index f6b84ab1ddac..b93e36afecdf 100644 --- a/include/lldb/API/SBFrame.h +++ b/include/lldb/API/SBFrame.h @@ -198,21 +198,6 @@ public: lldb::SBValue FindValue (const char *name, ValueType value_type, lldb::DynamicValueType use_dynamic); - /// Find and watch a variable using the frame as the scope. - /// It returns an SBValue, similar to FindValue() method, if find-and-watch - /// operation succeeds. Otherwise, an invalid SBValue is returned. - /// You can use LLDB_WATCH_TYPE_READ | LLDB_WATCH_TYPE_WRITE for 'rw' watch. - lldb::SBValue - WatchValue (const char *name, ValueType value_type, uint32_t watch_type); - - /// Find and watch the location pointed to by a variable using the frame as - /// the scope. - /// It returns an SBValue, similar to FindValue() method, if find-and-watch - /// operation succeeds. Otherwise, an invalid SBValue is returned. - /// You can use LLDB_WATCH_TYPE_READ | LLDB_WATCH_TYPE_WRITE for 'rw' watch. - lldb::SBValue - WatchLocation (const char *name, ValueType value_type, uint32_t watch_type, size_t size); - bool GetDescription (lldb::SBStream &description); @@ -221,6 +206,7 @@ public: protected: friend class SBBlock; + friend class SBExecutionContext; friend class SBInstruction; friend class SBThread; friend class SBValue; diff --git a/include/lldb/API/SBFunction.h b/include/lldb/API/SBFunction.h index 49a3847efbec..1b0d53d11736 100644 --- a/include/lldb/API/SBFunction.h +++ b/include/lldb/API/SBFunction.h @@ -58,6 +58,9 @@ public: lldb::SBBlock GetBlock (); + + lldb::LanguageType + GetLanguage (); bool operator == (const lldb::SBFunction &rhs) const; diff --git a/include/lldb/API/SBListener.h b/include/lldb/API/SBListener.h index 4a11ec1072f1..58a8fe9a55b7 100644 --- a/include/lldb/API/SBListener.h +++ b/include/lldb/API/SBListener.h @@ -99,13 +99,23 @@ public: HandleBroadcastEvent (const lldb::SBEvent &event); protected: + friend class SBAttachInfo; friend class SBBroadcaster; friend class SBCommandInterpreter; friend class SBDebugger; + friend class SBLaunchInfo; friend class SBTarget; SBListener (lldb_private::Listener &listener); + SBListener (const lldb::ListenerSP &listener_sp); + + lldb::ListenerSP + GetSP () + { + return m_opaque_sp; + } + private: lldb_private::Listener * diff --git a/include/lldb/API/SBProcess.h b/include/lldb/API/SBProcess.h index 4b59462ca3f1..3d6e49c4821d 100644 --- a/include/lldb/API/SBProcess.h +++ b/include/lldb/API/SBProcess.h @@ -316,6 +316,12 @@ public: //------------------------------------------------------------------ const char * GetExtendedBacktraceTypeAtIndex (uint32_t idx); + + lldb::SBThreadCollection + GetHistoryThreads (addr_t addr); + + bool + IsInstrumentationRuntimePresent(InstrumentationRuntimeType type); protected: friend class SBAddress; @@ -323,6 +329,7 @@ protected: friend class SBBreakpointLocation; friend class SBCommandInterpreter; friend class SBDebugger; + friend class SBExecutionContext; friend class SBFunction; friend class SBModule; friend class SBTarget; diff --git a/include/lldb/API/SBSection.h b/include/lldb/API/SBSection.h index 3386484f6496..5a49049502fd 100644 --- a/include/lldb/API/SBSection.h +++ b/include/lldb/API/SBSection.h @@ -71,6 +71,18 @@ public: SectionType GetSectionType (); + //------------------------------------------------------------------ + /// 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 + /// 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/SBStream.h b/include/lldb/API/SBStream.h index fb69c12f0a91..cd33bfda32ba 100644 --- a/include/lldb/API/SBStream.h +++ b/include/lldb/API/SBStream.h @@ -85,8 +85,10 @@ protected: friend class SBSymbolContextList; friend class SBTarget; friend class SBThread; + friend class SBThreadPlan; friend class SBType; friend class SBTypeEnumMember; + friend class SBTypeMemberFunction; friend class SBTypeMember; friend class SBValue; friend class SBWatchpoint; diff --git a/include/lldb/API/SBTarget.h b/include/lldb/API/SBTarget.h index 370d40d0454a..a628467caa43 100644 --- a/include/lldb/API/SBTarget.h +++ b/include/lldb/API/SBTarget.h @@ -22,6 +22,8 @@ namespace lldb { +class SBPlatform; + class SBLaunchInfo { public: @@ -49,7 +51,7 @@ 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. @@ -75,7 +77,29 @@ public: //---------------------------------------------------------------------- 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 (); @@ -256,7 +280,28 @@ public: bool ParentProcessIDIsValid(); - + + //---------------------------------------------------------------------- + /// 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); + protected: friend class SBTarget; @@ -309,6 +354,18 @@ public: GetProcess (); //------------------------------------------------------------------ + /// Return the platform object associated with the target. + /// + /// After return, the platform object should be checked for + /// validity. + /// + /// @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. @@ -564,6 +621,26 @@ public: GetTriple (); //------------------------------------------------------------------ + /// Architecture data byte width accessor + /// + /// @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 + /// 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 @@ -683,11 +760,62 @@ public: //------------------------------------------------------------------ lldb::SBValue FindFirstGlobalVariable (const char* name); + + //------------------------------------------------------------------ + /// Find global and static variables by pattern. + /// + /// @param[in] name + /// The pattern to search for global or static variables + /// + /// @param[in] max_matches + /// Allow the number of matches to be limited to \a max_matches. + /// + /// @param[in] matchtype + /// The match type to use. + /// + /// @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 + /// The pattern to search for global or static variables + /// + /// @param[in] max_matches + /// Allow the number of matches to be limited to \a max_matches. + /// + /// @param[in] matchtype + /// The match type to use. + /// + /// @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 + /// + /// @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 @@ -732,6 +860,31 @@ public: 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 + /// A target address to read from. + /// + /// @param[out] buf + /// The buffer to read memory into. + /// + /// @param[in] size + /// The maximum number of host bytes to read in the buffer passed + /// into this call + /// + /// @param[out] error + /// Error information is written here if the memory read fails. + /// + /// @return + /// The amount of data read in host bytes. + //------------------------------------------------------------------ + size_t + ReadMemory (const SBAddress addr, void *buf, size_t size, lldb::SBError &error); + lldb::SBBreakpoint BreakpointCreateByLocation (const char *file, uint32_t line); @@ -845,6 +998,12 @@ public: lldb::SBValue CreateValueFromAddress (const char *name, lldb::SBAddress addr, lldb::SBType type); + + lldb::SBValue + CreateValueFromData (const char *name, lldb::SBData data, lldb::SBType type); + + lldb::SBValue + CreateValueFromExpression (const char *name, const char* expr); SBSourceManager GetSourceManager(); @@ -893,6 +1052,7 @@ protected: friend class SBAddress; friend class SBBlock; friend class SBDebugger; + friend class SBExecutionContext; friend class SBFunction; friend class SBInstruction; friend class SBModule; diff --git a/include/lldb/API/SBThread.h b/include/lldb/API/SBThread.h index 07a43ebee7ce..db15f651f2d5 100644 --- a/include/lldb/API/SBThread.h +++ b/include/lldb/API/SBThread.h @@ -78,7 +78,10 @@ public: //-------------------------------------------------------------------------- uint64_t GetStopReasonDataAtIndex(uint32_t idx); - + + bool + GetStopReasonExtendedInfoAsJSON (lldb::SBStream &stream); + size_t GetStopDescription (char *dst, size_t dst_len); @@ -127,6 +130,9 @@ public: uint32_t line); SBError + StepUsingScriptedThreadPlan (const char *script_class_name); + + SBError JumpToLine (lldb::SBFileSpec &file_spec, uint32_t line); void @@ -216,9 +222,19 @@ public: bool SafeToCallFunctions (); +#ifndef SWIG + lldb_private::Thread * + operator->(); + + lldb_private::Thread * + get(); + +#endif + protected: friend class SBBreakpoint; friend class SBBreakpointLocation; + friend class SBExecutionContext; friend class SBFrame; friend class SBProcess; friend class SBDebugger; diff --git a/include/lldb/API/SBThreadCollection.h b/include/lldb/API/SBThreadCollection.h new file mode 100644 index 000000000000..b13cbd938e28 --- /dev/null +++ b/include/lldb/API/SBThreadCollection.h @@ -0,0 +1,68 @@ +//===-- SBThreadCollection.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_SBThreadCollection_h_ +#define LLDB_SBThreadCollection_h_ + +#include "lldb/API/SBDefines.h" + +namespace lldb { + +class SBThreadCollection +{ +public: + + SBThreadCollection (); + + SBThreadCollection (const SBThreadCollection &rhs); + + const SBThreadCollection & + operator = (const SBThreadCollection &rhs); + + ~SBThreadCollection (); + + bool + IsValid () const; + + size_t + GetSize (); + + lldb::SBThread + GetThreadAtIndex (size_t idx); + +protected: + + // Mimic shared pointer... + lldb_private::ThreadCollection * + get() const; + + lldb_private::ThreadCollection * + operator->() const; + + lldb::ThreadCollectionSP & + operator*(); + + const lldb::ThreadCollectionSP & + operator*() const; + + SBThreadCollection (const lldb::ThreadCollectionSP &threads); + + void + SetOpaque (const lldb::ThreadCollectionSP &threads); + +private: + friend class SBProcess; + + lldb::ThreadCollectionSP m_opaque_sp; +}; + + +} // namespace lldb + +#endif // LLDB_SBThreadCollection_h_ diff --git a/include/lldb/API/SBThreadPlan.h b/include/lldb/API/SBThreadPlan.h new file mode 100644 index 000000000000..e53942d65fa8 --- /dev/null +++ b/include/lldb/API/SBThreadPlan.h @@ -0,0 +1,129 @@ +//===-- SBThread.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_SBThreadPlan_h_ +#define LLDB_SBThreadPlan_h_ + +#include "lldb/API/SBDefines.h" + +#include <stdio.h> + +namespace lldb { + +class SBThreadPlan +{ + +friend class lldb_private::ThreadPlan; + +public: + SBThreadPlan (); + + SBThreadPlan (const lldb::SBThreadPlan &threadPlan); + + SBThreadPlan (const lldb::ThreadPlanSP& lldb_object_sp); + + SBThreadPlan (lldb::SBThread &thread, const char *class_name); + + ~SBThreadPlan (); + + bool + IsValid() const; + + void + Clear (); + + lldb::StopReason + GetStopReason(); + + /// Get the number of words associated with the stop reason. + /// See also GetStopReasonDataAtIndex(). + size_t + GetStopReasonDataCount(); + + //-------------------------------------------------------------------------- + /// Get information associated with a stop reason. + /// + /// Breakpoint stop reasons will have data that consists of pairs of + /// breakpoint IDs followed by the breakpoint location IDs (they always come + /// in pairs). + /// + /// Stop Reason Count Data Type + /// ======================== ===== ========================================= + /// eStopReasonNone 0 + /// eStopReasonTrace 0 + /// eStopReasonBreakpoint N duple: {breakpoint id, location id} + /// eStopReasonWatchpoint 1 watchpoint id + /// eStopReasonSignal 1 unix signal number + /// eStopReasonException N exception data + /// eStopReasonExec 0 + /// eStopReasonPlanComplete 0 + //-------------------------------------------------------------------------- + uint64_t + GetStopReasonDataAtIndex(uint32_t idx); + + SBThread + GetThread () const; + + const lldb::SBThreadPlan & + operator = (const lldb::SBThreadPlan &rhs); + + bool + GetDescription (lldb::SBStream &description) const; + + void + SetPlanComplete (bool success); + + bool + IsPlanComplete(); + + bool + IsValid(); + + // This section allows an SBThreadPlan to push another of the common types of plans... + SBThreadPlan + QueueThreadPlanForStepOverRange (SBAddress &start_address, + lldb::addr_t range_size); + + SBThreadPlan + QueueThreadPlanForStepInRange (SBAddress &start_address, + lldb::addr_t range_size); + + SBThreadPlan + QueueThreadPlanForStepOut (uint32_t frame_idx_to_step_to, bool first_insn = false); + + SBThreadPlan + QueueThreadPlanForRunToAddress (SBAddress address); + +#ifndef SWIG + lldb_private::ThreadPlan * + get(); +#endif + +protected: + friend class SBBreakpoint; + friend class SBBreakpointLocation; + friend class SBFrame; + friend class SBProcess; + friend class SBDebugger; + friend class SBValue; + friend class lldb_private::QueueImpl; + friend class SBQueueItem; + +#ifndef SWIG + void + SetThreadPlan (const lldb::ThreadPlanSP& lldb_object_sp); +#endif + +private: + lldb::ThreadPlanSP m_opaque_sp; +}; + +} // namespace lldb + +#endif // LLDB_SBThreadPlan_h_ diff --git a/include/lldb/API/SBType.h b/include/lldb/API/SBType.h index 363aa59e35aa..303ddff6dc09 100644 --- a/include/lldb/API/SBType.h +++ b/include/lldb/API/SBType.h @@ -67,6 +67,59 @@ protected: std::unique_ptr<lldb_private::TypeMemberImpl> m_opaque_ap; }; + +class SBTypeMemberFunction +{ +public: + SBTypeMemberFunction (); + + SBTypeMemberFunction (const lldb::SBTypeMemberFunction& rhs); + + ~SBTypeMemberFunction(); + + lldb::SBTypeMemberFunction& + operator = (const lldb::SBTypeMemberFunction& rhs); + + bool + IsValid() const; + + const char * + GetName (); + + lldb::SBType + GetType (); + + lldb::SBType + GetReturnType (); + + uint32_t + GetNumberOfArguments (); + + lldb::SBType + GetArgumentTypeAtIndex (uint32_t); + + lldb::MemberFunctionKind + GetKind(); + + bool + GetDescription (lldb::SBStream &description, + lldb::DescriptionLevel description_level); + +protected: + friend class SBType; + + void + reset (lldb_private::TypeMemberFunctionImpl *); + + lldb_private::TypeMemberFunctionImpl & + ref (); + + const lldb_private::TypeMemberFunctionImpl & + ref () const; + + lldb::TypeMemberFunctionImplSP m_opaque_sp; +}; + class SBType { @@ -96,6 +149,12 @@ public: bool IsPolymorphicClass (); + bool + IsArrayType (); + + bool + IsTypedefType (); + lldb::SBType GetPointerType(); @@ -113,6 +172,9 @@ public: lldb::SBType GetUnqualifiedType(); + + lldb::SBType + GetArrayElementType (); lldb::SBType GetCanonicalType(); @@ -160,6 +222,12 @@ public: lldb::SBTypeList GetFunctionArgumentTypes (); + + uint32_t + GetNumberOfMemberFunctions (); + + lldb::SBTypeMemberFunction + GetMemberFunctionAtIndex (uint32_t idx); const char* GetName(); @@ -172,6 +240,9 @@ public: bool IsTypeComplete (); + + uint32_t + GetTypeFlags (); bool GetDescription (lldb::SBStream &description, @@ -209,6 +280,7 @@ protected: friend class SBTypeEnumMemberList; friend class SBTypeNameSpecifier; friend class SBTypeMember; + friend class SBTypeMemberFunction; friend class SBTypeList; friend class SBValue; diff --git a/include/lldb/API/SBTypeSummary.h b/include/lldb/API/SBTypeSummary.h index 67a8607511cc..220451e6d70b 100644 --- a/include/lldb/API/SBTypeSummary.h +++ b/include/lldb/API/SBTypeSummary.h @@ -15,6 +15,56 @@ #ifndef LLDB_DISABLE_PYTHON namespace lldb { + class SBTypeSummaryOptions + { + public: + SBTypeSummaryOptions(); + + SBTypeSummaryOptions (const lldb::SBTypeSummaryOptions &rhs); + + SBTypeSummaryOptions (const lldb_private::TypeSummaryOptions *lldb_object_ptr); + + ~SBTypeSummaryOptions (); + + bool + IsValid (); + + lldb::LanguageType + GetLanguage (); + + lldb::TypeSummaryCapping + GetCapping (); + + void + SetLanguage (lldb::LanguageType); + + void + SetCapping (lldb::TypeSummaryCapping); + + protected: + friend class SBValue; + + lldb_private::TypeSummaryOptions * + operator->(); + + const lldb_private::TypeSummaryOptions * + operator->() const; + + lldb_private::TypeSummaryOptions * + get (); + + lldb_private::TypeSummaryOptions & + ref(); + + const lldb_private::TypeSummaryOptions & + ref() const; + + void + SetOptions (const lldb_private::TypeSummaryOptions *lldb_object_ptr); + + private: + std::unique_ptr<lldb_private::TypeSummaryOptions> m_opaque_ap; + }; class SBTypeSummary { diff --git a/include/lldb/API/SBValue.h b/include/lldb/API/SBValue.h index 93b869ba9c5c..bedac4ef1d2d 100644 --- a/include/lldb/API/SBValue.h +++ b/include/lldb/API/SBValue.h @@ -91,8 +91,15 @@ public: GetSummary (); const char * + GetSummary (lldb::SBStream& stream, + lldb::SBTypeSummaryOptions& options); + + const char * GetObjectDescription (); + const char * + GetTypeValidatorResult (); + lldb::SBValue GetDynamicValue (lldb::DynamicValueType use_dynamic); @@ -152,6 +159,7 @@ public: lldb::SBValue CreateChildAtOffset (const char *name, uint32_t offset, lldb::SBType type); + // Deprecated - use the expression evaluator to perform type casting lldb::SBValue Cast (lldb::SBType type); @@ -345,6 +353,9 @@ public: lldb::SBType GetType(); + + lldb::SBValue + Persist (); bool GetDescription (lldb::SBStream &description); diff --git a/include/lldb/API/SBValueList.h b/include/lldb/API/SBValueList.h index b9a6aedea3cb..812fdac91c11 100644 --- a/include/lldb/API/SBValueList.h +++ b/include/lldb/API/SBValueList.h @@ -43,6 +43,9 @@ public: lldb::SBValue GetValueAtIndex (uint32_t idx) const; + + lldb::SBValue + GetFirstValueByName (const char* name) const; lldb::SBValue FindValueObjectByUID (lldb::user_id_t uid); |