diff options
Diffstat (limited to 'include/lldb/Core/Debugger.h')
-rw-r--r-- | include/lldb/Core/Debugger.h | 68 |
1 files changed, 30 insertions, 38 deletions
diff --git a/include/lldb/Core/Debugger.h b/include/lldb/Core/Debugger.h index 09f75ef0f8c6..8e608717a801 100644 --- a/include/lldb/Core/Debugger.h +++ b/include/lldb/Core/Debugger.h @@ -1,9 +1,8 @@ //===-- Debugger.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 // //===----------------------------------------------------------------------===// @@ -46,36 +45,26 @@ #include <stddef.h> #include <stdio.h> -namespace lldb_private { -class Address; +namespace llvm { +class raw_ostream; } + namespace lldb_private { +class Address; class CommandInterpreter; -} -namespace lldb_private { class Process; -} -namespace lldb_private { class Stream; -} -namespace lldb_private { class SymbolContext; -} -namespace lldb_private { class Target; -} -namespace llvm { -class raw_ostream; -} -namespace lldb_private { +namespace repro { +class DataRecorder; +} -//---------------------------------------------------------------------- -/// @class Debugger Debugger.h "lldb/Core/Debugger.h" +/// \class Debugger Debugger.h "lldb/Core/Debugger.h" /// A class to manage flag bits. /// /// Provides a global root objects for the debugger core. -//---------------------------------------------------------------------- class Debugger : public std::enable_shared_from_this<Debugger>, public UserID, @@ -106,7 +95,7 @@ public: static lldb::DebuggerSP FindDebuggerWithID(lldb::user_id_t id); static lldb::DebuggerSP - FindDebuggerWithInstanceName(const ConstString &instance_name); + FindDebuggerWithInstanceName(ConstString instance_name); static size_t GetNumDebuggers(); @@ -130,7 +119,10 @@ public: lldb::StreamFileSP GetErrorFile() { return m_error_file_sp; } - void SetInputFileHandle(FILE *fh, bool tranfer_ownership); + repro::DataRecorder *GetInputRecorder(); + + void SetInputFileHandle(FILE *fh, bool tranfer_ownership, + repro::DataRecorder *recorder = nullptr); void SetOutputFileHandle(FILE *fh, bool tranfer_ownership); @@ -145,10 +137,12 @@ public: lldb::StreamSP GetAsyncErrorStream(); CommandInterpreter &GetCommandInterpreter() { - assert(m_command_interpreter_ap.get()); - return *m_command_interpreter_ap; + assert(m_command_interpreter_up.get()); + return *m_command_interpreter_up; } + ScriptInterpreter *GetScriptInterpreter(bool can_create = true); + lldb::ListenerSP GetListener() { return m_listener_sp; } // This returns the Debugger's scratch source manager. It won't be able to @@ -162,16 +156,14 @@ public: } ExecutionContext GetSelectedExecutionContext(); - //------------------------------------------------------------------ /// Get accessor for the target list. /// /// The target list is part of the global debugger object. This the single /// debugger shared instance to control where targets get created and to /// allow for tracking and searching for targets based on certain criteria. /// - /// @return + /// \return /// A global shared target list. - //------------------------------------------------------------------ TargetList &GetTargetList() { return m_target_list; } PlatformList &GetPlatformList() { return m_platform_list; } @@ -180,10 +172,8 @@ public: void DispatchInputEndOfFile(); - //------------------------------------------------------------------ // If any of the streams are not set, set them to the in/out/err stream of // the top most input reader to ensure they at least have something - //------------------------------------------------------------------ void AdoptTopIOHandlerFilesIfInvalid(lldb::StreamFileSP &in, lldb::StreamFileSP &out, lldb::StreamFileSP &err); @@ -222,9 +212,7 @@ public: void SetLoggingCallback(lldb::LogOutputCallback log_callback, void *baton); - //---------------------------------------------------------------------- // Properties Functions - //---------------------------------------------------------------------- enum StopDisassemblyType { eStopDisassemblyTypeNever = 0, eStopDisassemblyTypeNoDebugInfo, @@ -303,7 +291,7 @@ public: bool GetNotifyVoid() const; - const ConstString &GetInstanceName() { return m_instance_name; } + ConstString GetInstanceName() { return m_instance_name; } bool LoadPlugin(const FileSpec &spec, Status &error); @@ -371,6 +359,9 @@ protected: lldb::StreamFileSP m_output_file_sp; lldb::StreamFileSP m_error_file_sp; + /// Used for shadowing the input file when capturing a reproducer. + repro::DataRecorder *m_input_recorder; + lldb::BroadcasterManagerSP m_broadcaster_manager_sp; // The debugger acts as a // broadcaster manager of // last resort. @@ -382,7 +373,7 @@ protected: PlatformList m_platform_list; lldb::ListenerSP m_listener_sp; - std::unique_ptr<SourceManager> m_source_manager_ap; // This is a scratch + std::unique_ptr<SourceManager> m_source_manager_up; // This is a scratch // source manager that we // return if we have no // targets. @@ -391,7 +382,10 @@ protected: // this debugger used this // shared // source file cache. - std::unique_ptr<CommandInterpreter> m_command_interpreter_ap; + std::unique_ptr<CommandInterpreter> m_command_interpreter_up; + + lldb::ScriptInterpreterSP m_script_interpreter_sp; + std::recursive_mutex m_script_interpreter_mutex; IOHandlerStack m_input_reader_stack; llvm::StringMap<std::weak_ptr<llvm::raw_ostream>> m_log_streams; @@ -406,9 +400,7 @@ protected: lldb::ListenerSP m_forward_listener_sp; llvm::once_flag m_clear_once; - //---------------------------------------------------------------------- // Events for m_sync_broadcaster - //---------------------------------------------------------------------- enum { eBroadcastBitEventThreadIsListening = (1 << 0), }; |