diff options
Diffstat (limited to 'include/lldb/API')
-rw-r--r-- | include/lldb/API/LLDB.h | 3 | ||||
-rw-r--r-- | include/lldb/API/SBAddress.h | 1 | ||||
-rw-r--r-- | include/lldb/API/SBCommandInterpreter.h | 30 | ||||
-rw-r--r-- | include/lldb/API/SBDebugger.h | 20 | ||||
-rw-r--r-- | include/lldb/API/SBDefines.h | 1 | ||||
-rw-r--r-- | include/lldb/API/SBError.h | 1 | ||||
-rw-r--r-- | include/lldb/API/SBInputReader.h | 97 | ||||
-rw-r--r-- | include/lldb/API/SBModule.h | 19 | ||||
-rw-r--r-- | include/lldb/API/SBProcess.h | 11 | ||||
-rw-r--r-- | include/lldb/API/SBQueue.h | 83 | ||||
-rw-r--r-- | include/lldb/API/SBQueueItem.h | 58 | ||||
-rw-r--r-- | include/lldb/API/SBTarget.h | 38 | ||||
-rw-r--r-- | include/lldb/API/SBThread.h | 2 | ||||
-rw-r--r-- | include/lldb/API/SBType.h | 3 | ||||
-rw-r--r-- | include/lldb/API/SBTypeFormat.h | 18 |
15 files changed, 278 insertions, 107 deletions
diff --git a/include/lldb/API/LLDB.h b/include/lldb/API/LLDB.h index 93bc3bc121e2a..b9c3198b73e56 100644 --- a/include/lldb/API/LLDB.h +++ b/include/lldb/API/LLDB.h @@ -33,13 +33,14 @@ #include "lldb/API/SBFrame.h" #include "lldb/API/SBFunction.h" #include "lldb/API/SBHostOS.h" -#include "lldb/API/SBInputReader.h" #include "lldb/API/SBInstruction.h" #include "lldb/API/SBInstructionList.h" #include "lldb/API/SBLineEntry.h" #include "lldb/API/SBListener.h" #include "lldb/API/SBModule.h" #include "lldb/API/SBProcess.h" +#include "lldb/API/SBQueue.h" +#include "lldb/API/SBQueueItem.h" #include "lldb/API/SBSourceManager.h" #include "lldb/API/SBStream.h" #include "lldb/API/SBStringList.h" diff --git a/include/lldb/API/SBAddress.h b/include/lldb/API/SBAddress.h index c5e8cc685a4cd..58a7d2bfb1dab 100644 --- a/include/lldb/API/SBAddress.h +++ b/include/lldb/API/SBAddress.h @@ -118,6 +118,7 @@ protected: friend class SBTarget; friend class SBThread; friend class SBValue; + friend class SBQueueItem; lldb_private::Address * operator->(); diff --git a/include/lldb/API/SBCommandInterpreter.h b/include/lldb/API/SBCommandInterpreter.h index 9b2583cd85cac..184a6b473126f 100644 --- a/include/lldb/API/SBCommandInterpreter.h +++ b/include/lldb/API/SBCommandInterpreter.h @@ -122,6 +122,36 @@ public: SBCommandInterpreter (lldb_private::CommandInterpreter *interpreter_ptr = NULL); // 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. + /// + /// Some GUI programs will intercept "control + char" sequences and want + /// to have them do what normally would happen when using a real + /// terminal, so this function allows GUI programs to emulate this + /// functionality. + /// + /// @param[in] ch + /// The character that was typed along with the control key + /// + /// @return + /// The string that should be written into the file handle that is + /// feeding the input stream for the debugger, or NULL if there is + /// no string for this control key. + //---------------------------------------------------------------------- + const char * + GetIOHandlerControlSequence(char ch); + protected: lldb_private::CommandInterpreter & diff --git a/include/lldb/API/SBDebugger.h b/include/lldb/API/SBDebugger.h index 80e6969cbd3ab..2386ffc968de5 100644 --- a/include/lldb/API/SBDebugger.h +++ b/include/lldb/API/SBDebugger.h @@ -17,6 +17,16 @@ namespace lldb { + +class SBInputReader +{ +public: + SBInputReader(); + ~SBInputReader(); + SBError Initialize(lldb::SBDebugger&, unsigned long (*)(void*, lldb::SBInputReader*, lldb::InputReaderAction, char const*, unsigned long), void*, lldb::InputReaderGranularity, char const*, char const*, bool); + void SetIsDone(bool); + bool IsActive() const; +}; class SBDebugger { public: @@ -231,12 +241,6 @@ public: void PushInputReader (lldb::SBInputReader &reader); - void - NotifyTopInputReader (lldb::InputReaderAction notification); - - bool - InputReaderIsTopReader (const lldb::SBInputReader &reader); - const char * GetInstanceName (); @@ -313,6 +317,10 @@ public: GetSyntheticForType (SBTypeNameSpecifier); #endif + void + RunCommandInterpreter (bool auto_handle_events, + bool spawn_thread); + private: friend class SBCommandInterpreter; diff --git a/include/lldb/API/SBDefines.h b/include/lldb/API/SBDefines.h index 2cdf92170d8db..8779d43d1f40e 100644 --- a/include/lldb/API/SBDefines.h +++ b/include/lldb/API/SBDefines.h @@ -48,7 +48,6 @@ class SBFileSpecList; class SBFrame; class SBFunction; class SBHostOS; -class SBInputReader; class SBInstruction; class SBInstructionList; class SBLineEntry; diff --git a/include/lldb/API/SBError.h b/include/lldb/API/SBError.h index 12b34ec6dbc3d..25d7e81a3be52 100644 --- a/include/lldb/API/SBError.h +++ b/include/lldb/API/SBError.h @@ -71,7 +71,6 @@ protected: friend class SBDebugger; friend class SBCommunication; friend class SBHostOS; - friend class SBInputReader; friend class SBPlatform; friend class SBProcess; friend class SBThread; diff --git a/include/lldb/API/SBInputReader.h b/include/lldb/API/SBInputReader.h deleted file mode 100644 index 61f7de4fde4c1..0000000000000 --- a/include/lldb/API/SBInputReader.h +++ /dev/null @@ -1,97 +0,0 @@ -//===-- SBInputReader.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_SBInputReader_h_ -#define LLDB_SBInputReader_h_ - -#include "lldb/API/SBDefines.h" - -namespace lldb { - -class SBInputReader -{ -public: - - typedef size_t (*Callback) (void *baton, - SBInputReader *reader, - InputReaderAction notification, - const char *bytes, - size_t bytes_len); - - SBInputReader (); - - SBInputReader (const lldb::InputReaderSP &reader_sp); - - SBInputReader (const lldb::SBInputReader &rhs); - - ~SBInputReader (); - - - SBError - Initialize (SBDebugger &debugger, - Callback callback, - void *callback_baton, - lldb::InputReaderGranularity granularity, - const char *end_token, - const char *prompt, - bool echo); - - bool - IsValid () const; - - const lldb::SBInputReader & - operator = (const lldb::SBInputReader &rhs); - - bool - IsActive () const; - - bool - IsDone () const; - - void - SetIsDone (bool value); - - InputReaderGranularity - GetGranularity (); - -protected: - friend class SBDebugger; - - lldb_private::InputReader * - operator->() const; - - lldb::InputReaderSP & - operator *(); - - const lldb::InputReaderSP & - operator *() const; - - lldb_private::InputReader * - get() const; - - lldb_private::InputReader & - ref() const; - -private: - - static size_t - PrivateCallback (void *baton, - lldb_private::InputReader &reader, - lldb::InputReaderAction notification, - const char *bytes, - size_t bytes_len); - - lldb::InputReaderSP m_opaque_sp; - Callback m_callback_function; - void *m_callback_baton; -}; - -} // namespace lldb - -#endif // LLDB_SBInputReader_h_ diff --git a/include/lldb/API/SBModule.h b/include/lldb/API/SBModule.h index f5955b39734de..e85654bccc72a 100644 --- a/include/lldb/API/SBModule.h +++ b/include/lldb/API/SBModule.h @@ -235,6 +235,25 @@ 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 + /// types, but it is sometimes useful when debugging type issues to + /// be able to grab a type using its type ID. + /// + /// For DWARF debug info, the type ID is the DIE offset. + /// + /// @param[in] uid + /// The type user ID. + /// + /// @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); diff --git a/include/lldb/API/SBProcess.h b/include/lldb/API/SBProcess.h index 4ecaeaa499202..f2846710c6148 100644 --- a/include/lldb/API/SBProcess.h +++ b/include/lldb/API/SBProcess.h @@ -13,6 +13,7 @@ #include "lldb/API/SBDefines.h" #include "lldb/API/SBError.h" #include "lldb/API/SBTarget.h" +#include "lldb/API/SBQueue.h" #include <stdio.h> namespace lldb { @@ -142,6 +143,15 @@ public: SetSelectedThreadByIndexID (uint32_t index_id); //------------------------------------------------------------------ + // Queue related functions + //------------------------------------------------------------------ + uint32_t + GetNumQueues (); + + lldb::SBQueue + GetQueueAtIndex (size_t index); + + //------------------------------------------------------------------ // Stepping related functions //------------------------------------------------------------------ @@ -312,6 +322,7 @@ protected: friend class SBTarget; friend class SBThread; friend class SBValue; + friend class lldb_private::QueueImpl; lldb::ProcessSP GetSP() const; diff --git a/include/lldb/API/SBQueue.h b/include/lldb/API/SBQueue.h new file mode 100644 index 0000000000000..6ab9aa09f4661 --- /dev/null +++ b/include/lldb/API/SBQueue.h @@ -0,0 +1,83 @@ +//===-- SBQueue.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_SBQueue_h_ +#define LLDB_SBQueue_h_ + +#include <vector> + +#include "lldb/lldb-forward.h" +#include "lldb/API/SBDefines.h" +#include "lldb/API/SBQueueItem.h" + +namespace lldb { + +class SBQueue +{ +public: + SBQueue (); + + SBQueue (const QueueSP& queue_sp); + + SBQueue (const SBQueue& rhs); + + const SBQueue & + operator= (const lldb::SBQueue& rhs); + + ~SBQueue(); + + bool + IsValid() const; + + void + Clear (); + + lldb::SBProcess + GetProcess (); + + lldb::queue_id_t + GetQueueID () const; + + const char * + GetName () const; + + uint32_t + GetIndexID () const; + + uint32_t + GetNumThreads (); + + lldb::SBThread + GetThreadAtIndex (uint32_t); + + uint32_t + GetNumPendingItems (); + + lldb::SBQueueItem + GetPendingItemAtIndex (uint32_t); + +protected: + friend class SBProcess; + + void + SetQueue (const lldb::QueueSP& queue_sp); + + void + FetchThreads (); + + void + FetchItems (); + +private: + std::shared_ptr<lldb_private::QueueImpl> m_opaque_sp; +}; + +} // namespace lldb + +#endif // LLDB_SBQueue_h_ diff --git a/include/lldb/API/SBQueueItem.h b/include/lldb/API/SBQueueItem.h new file mode 100644 index 0000000000000..355c5ac90a23c --- /dev/null +++ b/include/lldb/API/SBQueueItem.h @@ -0,0 +1,58 @@ +//===-- SBQueueItem.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_SBQueueItem_h_ +#define LLDB_SBQueueItem_h_ + +#include "lldb/API/SBDefines.h" +#include "lldb/API/SBAddress.h" +#include "lldb/API/SBThread.h" + +namespace lldb { + +class SBQueueItem +{ +public: + SBQueueItem (); + + SBQueueItem (const lldb::QueueItemSP& queue_item_sp); + + ~SBQueueItem(); + + bool + IsValid() const; + + void + Clear (); + + lldb::QueueItemKind + GetKind () const; + + void + SetKind (lldb::QueueItemKind kind); + + lldb::SBAddress + GetAddress () const; + + void + SetAddress (lldb::SBAddress addr); + + void + SetQueueItem (const lldb::QueueItemSP& queue_item_sp); + + SBThread + GetExtendedBacktraceThread (const char *type); + +private: + lldb::QueueItemSP m_queue_item_sp; +}; + +} // namespace lldb + +#endif // LLDB_SBQueueItem_h_ diff --git a/include/lldb/API/SBTarget.h b/include/lldb/API/SBTarget.h index b41c11811549e..230dffc682517 100644 --- a/include/lldb/API/SBTarget.h +++ b/include/lldb/API/SBTarget.h @@ -646,9 +646,47 @@ public: void Clear (); + //------------------------------------------------------------------ + /// Resolve a current load address into a section offset address. + /// + /// @param[in] vm_addr + /// A virtual address from the current process state that is to + /// be translated into a section offset address. + /// + /// @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 + /// 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 + /// the time at which the sample was taken. Specifying + /// UINT32_MAX will always resolve the address using the + /// currently loaded sections. + /// + /// @param[in] vm_addr + /// A virtual address from the current process state that is to + /// be translated into a section offset address. + /// + /// @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); diff --git a/include/lldb/API/SBThread.h b/include/lldb/API/SBThread.h index 6542dca1f95a4..04b6c86e6d89d 100644 --- a/include/lldb/API/SBThread.h +++ b/include/lldb/API/SBThread.h @@ -214,6 +214,8 @@ protected: friend class SBProcess; friend class SBDebugger; friend class SBValue; + friend class lldb_private::QueueImpl; + friend class SBQueueItem; void SetThread (const lldb::ThreadSP& lldb_object_sp); diff --git a/include/lldb/API/SBType.h b/include/lldb/API/SBType.h index 3729b2f84b906..2cd9b4459a33c 100644 --- a/include/lldb/API/SBType.h +++ b/include/lldb/API/SBType.h @@ -106,6 +106,9 @@ public: GetReferenceType(); lldb::SBType + GetTypedefedType(); + + lldb::SBType GetDereferencedType(); lldb::SBType diff --git a/include/lldb/API/SBTypeFormat.h b/include/lldb/API/SBTypeFormat.h index cd6345fbe6fa6..eb45ff2b0ebaf 100644 --- a/include/lldb/API/SBTypeFormat.h +++ b/include/lldb/API/SBTypeFormat.h @@ -22,6 +22,9 @@ public: SBTypeFormat (lldb::Format format, uint32_t options = 0); // see lldb::eTypeOption values + + SBTypeFormat (const char* type, + uint32_t options = 0); // see lldb::eTypeOption values SBTypeFormat (const lldb::SBTypeFormat &rhs); @@ -33,6 +36,9 @@ public: lldb::Format GetFormat (); + const char* + GetTypeName (); + uint32_t GetOptions(); @@ -40,6 +46,9 @@ public: SetFormat (lldb::Format); void + SetTypeName (const char*); + + void SetOptions (uint32_t); bool @@ -73,8 +82,15 @@ protected: SBTypeFormat (const lldb::TypeFormatImplSP &); + enum class Type + { + eTypeKeepSame, + eTypeFormat, + eTypeEnum + }; + bool - CopyOnWrite_Impl(); + CopyOnWrite_Impl(Type); }; |