LLDB  mainline
Debugger.h
Go to the documentation of this file.
1 //===-- Debugger.h ----------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_CORE_DEBUGGER_H
10 #define LLDB_CORE_DEBUGGER_H
11 
12 #include <cstdint>
13 
14 #include <memory>
15 #include <vector>
16 
17 #include "lldb/Core/FormatEntity.h"
18 #include "lldb/Core/IOHandler.h"
20 #include "lldb/Core/StreamFile.h"
22 #include "lldb/Host/HostThread.h"
23 #include "lldb/Host/Terminal.h"
25 #include "lldb/Target/Platform.h"
26 #include "lldb/Target/TargetList.h"
29 #include "lldb/Utility/FileSpec.h"
30 #include "lldb/Utility/Status.h"
31 #include "lldb/Utility/UserID.h"
32 #include "lldb/lldb-defines.h"
33 #include "lldb/lldb-enumerations.h"
34 #include "lldb/lldb-forward.h"
37 #include "lldb/lldb-types.h"
38 
39 #include "llvm/ADT/ArrayRef.h"
40 #include "llvm/ADT/StringMap.h"
41 #include "llvm/ADT/StringRef.h"
42 #include "llvm/Support/DynamicLibrary.h"
43 #include "llvm/Support/Threading.h"
44 
45 #include <cassert>
46 #include <cstddef>
47 #include <cstdio>
48 
49 namespace llvm {
50 class raw_ostream;
51 }
52 
53 namespace lldb_private {
54 class Address;
55 class CommandInterpreter;
56 class Process;
57 class Stream;
58 class SymbolContext;
59 class Target;
60 
61 namespace repro {
62 class DataRecorder;
63 }
64 
65 /// \class Debugger Debugger.h "lldb/Core/Debugger.h"
66 /// A class to manage flag bits.
67 ///
68 /// Provides a global root objects for the debugger core.
69 
70 class Debugger : public std::enable_shared_from_this<Debugger>,
71  public UserID,
72  public Properties {
73  friend class SourceManager; // For GetSourceFileCache.
74 
75 public:
76  /// Broadcaster event bits definitions.
77  enum {
79  };
80 
82 
83  /// Get the public broadcaster for this debugger.
85  const Broadcaster &GetBroadcaster() const { return m_broadcaster; }
86 
87  class ProgressEventData : public EventData {
88 
89  public:
90  ProgressEventData(uint64_t progress_id, const std::string &message,
91  uint64_t completed, uint64_t total,
92  bool debugger_specific)
93  : m_message(message), m_id(progress_id), m_completed(completed),
94  m_total(total), m_debugger_specific(debugger_specific) {}
95 
97 
98  ConstString GetFlavor() const override;
99 
100  void Dump(Stream *s) const override;
101 
102  static const ProgressEventData *
103  GetEventDataFromEvent(const Event *event_ptr);
104  uint64_t GetID() const { return m_id; }
105  uint64_t GetCompleted() const { return m_completed; }
106  uint64_t GetTotal() const { return m_total; }
107  const std::string &GetMessage() const { return m_message; }
108  bool IsDebuggerSpecific() const { return m_debugger_specific; }
109 
110  private:
112  const uint64_t m_id;
113  uint64_t m_completed;
114  const uint64_t m_total;
116  ProgressEventData(const ProgressEventData &) = delete;
117  const ProgressEventData &operator=(const ProgressEventData &) = delete;
118  };
119 
120  ~Debugger() override;
121 
122  static lldb::DebuggerSP
123  CreateInstance(lldb::LogOutputCallback log_callback = nullptr,
124  void *baton = nullptr);
125 
126  static lldb::TargetSP FindTargetWithProcessID(lldb::pid_t pid);
127 
128  static lldb::TargetSP FindTargetWithProcess(Process *process);
129 
130  static void Initialize(LoadPluginCallbackType load_plugin_callback);
131 
132  static void Terminate();
133 
134  static void SettingsInitialize();
135 
136  static void SettingsTerminate();
137 
138  static void Destroy(lldb::DebuggerSP &debugger_sp);
139 
140  static lldb::DebuggerSP FindDebuggerWithID(lldb::user_id_t id);
141 
142  static lldb::DebuggerSP
144 
145  static size_t GetNumDebuggers();
146 
147  static lldb::DebuggerSP GetDebuggerAtIndex(size_t index);
148 
149  static bool FormatDisassemblerAddress(const FormatEntity::Entry *format,
150  const SymbolContext *sc,
151  const SymbolContext *prev_sc,
152  const ExecutionContext *exe_ctx,
153  const Address *addr, Stream &s);
154 
155  void Clear();
156 
157  bool GetAsyncExecution();
158 
159  void SetAsyncExecution(bool async);
160 
161  lldb::FileSP GetInputFileSP() { return m_input_file_sp; }
162 
163  lldb::StreamFileSP GetOutputStreamSP() { return m_output_stream_sp; }
164 
165  lldb::StreamFileSP GetErrorStreamSP() { return m_error_stream_sp; }
166 
168 
169  File &GetOutputFile() { return m_output_stream_sp->GetFile(); }
170 
171  File &GetErrorFile() { return m_error_stream_sp->GetFile(); }
172 
174 
176 
178 
179  void SetInputFile(lldb::FileSP file, repro::DataRecorder *recorder = nullptr);
180 
181  void SetOutputFile(lldb::FileSP file);
182 
183  void SetErrorFile(lldb::FileSP file);
184 
185  void SaveInputTerminalState();
186 
188 
189  lldb::StreamSP GetAsyncOutputStream();
190 
191  lldb::StreamSP GetAsyncErrorStream();
192 
194  assert(m_command_interpreter_up.get());
195  return *m_command_interpreter_up;
196  }
197 
199  GetScriptInterpreter(bool can_create = true,
200  llvm::Optional<lldb::ScriptLanguage> language = {});
201 
202  lldb::ListenerSP GetListener() { return m_listener_sp; }
203 
204  // This returns the Debugger's scratch source manager. It won't be able to
205  // look up files in debug information, but it can look up files by absolute
206  // path and display them to you. To get the target's source manager, call
207  // GetSourceManager on the target instead.
209 
210  lldb::TargetSP GetSelectedTarget() {
212  }
213 
215  /// Get accessor for the target list.
216  ///
217  /// The target list is part of the global debugger object. This the single
218  /// debugger shared instance to control where targets get created and to
219  /// allow for tracking and searching for targets based on certain criteria.
220  ///
221  /// \return
222  /// A global shared target list.
224 
226 
227  void DispatchInputInterrupt();
228 
229  void DispatchInputEndOfFile();
230 
231  // If any of the streams are not set, set them to the in/out/err stream of
232  // the top most input reader to ensure they at least have something
233  void AdoptTopIOHandlerFilesIfInvalid(lldb::FileSP &in,
234  lldb::StreamFileSP &out,
235  lldb::StreamFileSP &err);
236 
237  /// Run the given IO handler and return immediately.
238  void RunIOHandlerAsync(const lldb::IOHandlerSP &reader_sp,
239  bool cancel_top_handler = true);
240 
241  /// Run the given IO handler and block until it's complete.
242  void RunIOHandlerSync(const lldb::IOHandlerSP &reader_sp);
243 
244  /// Remove the given IO handler if it's currently active.
245  bool RemoveIOHandler(const lldb::IOHandlerSP &reader_sp);
246 
247  bool IsTopIOHandler(const lldb::IOHandlerSP &reader_sp);
248 
250  IOHandler::Type second_top_type);
251 
252  void PrintAsync(const char *s, size_t len, bool is_stdout);
253 
255 
256  const char *GetIOHandlerCommandPrefix();
257 
258  const char *GetIOHandlerHelpPrologue();
259 
260  void ClearIOHandlers();
261 
262  bool GetCloseInputOnEOF() const;
263 
264  void SetCloseInputOnEOF(bool b);
265 
266  bool EnableLog(llvm::StringRef channel,
267  llvm::ArrayRef<const char *> categories,
268  llvm::StringRef log_file, uint32_t log_options,
269  llvm::raw_ostream &error_stream);
270 
271  void SetLoggingCallback(lldb::LogOutputCallback log_callback, void *baton);
272 
273  // Properties Functions
279  };
280 
282  VarSetOperationType op, llvm::StringRef property_path,
283  llvm::StringRef value) override;
284 
285  bool GetAutoConfirm() const;
286 
288 
289  const FormatEntity::Entry *GetFrameFormat() const;
290 
292 
294 
295  const FormatEntity::Entry *GetThreadFormat() const;
296 
298 
300 
301  bool SetScriptLanguage(lldb::ScriptLanguage script_lang);
302 
303  uint32_t GetTerminalWidth() const;
304 
305  bool SetTerminalWidth(uint32_t term_width);
306 
307  llvm::StringRef GetPrompt() const;
308 
309  void SetPrompt(llvm::StringRef p);
310  void SetPrompt(const char *) = delete;
311 
312  llvm::StringRef GetReproducerPath() const;
313 
314  bool GetUseExternalEditor() const;
315 
316  bool SetUseExternalEditor(bool use_external_editor_p);
317 
318  bool GetUseColor() const;
319 
320  bool SetUseColor(bool use_color);
321 
322  bool GetUseAutosuggestion() const;
323 
324  bool GetUseSourceCache() const;
325 
326  bool SetUseSourceCache(bool use_source_cache);
327 
328  bool GetHighlightSource() const;
329 
331 
332  llvm::StringRef GetStopShowColumnAnsiPrefix() const;
333 
334  llvm::StringRef GetStopShowColumnAnsiSuffix() const;
335 
336  uint32_t GetStopSourceLineCount(bool before) const;
337 
339 
341 
342  llvm::StringRef GetStopShowLineMarkerAnsiPrefix() const;
343 
344  llvm::StringRef GetStopShowLineMarkerAnsiSuffix() const;
345 
346  bool GetAutoOneLineSummaries() const;
347 
348  bool GetAutoIndent() const;
349 
350  bool SetAutoIndent(bool b);
351 
352  bool GetPrintDecls() const;
353 
354  bool SetPrintDecls(bool b);
355 
356  uint32_t GetTabSize() const;
357 
358  bool SetTabSize(uint32_t tab_size);
359 
360  bool GetEscapeNonPrintables() const;
361 
362  bool GetNotifyVoid() const;
363 
365 
366  bool LoadPlugin(const FileSpec &spec, Status &error);
367 
368  void RunIOHandlers();
369 
370  bool IsForwardingEvents();
371 
372  void EnableForwardEvents(const lldb::ListenerSP &listener_sp);
373 
374  void CancelForwardEvents(const lldb::ListenerSP &listener_sp);
375 
377 
378  Status RunREPL(lldb::LanguageType language, const char *repl_options);
379 
380  // This is for use in the command interpreter, when you either want the
381  // selected target, or if no target is present you want to prime the dummy
382  // target with entities that will be copied over to new targets.
383  Target &GetSelectedOrDummyTarget(bool prefer_dummy = false);
385 
386  lldb::BroadcasterManagerSP GetBroadcasterManager() {
388  }
389 
390 protected:
391  friend class CommandInterpreter;
392  friend class REPL;
393  friend class Progress;
394 
395  /// Report progress events.
396  ///
397  /// Progress events will be delivered to any debuggers that have listeners
398  /// for the eBroadcastBitProgress. This function is called by the
399  /// lldb_private::Progress class to deliver the events to any debuggers that
400  /// qualify.
401  ///
402  /// \param [in] progress_id
403  /// The unique integer identifier for the progress to report.
404  ///
405  /// \param[in] message
406  /// The title of the progress dialog to display in the UI.
407  ///
408  /// \param [in] completed
409  /// The amount of work completed. If \a completed is zero, then this event
410  /// is a progress started event. If \a completed is equal to \a total, then
411  /// this event is a progress end event. Otherwise completed indicates the
412  /// current progress compare to the total value.
413  ///
414  /// \param [in] total
415  /// The total amount of work units that need to be completed. If this value
416  /// is UINT64_MAX, then an indeterminate progress indicator should be
417  /// displayed.
418  ///
419  /// \param [in] debugger_id
420  /// If this optional parameter has a value, it indicates the unique
421  /// debugger identifier that this progress should be delivered to. If this
422  /// optional parameter does not have a value, the progress will be
423  /// delivered to all debuggers.
424  static void ReportProgress(uint64_t progress_id, const std::string &message,
425  uint64_t completed, uint64_t total,
426  llvm::Optional<lldb::user_id_t> debugger_id);
427 
429 
430  void StopEventHandlerThread();
431 
433 
434  void PushIOHandler(const lldb::IOHandlerSP &reader_sp,
435  bool cancel_top_handler = true);
436 
437  bool PopIOHandler(const lldb::IOHandlerSP &reader_sp);
438 
439  bool HasIOHandlerThread();
440 
441  bool StartIOHandlerThread();
442 
443  void StopIOHandlerThread();
444 
445  void JoinIOHandlerThread();
446 
448 
449  void DefaultEventHandler();
450 
451  void HandleBreakpointEvent(const lldb::EventSP &event_sp);
452 
453  void HandleProcessEvent(const lldb::EventSP &event_sp);
454 
455  void HandleThreadEvent(const lldb::EventSP &event_sp);
456 
457  // Ensures two threads don't attempt to flush process output in parallel.
459  void FlushProcessOutput(Process &process, bool flush_stdout,
460  bool flush_stderr);
461 
463  return m_source_file_cache;
464  }
465 
466  void InstanceInitialize();
467 
468  // these should never be NULL
469  lldb::FileSP m_input_file_sp;
470  lldb::StreamFileSP m_output_stream_sp;
471  lldb::StreamFileSP m_error_stream_sp;
472 
473  /// Used for shadowing the input file when capturing a reproducer.
475 
476  lldb::BroadcasterManagerSP m_broadcaster_manager_sp; // The debugger acts as a
477  // broadcaster manager of
478  // last resort.
479  // It needs to get constructed before the target_list or any other member
480  // that might want to broadcast through the debugger.
481 
482  TerminalState m_terminal_state;
484 
486  lldb::ListenerSP m_listener_sp;
487  std::unique_ptr<SourceManager> m_source_manager_up; // This is a scratch
488  // source manager that we
489  // return if we have no
490  // targets.
492  // for targets created in
493  // this debugger used this
494  // shared
495  // source file cache.
496  std::unique_ptr<CommandInterpreter> m_command_interpreter_up;
497 
498  std::recursive_mutex m_script_interpreter_mutex;
499  std::array<lldb::ScriptInterpreterSP, lldb::eScriptLanguageUnknown>
501 
503  std::recursive_mutex m_io_handler_synchronous_mutex;
504 
505  llvm::StringMap<std::weak_ptr<llvm::raw_ostream>> m_log_streams;
506  std::shared_ptr<llvm::raw_ostream> m_log_callback_stream_sp;
508  static LoadPluginCallbackType g_load_plugin_callback;
509  typedef std::vector<llvm::sys::DynamicLibrary> LoadedPluginsList;
513  Broadcaster m_sync_broadcaster; ///< Private debugger synchronization.
514  Broadcaster m_broadcaster; ///< Public Debugger event broadcaster.
515  lldb::ListenerSP m_forward_listener_sp;
516  llvm::once_flag m_clear_once;
517  lldb::TargetSP m_dummy_target_sp;
518 
519  // Events for m_sync_broadcaster
520  enum {
522  };
523 
524 private:
525  // Use Debugger::CreateInstance() to get a shared pointer to a new debugger
526  // object
527  Debugger(lldb::LogOutputCallback m_log_callback, void *baton);
528 
529  Debugger(const Debugger &) = delete;
530  const Debugger &operator=(const Debugger &) = delete;
531 };
532 
533 } // namespace lldb_private
534 
535 #endif // LLDB_CORE_DEBUGGER_H
lldb_private::Debugger::SettingsTerminate
static void SettingsTerminate()
Definition: Debugger.cpp:503
lldb_private::Debugger::GetBroadcaster
Broadcaster & GetBroadcaster()
Get the public broadcaster for this debugger.
Definition: Debugger.h:84
lldb_private::Debugger::CheckTopIOHandlerTypes
bool CheckTopIOHandlerTypes(IOHandler::Type top_type, IOHandler::Type second_top_type)
Definition: Debugger.cpp:934
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::Debugger::GetIOHandlerCommandPrefix
const char * GetIOHandlerCommandPrefix()
Definition: Debugger.cpp:949
lldb_private::Debugger::RunIOHandlerSync
void RunIOHandlerSync(const lldb::IOHandlerSP &reader_sp)
Run the given IO handler and block until it's complete.
Definition: Debugger.cpp:896
lldb-private-types.h
llvm
Definition: Debugger.h:49
lldb_private::Debugger::SetCloseInputOnEOF
void SetCloseInputOnEOF(bool b)
Definition: Debugger.cpp:799
lldb::ScriptLanguage
ScriptLanguage
Script interpreter types.
Definition: lldb-enumerations.h:216
lldb_private::Debugger::GetDisassemblyLineCount
uint32_t GetDisassemblyLineCount() const
Definition: Debugger.cpp:422
lldb_private::Debugger::GetErrorFile
File & GetErrorFile()
Definition: Debugger.h:171
lldb_private::REPL
Definition: REPL.h:21
lldb_private::Debugger::ProgressEventData::m_message
std::string m_message
Definition: Debugger.h:111
lldb_private::Debugger::m_output_stream_sp
lldb::StreamFileSP m_output_stream_sp
Definition: Debugger.h:470
lldb_private::Debugger::GetSelectedExecutionContext
ExecutionContext GetSelectedExecutionContext()
Definition: Debugger.cpp:840
lldb_private::Debugger::AdoptTopIOHandlerFilesIfInvalid
void AdoptTopIOHandlerFilesIfInvalid(lldb::FileSP &in, lldb::StreamFileSP &out, lldb::StreamFileSP &err)
Definition: Debugger.cpp:966
lldb_private::Debugger::SetPropertyValue
Status SetPropertyValue(const ExecutionContext *exe_ctx, VarSetOperationType op, llvm::StringRef property_path, llvm::StringRef value) override
Definition: Debugger.cpp:177
lldb_private::Debugger::GetHighlightSource
bool GetHighlightSource() const
Definition: Debugger.cpp:376
lldb_private::Event
Definition: Event.h:180
IOHandler.h
lldb_private::Debugger::GetAutoConfirm
bool GetAutoConfirm() const
Definition: Debugger.cpp:241
lldb_private::Debugger::ProgressEventData::ProgressEventData
ProgressEventData(uint64_t progress_id, const std::string &message, uint64_t completed, uint64_t total, bool debugger_specific)
Definition: Debugger.h:90
lldb_private::HostThread
Definition: HostThread.h:29
lldb_private::Debugger::DispatchInputEndOfFile
void DispatchInputEndOfFile()
Definition: Debugger.cpp:853
lldb_private::Debugger::operator=
const Debugger & operator=(const Debugger &)=delete
lldb_private::Debugger::GetCommandInterpreter
CommandInterpreter & GetCommandInterpreter()
Definition: Debugger.h:193
lldb_private::Debugger::HandleThreadEvent
void HandleThreadEvent(const lldb::EventSP &event_sp)
Definition: Debugger.cpp:1449
lldb_private::Debugger::RunREPL
Status RunREPL(lldb::LanguageType language, const char *repl_options)
Definition: Debugger.cpp:1664
lldb_private::Debugger::GetDebuggerAtIndex
static lldb::DebuggerSP GetDebuggerAtIndex(size_t index)
Definition: Debugger.cpp:1077
lldb::LogOutputCallback
void(* LogOutputCallback)(const char *, void *baton)
Definition: lldb-types.h:70
lldb_private::Debugger::m_clear_once
llvm::once_flag m_clear_once
Definition: Debugger.h:516
lldb_private::Debugger::SetPrompt
void SetPrompt(llvm::StringRef p)
Definition: Debugger.cpp:280
lldb_private::SourceManager::SourceFileCache
Definition: SourceManager.h:96
lldb_private::Debugger::ProgressEventData::operator=
const ProgressEventData & operator=(const ProgressEventData &)=delete
lldb-defines.h
lldb_private::Debugger::GetDummyTarget
Target & GetDummyTarget()
Definition: Debugger.h:384
lldb_private::Debugger::Debugger
Debugger(lldb::LogOutputCallback m_log_callback, void *baton)
Definition: Debugger.cpp:681
lldb_private::UserID
Definition: UserID.h:31
lldb_private::Debugger::SetOutputFile
void SetOutputFile(lldb::FileSP file)
Definition: Debugger.cpp:822
lldb_private::Debugger::g_load_plugin_callback
static LoadPluginCallbackType g_load_plugin_callback
Definition: Debugger.h:508
lldb_private::Debugger::GetStopShowColumnAnsiSuffix
llvm::StringRef GetStopShowColumnAnsiSuffix() const
Definition: Debugger.cpp:393
lldb_private::Debugger::GetUseSourceCache
bool GetUseSourceCache() const
Definition: Debugger.cpp:362
lldb_private::Process
Definition: Process.h:342
lldb_private::EventData
Definition: Event.h:36
lldb_private::Debugger::GetPrintDecls
bool GetPrintDecls() const
Definition: Debugger.cpp:448
lldb_private::Debugger::RunIOHandlerAsync
void RunIOHandlerAsync(const lldb::IOHandlerSP &reader_sp, bool cancel_top_handler=true)
Run the given IO handler and return immediately.
Definition: Debugger.cpp:961
lldb_private::Debugger::StopEventHandlerThread
void StopEventHandlerThread()
Definition: Debugger.cpp:1608
lldb_private::Debugger::StartEventHandlerThread
bool StartEventHandlerThread()
Definition: Debugger.cpp:1568
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb_private::Debugger::RunIOHandlers
void RunIOHandlers()
Definition: Debugger.cpp:871
lldb_private::TargetList
Definition: TargetList.h:21
lldb_private::Debugger::GetOutputStream
StreamFile & GetOutputStream()
Definition: Debugger.h:173
lldb_private::Debugger::StartIOHandlerThread
bool StartIOHandlerThread()
Definition: Debugger.cpp:1625
SourceManager.h
lldb_private::Debugger::ProgressEventData::m_id
const uint64_t m_id
Definition: Debugger.h:112
lldb_private::Debugger::CreateInstance
static lldb::DebuggerSP CreateInstance(lldb::LogOutputCallback log_callback=nullptr, void *baton=nullptr)
Definition: Debugger.cpp:593
lldb_private::repro::DataRecorder
Recorder that records its data as text to a file.
Definition: ReproducerProvider.h:55
lldb_private::Debugger::SetAutoIndent
bool SetAutoIndent(bool b)
Definition: Debugger.cpp:443
lldb_private::Debugger::GetOutputStreamSP
lldb::StreamFileSP GetOutputStreamSP()
Definition: Debugger.h:163
lldb_private::Debugger::GetTopIOHandlerControlSequence
ConstString GetTopIOHandlerControlSequence(char ch)
Definition: Debugger.cpp:945
lldb_private::Stream
Definition: Stream.h:28
lldb_private::Debugger::ProgressEventData::GetCompleted
uint64_t GetCompleted() const
Definition: Debugger.h:105
lldb_private::Debugger::IsForwardingEvents
bool IsForwardingEvents()
Definition: Debugger.cpp:1465
lldb_private::Debugger::ProgressEventData::GetFlavor
ConstString GetFlavor() const override
Definition: Debugger.cpp:1161
lldb_private::Debugger::GetScriptLanguage
lldb::ScriptLanguage GetScriptLanguage() const
Definition: Debugger.cpp:306
lldb_private::Debugger::eStopDisassemblyTypeNever
@ eStopDisassemblyTypeNever
Definition: Debugger.h:275
lldb_private::Debugger::m_input_recorder
repro::DataRecorder * m_input_recorder
Used for shadowing the input file when capturing a reproducer.
Definition: Debugger.h:474
lldb_private::Debugger::GetUseExternalEditor
bool GetUseExternalEditor() const
Definition: Debugger.cpp:332
lldb-private-enumerations.h
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::Target
Definition: Target.h:454
lldb_private::Debugger::GetScriptInterpreter
ScriptInterpreter * GetScriptInterpreter(bool can_create=true, llvm::Optional< lldb::ScriptLanguage > language={})
Definition: Debugger.cpp:1275
lldb_private::Debugger::GetListener
lldb::ListenerSP GetListener()
Definition: Debugger.h:202
lldb_private::Debugger::m_io_handler_thread
HostThread m_io_handler_thread
Definition: Debugger.h:512
lldb_private::Debugger::GetStopDisassemblyMaxSize
uint32_t GetStopDisassemblyMaxSize() const
Definition: Debugger.cpp:262
lldb_private::Debugger::DefaultEventHandler
void DefaultEventHandler()
Definition: Debugger.cpp:1475
lldb_private::Debugger::m_log_streams
llvm::StringMap< std::weak_ptr< llvm::raw_ostream > > m_log_streams
Definition: Debugger.h:505
lldb_private::Debugger::GetUseAutosuggestion
bool GetUseAutosuggestion() const
Definition: Debugger.cpp:356
lldb_private::Debugger::m_loaded_plugins
LoadedPluginsList m_loaded_plugins
Definition: Debugger.h:510
lldb_private::Debugger::SetErrorFile
void SetErrorFile(lldb::FileSP file)
Definition: Debugger.cpp:827
lldb_private::Debugger::ClearIOHandlers
void ClearIOHandlers()
Definition: Debugger.cpp:860
Broadcaster.h
lldb_private::Debugger::GetStopShowColumn
lldb::StopShowColumn GetStopShowColumn() const
Definition: Debugger.cpp:382
lldb_private::Debugger::SaveInputTerminalState
void SaveInputTerminalState()
Definition: Debugger.cpp:832
lldb_private::Debugger::RemoveIOHandler
bool RemoveIOHandler(const lldb::IOHandlerSP &reader_sp)
Remove the given IO handler if it's currently active.
Definition: Debugger.cpp:957
lldb_private::Properties
Definition: UserSettingsController.h:33
lldb_private::Debugger::GetInputFile
File & GetInputFile()
Definition: Debugger.h:167
lldb_private::Debugger::m_io_handler_synchronous_mutex
std::recursive_mutex m_io_handler_synchronous_mutex
Definition: Debugger.h:503
lldb_private::Debugger::m_listener_sp
lldb::ListenerSP m_listener_sp
Definition: Debugger.h:486
lldb_private::Debugger::eStopDisassemblyTypeAlways
@ eStopDisassemblyTypeAlways
Definition: Debugger.h:278
lldb_private::Debugger::m_broadcaster
Broadcaster m_broadcaster
Public Debugger event broadcaster.
Definition: Debugger.h:514
Platform.h
lldb_private::FileSpec
Definition: FileSpec.h:56
lldb_private::Debugger::GetDisassemblyFormat
const FormatEntity::Entry * GetDisassemblyFormat() const
Definition: Debugger.cpp:247
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::VarSetOperationType
VarSetOperationType
Settable state variable types.
Definition: lldb-private-enumerations.h:83
lldb_private::Debugger::SetUseSourceCache
bool SetUseSourceCache(bool use_source_cache)
Definition: Debugger.cpp:368
lldb_private::Debugger::SetLoggingCallback
void SetLoggingCallback(lldb::LogOutputCallback log_callback, void *baton)
Definition: Debugger.cpp:1147
lldb_private::Debugger::IsHandlingEvents
bool IsHandlingEvents() const
Definition: Debugger.h:376
lldb_private::Debugger::GetStaticBroadcasterClass
static ConstString GetStaticBroadcasterClass()
Definition: Debugger.cpp:676
TargetList.h
lldb_private::Debugger::m_script_interpreter_mutex
std::recursive_mutex m_script_interpreter_mutex
Definition: Debugger.h:498
lldb_private::Debugger::ProgressEventData::Dump
void Dump(Stream *s) const override
Definition: Debugger.cpp:1165
HostThread.h
lldb_private::Debugger::m_source_manager_up
std::unique_ptr< SourceManager > m_source_manager_up
Definition: Debugger.h:487
lldb_private::Debugger::GetAutoIndent
bool GetAutoIndent() const
Definition: Debugger.cpp:438
lldb_private::Debugger::DispatchInputInterrupt
void DispatchInputInterrupt()
Definition: Debugger.cpp:846
lldb_private::Debugger::GetOutputFile
File & GetOutputFile()
Definition: Debugger.h:169
lldb_private::Debugger::SettingsInitialize
static void SettingsInitialize()
Definition: Debugger.cpp:501
lldb_private::Debugger::GetStopShowColumnAnsiPrefix
llvm::StringRef GetStopShowColumnAnsiPrefix() const
Definition: Debugger.cpp:388
lldb_private::Debugger::GetThreadFormat
const FormatEntity::Entry * GetThreadFormat() const
Definition: Debugger.cpp:296
lldb_private::Debugger::m_instance_name
ConstString m_instance_name
Definition: Debugger.h:507
lldb_private::Debugger::GetAsyncOutputStream
lldb::StreamSP GetAsyncOutputStream()
Definition: Debugger.cpp:1061
lldb_private::Debugger::GetEscapeNonPrintables
bool GetEscapeNonPrintables() const
Definition: Debugger.cpp:433
lldb_private::Debugger::eStopDisassemblyTypeNoDebugInfo
@ eStopDisassemblyTypeNoDebugInfo
Definition: Debugger.h:276
lldb_private::Debugger::GetAsyncErrorStream
lldb::StreamSP GetAsyncErrorStream()
Definition: Debugger.cpp:1065
lldb_private::Debugger::GetTerminalWidth
uint32_t GetTerminalWidth() const
Definition: Debugger.cpp:318
lldb_private::Debugger::EnableLog
bool EnableLog(llvm::StringRef channel, llvm::ArrayRef< const char * > categories, llvm::StringRef log_file, uint32_t log_options, llvm::raw_ostream &error_stream)
Definition: Debugger.cpp:1224
lldb_private::Debugger::Initialize
static void Initialize(LoadPluginCallbackType load_plugin_callback)
Definition: Debugger.cpp:478
lldb_private::ConstString
Definition: ConstString.h:40
lldb-enumerations.h
lldb_private::Debugger::GetAutoOneLineSummaries
bool GetAutoOneLineSummaries() const
Definition: Debugger.cpp:428
lldb_private::Progress
A Progress indicator helper class.
Definition: Progress.h:55
lldb_private::Debugger::GetSourceManager
SourceManager & GetSourceManager()
Definition: Debugger.cpp:1291
lldb_private::Debugger::HandleProcessEvent
void HandleProcessEvent(const lldb::EventSP &event_sp)
Definition: Debugger.cpp:1365
lldb_private::Debugger::GetInputFileSP
lldb::FileSP GetInputFileSP()
Definition: Debugger.h:161
lldb_private::Debugger::ProgressEventData
Definition: Debugger.h:87
lldb_private::CommandInterpreter
Definition: CommandInterpreter.h:214
lldb_private::Debugger::m_error_stream_sp
lldb::StreamFileSP m_error_stream_sp
Definition: Debugger.h:471
lldb_private::File
Definition: File.h:34
lldb_private::Debugger::eBroadcastBitProgress
@ eBroadcastBitProgress
Definition: Debugger.h:78
lldb_private::Debugger
Definition: Debugger.h:70
lldb_private::Debugger::EnableForwardEvents
void EnableForwardEvents(const lldb::ListenerSP &listener_sp)
Definition: Debugger.cpp:1467
lldb_private::Debugger::PopIOHandler
bool PopIOHandler(const lldb::IOHandlerSP &reader_sp)
Definition: Debugger.cpp:1034
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:39
lldb::thread_arg_t
void * thread_arg_t
Definition: lldb-types.h:61
lldb_private::PlatformList
Definition: Platform.h:953
lldb::StopShowColumn
StopShowColumn
Definition: lldb-enumerations.h:500
lldb_private::Debugger::ProgressEventData::GetTotal
uint64_t GetTotal() const
Definition: Debugger.h:106
lldb_private::Debugger::m_source_file_cache
SourceManager::SourceFileCache m_source_file_cache
Definition: Debugger.h:491
lldb_private::Debugger::SetScriptLanguage
bool SetScriptLanguage(lldb::ScriptLanguage script_lang)
Definition: Debugger.cpp:312
lldb_private::Debugger::FlushProcessOutput
void FlushProcessOutput(Process &process, bool flush_stdout, bool flush_stderr)
Definition: Debugger.cpp:1345
lldb_private::Debugger::StopDisassemblyType
StopDisassemblyType
Definition: Debugger.h:274
lldb_private::Debugger::m_io_handler_stack
IOHandlerStack m_io_handler_stack
Definition: Debugger.h:502
lldb_private::Debugger::GetInputRecorder
repro::DataRecorder * GetInputRecorder()
Definition: Debugger.cpp:811
UserID.h
lldb_private::Debugger::JoinIOHandlerThread
void JoinIOHandlerThread()
Definition: Debugger.cpp:1648
lldb_private::Debugger::GetTargetList
TargetList & GetTargetList()
Get accessor for the target list.
Definition: Debugger.h:223
lldb_private::Debugger::m_broadcaster_manager_sp
lldb::BroadcasterManagerSP m_broadcaster_manager_sp
Definition: Debugger.h:476
lldb-types.h
lldb_private::Debugger::m_terminal_state
TerminalState m_terminal_state
Definition: Debugger.h:482
lldb_private::Debugger::ProgressEventData::GetID
uint64_t GetID() const
Definition: Debugger.h:104
lldb_private::Debugger::GetIOHandlerHelpPrologue
const char * GetIOHandlerHelpPrologue()
Definition: Debugger.cpp:953
StreamFile.h
lldb_private::Debugger::eStopDisassemblyTypeNoSource
@ eStopDisassemblyTypeNoSource
Definition: Debugger.h:277
lldb_private::Debugger::ProgressEventData::GetFlavorString
static ConstString GetFlavorString()
Definition: Debugger.cpp:1156
lldb_private::Debugger::ProgressEventData::GetEventDataFromEvent
static const ProgressEventData * GetEventDataFromEvent(const Event *event_ptr)
Definition: Debugger.cpp:1178
lldb_private::Debugger::GetStopDisassemblyDisplay
StopDisassemblyType GetStopDisassemblyDisplay() const
Definition: Debugger.cpp:415
lldb_private::Debugger::PrintAsync
void PrintAsync(const char *s, size_t len, bool is_stdout)
Definition: Debugger.cpp:939
lldb_private::Debugger::Clear
void Clear()
Definition: Debugger.cpp:762
lldb_private::Debugger::GetNumDebuggers
static size_t GetNumDebuggers()
Definition: Debugger.cpp:1069
lldb_private::Debugger::IsTopIOHandler
bool IsTopIOHandler(const lldb::IOHandlerSP &reader_sp)
Definition: Debugger.cpp:930
lldb_private::Debugger::FindDebuggerWithInstanceName
static lldb::DebuggerSP FindDebuggerWithInstanceName(ConstString instance_name)
Definition: Debugger.cpp:633
lldb_private::IOHandlerStack
Definition: IOHandler.h:470
lldb_private::Status
Definition: Status.h:44
lldb_private::Debugger::InstanceInitialize
void InstanceInitialize()
Definition: Debugger.cpp:567
lldb_private::Debugger::m_event_handler_thread
HostThread m_event_handler_thread
Definition: Debugger.h:511
lldb_private::Debugger::SetTerminalWidth
bool SetTerminalWidth(uint32_t term_width)
Definition: Debugger.cpp:324
lldb_private::Debugger::m_sync_broadcaster
Broadcaster m_sync_broadcaster
Private debugger synchronization.
Definition: Debugger.h:513
lldb_private::Debugger::GetNotifyVoid
bool GetNotifyVoid() const
Definition: Debugger.cpp:268
lldb_private::Debugger::PushIOHandler
void PushIOHandler(const lldb::IOHandlerSP &reader_sp, bool cancel_top_handler=true)
Definition: Debugger.cpp:1007
uint32_t
message
message(FATAL_ERROR "invalid libipt include path provided") endif() include_directories($
Definition: Plugins/Trace/intel-pt/CMakeLists.txt:6
lldb_private::Debugger::GetTabSize
uint32_t GetTabSize() const
Definition: Debugger.cpp:458
UserSettingsController.h
lldb::thread_result_t
void * thread_result_t
Definition: lldb-types.h:62
lldb_private::Debugger::GetStopShowLineMarkerAnsiSuffix
llvm::StringRef GetStopShowLineMarkerAnsiSuffix() const
Definition: Debugger.cpp:403
lldb_private::Debugger::GetErrorStreamSP
lldb::StreamFileSP GetErrorStreamSP()
Definition: Debugger.h:165
lldb_private::Address
Definition: Address.h:59
lldb_private::Debugger::FindTargetWithProcessID
static lldb::TargetSP FindTargetWithProcessID(lldb::pid_t pid)
Definition: Debugger.cpp:648
lldb_private::Debugger::GetPlatformList
PlatformList & GetPlatformList()
Definition: Debugger.h:225
lldb_private::Debugger::GetCloseInputOnEOF
bool GetCloseInputOnEOF() const
Definition: Debugger.cpp:794
lldb::pid_t
uint64_t pid_t
Definition: lldb-types.h:85
lldb_private::Debugger::LoadPlugin
bool LoadPlugin(const FileSpec &spec, Status &error)
Definition: Debugger.cpp:505
lldb_private::Debugger::GetBroadcaster
const Broadcaster & GetBroadcaster() const
Definition: Debugger.h:85
lldb_private::Debugger::FindDebuggerWithID
static lldb::DebuggerSP FindDebuggerWithID(lldb::user_id_t id)
Definition: Debugger.cpp:1089
lldb_private::FormatEntity::Entry
Definition: FormatEntity.h:40
lldb_private::Debugger::FindTargetWithProcess
static lldb::TargetSP FindTargetWithProcess(Process *process)
Definition: Debugger.cpp:662
lldb_private::Debugger::GetInstanceName
ConstString GetInstanceName()
Definition: Debugger.h:364
lldb_private::Debugger::m_log_callback_stream_sp
std::shared_ptr< llvm::raw_ostream > m_log_callback_stream_sp
Definition: Debugger.h:506
FormatEntity.h
lldb_private::Debugger::SetTabSize
bool SetTabSize(uint32_t tab_size)
Definition: Debugger.cpp:464
lldb_private::Debugger::ProgressEventData::IsDebuggerSpecific
bool IsDebuggerSpecific() const
Definition: Debugger.h:108
lldb_private::Debugger::EventHandlerThread
static lldb::thread_result_t EventHandlerThread(lldb::thread_arg_t arg)
Definition: Debugger.cpp:1563
lldb_private::IOHandler::Type
Type
Definition: IOHandler.h:48
lldb_private::Debugger::~Debugger
~Debugger() override
Definition: Debugger.cpp:760
lldb_private::Debugger::SetInputFile
void SetInputFile(lldb::FileSP file, repro::DataRecorder *recorder=nullptr)
Definition: Debugger.cpp:813
lldb_private::ScriptInterpreter
Definition: ScriptInterpreter.h:125
lldb_private::Debugger::m_output_flush_mutex
std::mutex m_output_flush_mutex
Definition: Debugger.h:458
lldb_private::Debugger::ReportProgress
static void ReportProgress(uint64_t progress_id, const std::string &message, uint64_t completed, uint64_t total, llvm::Optional< lldb::user_id_t > debugger_id)
Report progress events.
Definition: Debugger.cpp:1200
lldb_private::Debugger::HandleBreakpointEvent
void HandleBreakpointEvent(const lldb::EventSP &event_sp)
Definition: Debugger.cpp:1298
lldb-forward.h
lldb_private::Debugger::ProgressEventData::m_completed
uint64_t m_completed
Definition: Debugger.h:113
lldb_private::Debugger::GetUseColor
bool GetUseColor() const
Definition: Debugger.cpp:343
Terminal.h
lldb_private::Debugger::LoadedPluginsList
std::vector< llvm::sys::DynamicLibrary > LoadedPluginsList
Definition: Debugger.h:509
Status.h
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
lldb_private::Debugger::SetUseExternalEditor
bool SetUseExternalEditor(bool use_external_editor_p)
Definition: Debugger.cpp:338
lldb_private::Debugger::GetStopShowLineMarkerAnsiPrefix
llvm::StringRef GetStopShowLineMarkerAnsiPrefix() const
Definition: Debugger.cpp:398
lldb_private::HostThread::IsJoinable
bool IsJoinable() const
Definition: HostThread.cpp:30
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::Debugger::GetSelectedTarget
lldb::TargetSP GetSelectedTarget()
Definition: Debugger.h:210
lldb_private::Debugger::GetFrameFormatUnique
const FormatEntity::Entry * GetFrameFormatUnique() const
Definition: Debugger.cpp:257
lldb_private::Debugger::RestoreInputTerminalState
void RestoreInputTerminalState()
Definition: Debugger.cpp:838
lldb_private::Debugger::GetAsyncExecution
bool GetAsyncExecution()
Definition: Debugger.cpp:803
lldb_private::Debugger::GetThreadStopFormat
const FormatEntity::Entry * GetThreadStopFormat() const
Definition: Debugger.cpp:301
lldb_private::Debugger::m_target_list
TargetList m_target_list
Definition: Debugger.h:483
lldb_private::Debugger::Terminate
static void Terminate()
Definition: Debugger.cpp:486
FileSpec.h
lldb_private::Debugger::m_platform_list
PlatformList m_platform_list
Definition: Debugger.h:485
lldb_private::Debugger::m_input_file_sp
lldb::FileSP m_input_file_sp
Definition: Debugger.h:469
lldb_private::Debugger::StopIOHandlerThread
void StopIOHandlerThread()
Definition: Debugger.cpp:1641
lldb_private::Debugger::SetAsyncExecution
void SetAsyncExecution(bool async)
Definition: Debugger.cpp:807
ConstString.h
lldb_private::Debugger::GetReproducerPath
llvm::StringRef GetReproducerPath() const
Definition: Debugger.cpp:291
lldb_private::StreamFile
Definition: StreamFile.h:22
lldb_private::Debugger::ProgressEventData::GetMessage
const std::string & GetMessage() const
Definition: Debugger.h:107
lldb_private::Debugger::FormatDisassemblerAddress
static bool FormatDisassemblerAddress(const FormatEntity::Entry *format, const SymbolContext *sc, const SymbolContext *prev_sc, const ExecutionContext *exe_ctx, const Address *addr, Stream &s)
Definition: Debugger.cpp:1105
lldb_private::Debugger::eBroadcastBitEventThreadIsListening
@ eBroadcastBitEventThreadIsListening
Definition: Debugger.h:521
lldb_private::Debugger::GetStopSourceLineCount
uint32_t GetStopSourceLineCount(bool before) const
Definition: Debugger.cpp:408
lldb_private::TargetList::GetSelectedTarget
lldb::TargetSP GetSelectedTarget()
Definition: TargetList.cpp:576
lldb_private::Debugger::GetBroadcasterManager
lldb::BroadcasterManagerSP GetBroadcasterManager()
Definition: Debugger.h:386
lldb_private::Debugger::SetUseColor
bool SetUseColor(bool use_color)
Definition: Debugger.cpp:349
lldb_private::Debugger::GetSourceFileCache
SourceManager::SourceFileCache & GetSourceFileCache()
Definition: Debugger.h:462
lldb_private::Debugger::ProgressEventData::m_total
const uint64_t m_total
Definition: Debugger.h:114
lldb_private::Debugger::SetPrintDecls
bool SetPrintDecls(bool b)
Definition: Debugger.cpp:453
lldb_private::Debugger::m_command_interpreter_up
std::unique_ptr< CommandInterpreter > m_command_interpreter_up
Definition: Debugger.h:496
lldb_private::Debugger::m_dummy_target_sp
lldb::TargetSP m_dummy_target_sp
Definition: Debugger.h:517
lldb_private::Broadcaster
Definition: Broadcaster.h:242
lldb_private::Debugger::m_forward_listener_sp
lldb::ListenerSP m_forward_listener_sp
Definition: Debugger.h:515
lldb_private::Debugger::GetPrompt
llvm::StringRef GetPrompt() const
Definition: Debugger.cpp:274
lldb_private::Debugger::CancelForwardEvents
void CancelForwardEvents(const lldb::ListenerSP &listener_sp)
Definition: Debugger.cpp:1471
lldb_private::Debugger::GetErrorStream
StreamFile & GetErrorStream()
Definition: Debugger.h:175
lldb_private::Debugger::Destroy
static void Destroy(lldb::DebuggerSP &debugger_sp)
Definition: Debugger.cpp:604
lldb_private::Debugger::HasIOHandlerThread
bool HasIOHandlerThread()
Definition: Debugger.cpp:1623
lldb_private::Debugger::IOHandlerThread
static lldb::thread_result_t IOHandlerThread(lldb::thread_arg_t arg)
Definition: Debugger.cpp:1616
ExecutionContext.h
lldb_private::Debugger::GetSelectedOrDummyTarget
Target & GetSelectedOrDummyTarget(bool prefer_dummy=false)
Definition: Debugger.cpp:1656
lldb_private::SourceManager
Definition: SourceManager.h:31
lldb_private::Debugger::ProgressEventData::m_debugger_specific
const bool m_debugger_specific
Definition: Debugger.h:115
lldb_private::Debugger::m_script_interpreters
std::array< lldb::ScriptInterpreterSP, lldb::eScriptLanguageUnknown > m_script_interpreters
Definition: Debugger.h:500
lldb_private::Debugger::GetFrameFormat
const FormatEntity::Entry * GetFrameFormat() const
Definition: Debugger.cpp:252