diff options
Diffstat (limited to 'include/lldb/Core/Debugger.h')
-rw-r--r-- | include/lldb/Core/Debugger.h | 111 |
1 files changed, 70 insertions, 41 deletions
diff --git a/include/lldb/Core/Debugger.h b/include/lldb/Core/Debugger.h index 0d9b90c8919d..4ca648ca296e 100644 --- a/include/lldb/Core/Debugger.h +++ b/include/lldb/Core/Debugger.h @@ -9,11 +9,17 @@ #ifndef liblldb_Debugger_h_ #define liblldb_Debugger_h_ -#if defined(__cplusplus) - +// C Includes #include <stdint.h> +// C++ Includes +#include <memory> +#include <map> +#include <vector> + +// Other libraries and framework includes +// Project includes #include "lldb/lldb-public.h" #include "lldb/Core/Broadcaster.h" #include "lldb/Core/FormatEntity.h" @@ -32,8 +38,8 @@ namespace llvm namespace sys { class DynamicLibrary; -} -} +} // namespace sys +} // namespace llvm namespace lldb_private { @@ -44,7 +50,6 @@ namespace lldb_private { /// Provides a global root objects for the debugger core. //---------------------------------------------------------------------- - class Debugger : public std::enable_shared_from_this<Debugger>, public UserID, @@ -54,9 +59,10 @@ class Debugger : friend class SourceManager; // For GetSourceFileCache. public: + ~Debugger() override; static lldb::DebuggerSP - CreateInstance (lldb::LogOutputCallback log_callback = NULL, void *baton = NULL); + CreateInstance(lldb::LogOutputCallback log_callback = nullptr, void *baton = nullptr); static lldb::TargetSP FindTargetWithProcessID (lldb::pid_t pid); @@ -79,9 +85,26 @@ public: static void Destroy (lldb::DebuggerSP &debugger_sp); - virtual - ~Debugger (); + static lldb::DebuggerSP + FindDebuggerWithID(lldb::user_id_t id); + static lldb::DebuggerSP + FindDebuggerWithInstanceName(const ConstString &instance_name); + + static size_t + GetNumDebuggers(); + + static lldb::DebuggerSP + GetDebuggerAtIndex(size_t index); + + static bool + FormatDisassemblerAddress(const FormatEntity::Entry *format, + const SymbolContext *sc, + const SymbolContext *prev_sc, + const ExecutionContext *exe_ctx, + const Address *addr, + Stream &s); + void Clear(); bool @@ -108,8 +131,6 @@ public: return m_error_file_sp; } - - void SetInputFileHandle (FILE *fh, bool tranfer_ownership); @@ -209,6 +230,10 @@ public: bool IsTopIOHandler (const lldb::IOHandlerSP& reader_sp); + + bool + CheckTopIOHandlerTypes (IOHandler::Type top_type, + IOHandler::Type second_top_type); void PrintAsync (const char *s, size_t len, bool is_stdout); @@ -222,26 +247,6 @@ public: const char * GetIOHandlerHelpPrologue(); - static lldb::DebuggerSP - FindDebuggerWithID (lldb::user_id_t id); - - static lldb::DebuggerSP - FindDebuggerWithInstanceName (const ConstString &instance_name); - - static size_t - GetNumDebuggers(); - - static lldb::DebuggerSP - GetDebuggerAtIndex (size_t index); - - static bool - FormatDisassemblerAddress (const FormatEntity::Entry *format, - const SymbolContext *sc, - const SymbolContext *prev_sc, - const ExecutionContext *exe_ctx, - const Address *addr, - Stream &s); - void ClearIOHandlers (); @@ -257,22 +262,22 @@ public: void SetLoggingCallback (lldb::LogOutputCallback log_callback, void *baton); - //---------------------------------------------------------------------- // Properties Functions //---------------------------------------------------------------------- enum StopDisassemblyType { eStopDisassemblyTypeNever = 0, + eStopDisassemblyTypeNoDebugInfo, eStopDisassemblyTypeNoSource, eStopDisassemblyTypeAlways }; - virtual Error - SetPropertyValue (const ExecutionContext *exe_ctx, - VarSetOperationType op, - const char *property_path, - const char *value); + Error + SetPropertyValue(const ExecutionContext *exe_ctx, + VarSetOperationType op, + const char *property_path, + const char *value) override; bool GetAutoConfirm () const; @@ -329,6 +334,24 @@ public: GetAutoOneLineSummaries () const; bool + GetAutoIndent () const; + + bool + SetAutoIndent (bool b); + + bool + GetPrintDecls () const; + + bool + SetPrintDecls (bool b); + + uint32_t + GetTabSize () const; + + bool + SetTabSize (uint32_t tab_size); + + bool GetEscapeNonPrintables () const; bool @@ -360,6 +383,9 @@ public: { return m_event_handler_thread.IsJoinable(); } + + Error + RunREPL (lldb::LanguageType language, const char *repl_options); // This is for use in the command interpreter, when you either want the selected target, or if no target // is present you want to prime the dummy target with entities that will be copied over to new targets. @@ -367,8 +393,8 @@ public: Target *GetDummyTarget(); protected: - friend class CommandInterpreter; + friend class REPL; bool StartEventHandlerThread(); @@ -380,11 +406,17 @@ protected: EventHandlerThread (lldb::thread_arg_t arg); bool + HasIOHandlerThread(); + + bool StartIOHandlerThread(); void StopIOHandlerThread(); + void + JoinIOHandlerThread(); + static lldb::thread_result_t IOHandlerThread (lldb::thread_arg_t arg); @@ -450,16 +482,13 @@ protected: }; private: - // Use Debugger::CreateInstance() to get a shared pointer to a new // debugger object Debugger (lldb::LogOutputCallback m_log_callback, void *baton); DISALLOW_COPY_AND_ASSIGN (Debugger); - }; } // namespace lldb_private -#endif // #if defined(__cplusplus) -#endif // liblldb_Debugger_h_ +#endif // liblldb_Debugger_h_ |