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 
18 #include "lldb/Core/FormatEntity.h"
19 #include "lldb/Core/IOHandler.h"
21 #include "lldb/Core/StreamFile.h"
23 #include "lldb/Host/HostThread.h"
24 #include "lldb/Host/Terminal.h"
26 #include "lldb/Target/Platform.h"
27 #include "lldb/Target/TargetList.h"
30 #include "lldb/Utility/FileSpec.h"
31 #include "lldb/Utility/Status.h"
32 #include "lldb/Utility/UserID.h"
33 #include "lldb/lldb-defines.h"
34 #include "lldb/lldb-enumerations.h"
35 #include "lldb/lldb-forward.h"
38 #include "lldb/lldb-types.h"
39 
40 #include "llvm/ADT/ArrayRef.h"
41 #include "llvm/ADT/StringMap.h"
42 #include "llvm/ADT/StringRef.h"
43 #include "llvm/Support/DynamicLibrary.h"
44 #include "llvm/Support/Threading.h"
45 
46 #include <cassert>
47 #include <cstddef>
48 #include <cstdio>
49 
50 namespace llvm {
51 class raw_ostream;
52 class ThreadPool;
53 }
54 
55 namespace lldb_private {
56 class Address;
57 class CommandInterpreter;
58 class Process;
59 class Stream;
60 class SymbolContext;
61 class Target;
62 
63 namespace repro {
64 class DataRecorder;
65 }
66 
67 /// \class Debugger Debugger.h "lldb/Core/Debugger.h"
68 /// A class to manage flag bits.
69 ///
70 /// Provides a global root objects for the debugger core.
71 
72 class Debugger : public std::enable_shared_from_this<Debugger>,
73  public UserID,
74  public Properties {
75  friend class SourceManager; // For GetSourceFileCache.
76 
77 public:
78  /// Broadcaster event bits definitions.
79  enum {
82  eBroadcastBitError = (1 << 2),
83  };
84 
86 
87  /// Get the public broadcaster for this debugger.
89  const Broadcaster &GetBroadcaster() const { return m_broadcaster; }
90 
91  ~Debugger() override;
92 
93  static lldb::DebuggerSP
94  CreateInstance(lldb::LogOutputCallback log_callback = nullptr,
95  void *baton = nullptr);
96 
97  static lldb::TargetSP FindTargetWithProcessID(lldb::pid_t pid);
98 
99  static lldb::TargetSP FindTargetWithProcess(Process *process);
100 
101  static void Initialize(LoadPluginCallbackType load_plugin_callback);
102 
103  static void Terminate();
104 
105  static void SettingsInitialize();
106 
107  static void SettingsTerminate();
108 
109  static void Destroy(lldb::DebuggerSP &debugger_sp);
110 
111  static lldb::DebuggerSP FindDebuggerWithID(lldb::user_id_t id);
112 
113  static lldb::DebuggerSP
115 
116  static size_t GetNumDebuggers();
117 
118  static lldb::DebuggerSP GetDebuggerAtIndex(size_t index);
119 
120  static bool FormatDisassemblerAddress(const FormatEntity::Entry *format,
121  const SymbolContext *sc,
122  const SymbolContext *prev_sc,
123  const ExecutionContext *exe_ctx,
124  const Address *addr, Stream &s);
125 
126  void Clear();
127 
128  bool GetAsyncExecution();
129 
130  void SetAsyncExecution(bool async);
131 
132  lldb::FileSP GetInputFileSP() { return m_input_file_sp; }
133 
134  lldb::StreamFileSP GetOutputStreamSP() { return m_output_stream_sp; }
135 
136  lldb::StreamFileSP GetErrorStreamSP() { return m_error_stream_sp; }
137 
139 
140  File &GetOutputFile() { return m_output_stream_sp->GetFile(); }
141 
142  File &GetErrorFile() { return m_error_stream_sp->GetFile(); }
143 
145 
147 
149 
150  Status SetInputString(const char *data);
151 
152  // This method will setup data recorder if reproducer enabled.
153  // On reply mode this method should take instructions from reproducer file.
154  Status SetInputFile(lldb::FileSP file);
155 
156  void SetInputFile(lldb::FileSP file, repro::DataRecorder *recorder);
157 
158  void SetOutputFile(lldb::FileSP file);
159 
160  void SetErrorFile(lldb::FileSP file);
161 
162  void SaveInputTerminalState();
163 
165 
166  lldb::StreamSP GetAsyncOutputStream();
167 
168  lldb::StreamSP GetAsyncErrorStream();
169 
171  assert(m_command_interpreter_up.get());
172  return *m_command_interpreter_up;
173  }
174 
176  GetScriptInterpreter(bool can_create = true,
177  llvm::Optional<lldb::ScriptLanguage> language = {});
178 
179  lldb::ListenerSP GetListener() { return m_listener_sp; }
180 
181  // This returns the Debugger's scratch source manager. It won't be able to
182  // look up files in debug information, but it can look up files by absolute
183  // path and display them to you. To get the target's source manager, call
184  // GetSourceManager on the target instead.
186 
187  lldb::TargetSP GetSelectedTarget() {
189  }
190 
192  /// Get accessor for the target list.
193  ///
194  /// The target list is part of the global debugger object. This the single
195  /// debugger shared instance to control where targets get created and to
196  /// allow for tracking and searching for targets based on certain criteria.
197  ///
198  /// \return
199  /// A global shared target list.
201 
203 
204  void DispatchInputInterrupt();
205 
206  void DispatchInputEndOfFile();
207 
208  // If any of the streams are not set, set them to the in/out/err stream of
209  // the top most input reader to ensure they at least have something
210  void AdoptTopIOHandlerFilesIfInvalid(lldb::FileSP &in,
211  lldb::StreamFileSP &out,
212  lldb::StreamFileSP &err);
213 
214  /// Run the given IO handler and return immediately.
215  void RunIOHandlerAsync(const lldb::IOHandlerSP &reader_sp,
216  bool cancel_top_handler = true);
217 
218  /// Run the given IO handler and block until it's complete.
219  void RunIOHandlerSync(const lldb::IOHandlerSP &reader_sp);
220 
221  /// Remove the given IO handler if it's currently active.
222  bool RemoveIOHandler(const lldb::IOHandlerSP &reader_sp);
223 
224  bool IsTopIOHandler(const lldb::IOHandlerSP &reader_sp);
225 
227  IOHandler::Type second_top_type);
228 
229  void PrintAsync(const char *s, size_t len, bool is_stdout);
230 
232 
233  const char *GetIOHandlerCommandPrefix();
234 
235  const char *GetIOHandlerHelpPrologue();
236 
237  void ClearIOHandlers();
238 
239  bool GetCloseInputOnEOF() const;
240 
241  void SetCloseInputOnEOF(bool b);
242 
243  bool EnableLog(llvm::StringRef channel,
244  llvm::ArrayRef<const char *> categories,
245  llvm::StringRef log_file, uint32_t log_options,
246  llvm::raw_ostream &error_stream);
247 
248  void SetLoggingCallback(lldb::LogOutputCallback log_callback, void *baton);
249 
250  // Properties Functions
256  };
257 
259  VarSetOperationType op, llvm::StringRef property_path,
260  llvm::StringRef value) override;
261 
262  bool GetAutoConfirm() const;
263 
265 
266  const FormatEntity::Entry *GetFrameFormat() const;
267 
269 
271 
272  const FormatEntity::Entry *GetThreadFormat() const;
273 
275 
277 
278  bool SetScriptLanguage(lldb::ScriptLanguage script_lang);
279 
281 
282  bool SetREPLLanguage(lldb::LanguageType repl_lang);
283 
284  uint32_t GetTerminalWidth() const;
285 
286  bool SetTerminalWidth(uint32_t term_width);
287 
288  llvm::StringRef GetPrompt() const;
289 
290  void SetPrompt(llvm::StringRef p);
291  void SetPrompt(const char *) = delete;
292 
293  llvm::StringRef GetReproducerPath() const;
294 
295  bool GetUseExternalEditor() const;
296 
297  bool SetUseExternalEditor(bool use_external_editor_p);
298 
299  bool GetUseColor() const;
300 
301  bool SetUseColor(bool use_color);
302 
303  bool GetShowProgress() const;
304 
305  bool SetShowProgress(bool show_progress);
306 
307  llvm::StringRef GetShowProgressAnsiPrefix() const;
308 
309  llvm::StringRef GetShowProgressAnsiSuffix() const;
310 
311  bool GetUseAutosuggestion() const;
312 
313  llvm::StringRef GetAutosuggestionAnsiPrefix() const;
314 
315  llvm::StringRef GetAutosuggestionAnsiSuffix() const;
316 
317  bool GetUseSourceCache() const;
318 
319  bool SetUseSourceCache(bool use_source_cache);
320 
321  bool GetHighlightSource() const;
322 
324 
325  llvm::StringRef GetStopShowColumnAnsiPrefix() const;
326 
327  llvm::StringRef GetStopShowColumnAnsiSuffix() const;
328 
329  uint32_t GetStopSourceLineCount(bool before) const;
330 
332 
334 
335  llvm::StringRef GetStopShowLineMarkerAnsiPrefix() const;
336 
337  llvm::StringRef GetStopShowLineMarkerAnsiSuffix() const;
338 
339  bool GetAutoOneLineSummaries() const;
340 
341  bool GetAutoIndent() const;
342 
343  bool SetAutoIndent(bool b);
344 
345  bool GetPrintDecls() const;
346 
347  bool SetPrintDecls(bool b);
348 
349  uint32_t GetTabSize() const;
350 
351  bool SetTabSize(uint32_t tab_size);
352 
353  bool GetEscapeNonPrintables() const;
354 
355  bool GetNotifyVoid() const;
356 
358 
359  bool LoadPlugin(const FileSpec &spec, Status &error);
360 
361  void RunIOHandlers();
362 
363  bool IsForwardingEvents();
364 
365  void EnableForwardEvents(const lldb::ListenerSP &listener_sp);
366 
367  void CancelForwardEvents(const lldb::ListenerSP &listener_sp);
368 
370 
371  Status RunREPL(lldb::LanguageType language, const char *repl_options);
372 
373  // This is for use in the command interpreter, when you either want the
374  // selected target, or if no target is present you want to prime the dummy
375  // target with entities that will be copied over to new targets.
376  Target &GetSelectedOrDummyTarget(bool prefer_dummy = false);
378 
379  lldb::BroadcasterManagerSP GetBroadcasterManager() {
381  }
382 
383  /// Shared thread poll. Use only with ThreadPoolTaskGroup.
384  static llvm::ThreadPool &GetThreadPool();
385 
386  /// Report warning events.
387  ///
388  /// Progress events will be delivered to any debuggers that have listeners
389  /// for the eBroadcastBitError.
390  ///
391  /// \param[in] message
392  /// The warning message to be reported.
393  ///
394  /// \param [in] debugger_id
395  /// If this optional parameter has a value, it indicates the unique
396  /// debugger identifier that this progress should be delivered to. If this
397  /// optional parameter does not have a value, the progress will be
398  /// delivered to all debuggers.
399  ///
400  /// \param [in] once
401  /// If a pointer is passed to a std::once_flag, then it will be used to
402  /// ensure the given warning is only broadcast once.
403  static void
404  ReportWarning(std::string messsage,
405  llvm::Optional<lldb::user_id_t> debugger_id = llvm::None,
406  std::once_flag *once = nullptr);
407 
408  /// Report error events.
409  ///
410  /// Progress events will be delivered to any debuggers that have listeners
411  /// for the eBroadcastBitError.
412  ///
413  /// \param[in] message
414  /// The error message to be reported.
415  ///
416  /// \param [in] debugger_id
417  /// If this optional parameter has a value, it indicates the unique
418  /// debugger identifier that this progress should be delivered to. If this
419  /// optional parameter does not have a value, the progress will be
420  /// delivered to all debuggers.
421  ///
422  /// \param [in] once
423  /// If a pointer is passed to a std::once_flag, then it will be used to
424  /// ensure the given error is only broadcast once.
425  static void
426  ReportError(std::string messsage,
427  llvm::Optional<lldb::user_id_t> debugger_id = llvm::None,
428  std::once_flag *once = nullptr);
429 
430 protected:
431  friend class CommandInterpreter;
432  friend class REPL;
433  friend class Progress;
434 
435  /// Report progress events.
436  ///
437  /// Progress events will be delivered to any debuggers that have listeners
438  /// for the eBroadcastBitProgress. This function is called by the
439  /// lldb_private::Progress class to deliver the events to any debuggers that
440  /// qualify.
441  ///
442  /// \param [in] progress_id
443  /// The unique integer identifier for the progress to report.
444  ///
445  /// \param[in] message
446  /// The title of the progress dialog to display in the UI.
447  ///
448  /// \param [in] completed
449  /// The amount of work completed. If \a completed is zero, then this event
450  /// is a progress started event. If \a completed is equal to \a total, then
451  /// this event is a progress end event. Otherwise completed indicates the
452  /// current progress compare to the total value.
453  ///
454  /// \param [in] total
455  /// The total amount of work units that need to be completed. If this value
456  /// is UINT64_MAX, then an indeterminate progress indicator should be
457  /// displayed.
458  ///
459  /// \param [in] debugger_id
460  /// If this optional parameter has a value, it indicates the unique
461  /// debugger identifier that this progress should be delivered to. If this
462  /// optional parameter does not have a value, the progress will be
463  /// delivered to all debuggers.
464  static void ReportProgress(uint64_t progress_id, const std::string &message,
465  uint64_t completed, uint64_t total,
466  llvm::Optional<lldb::user_id_t> debugger_id);
467 
470  llvm::Optional<lldb::user_id_t> debugger_id,
471  std::once_flag *once);
472 
473  void PrintProgress(const ProgressEventData &data);
474 
476 
477  void StopEventHandlerThread();
478 
479  void PushIOHandler(const lldb::IOHandlerSP &reader_sp,
480  bool cancel_top_handler = true);
481 
482  bool PopIOHandler(const lldb::IOHandlerSP &reader_sp);
483 
484  bool HasIOHandlerThread();
485 
486  bool StartIOHandlerThread();
487 
488  void StopIOHandlerThread();
489 
490  void JoinIOHandlerThread();
491 
493 
495 
496  void HandleBreakpointEvent(const lldb::EventSP &event_sp);
497 
498  void HandleProcessEvent(const lldb::EventSP &event_sp);
499 
500  void HandleThreadEvent(const lldb::EventSP &event_sp);
501 
502  void HandleProgressEvent(const lldb::EventSP &event_sp);
503 
504  void HandleDiagnosticEvent(const lldb::EventSP &event_sp);
505 
506  // Ensures two threads don't attempt to flush process output in parallel.
508  void FlushProcessOutput(Process &process, bool flush_stdout,
509  bool flush_stderr);
510 
512  return m_source_file_cache;
513  }
514 
515  void InstanceInitialize();
516 
517  // these should never be NULL
518  lldb::FileSP m_input_file_sp;
519  lldb::StreamFileSP m_output_stream_sp;
520  lldb::StreamFileSP m_error_stream_sp;
521 
522  /// Used for shadowing the input file when capturing a reproducer.
524 
525  lldb::BroadcasterManagerSP m_broadcaster_manager_sp; // The debugger acts as a
526  // broadcaster manager of
527  // last resort.
528  // It needs to get constructed before the target_list or any other member
529  // that might want to broadcast through the debugger.
530 
531  TerminalState m_terminal_state;
533 
535  lldb::ListenerSP m_listener_sp;
536  std::unique_ptr<SourceManager> m_source_manager_up; // This is a scratch
537  // source manager that we
538  // return if we have no
539  // targets.
541  // for targets created in
542  // this debugger used this
543  // shared
544  // source file cache.
545  std::unique_ptr<CommandInterpreter> m_command_interpreter_up;
546 
547  std::recursive_mutex m_script_interpreter_mutex;
548  std::array<lldb::ScriptInterpreterSP, lldb::eScriptLanguageUnknown>
550 
552  std::recursive_mutex m_io_handler_synchronous_mutex;
553 
554  llvm::Optional<uint64_t> m_current_event_id;
555 
556  llvm::StringMap<std::weak_ptr<llvm::raw_ostream>> m_log_streams;
557  std::shared_ptr<llvm::raw_ostream> m_log_callback_stream_sp;
559  static LoadPluginCallbackType g_load_plugin_callback;
560  typedef std::vector<llvm::sys::DynamicLibrary> LoadedPluginsList;
564  Broadcaster m_sync_broadcaster; ///< Private debugger synchronization.
565  Broadcaster m_broadcaster; ///< Public Debugger event broadcaster.
566  lldb::ListenerSP m_forward_listener_sp;
567  llvm::once_flag m_clear_once;
568  lldb::TargetSP m_dummy_target_sp;
569 
570  // Events for m_sync_broadcaster
571  enum {
573  };
574 
575 private:
576  // Use Debugger::CreateInstance() to get a shared pointer to a new debugger
577  // object
578  Debugger(lldb::LogOutputCallback m_log_callback, void *baton);
579 
580  Debugger(const Debugger &) = delete;
581  const Debugger &operator=(const Debugger &) = delete;
582 };
583 
584 } // namespace lldb_private
585 
586 #endif // LLDB_CORE_DEBUGGER_H
lldb_private::Debugger::SettingsTerminate
static void SettingsTerminate()
Definition: Debugger.cpp:562
lldb_private::Debugger::GetBroadcaster
Broadcaster & GetBroadcaster()
Get the public broadcaster for this debugger.
Definition: Debugger.h:88
lldb_private::Debugger::CheckTopIOHandlerTypes
bool CheckTopIOHandlerTypes(IOHandler::Type top_type, IOHandler::Type second_top_type)
Definition: Debugger.cpp:1074
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::Debugger::GetIOHandlerCommandPrefix
const char * GetIOHandlerCommandPrefix()
Definition: Debugger.cpp:1092
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:1036
lldb-private-types.h
llvm
Definition: Debugger.h:50
lldb_private::Debugger::SetCloseInputOnEOF
void SetCloseInputOnEOF(bool b)
Definition: Debugger.cpp:858
lldb::ScriptLanguage
ScriptLanguage
Script interpreter types.
Definition: lldb-enumerations.h:216
lldb_private::Debugger::GetDisassemblyLineCount
uint32_t GetDisassemblyLineCount() const
Definition: Debugger.cpp:481
lldb_private::Debugger::GetErrorFile
File & GetErrorFile()
Definition: Debugger.h:142
lldb_private::REPL
Definition: REPL.h:21
lldb_private::Debugger::m_output_stream_sp
lldb::StreamFileSP m_output_stream_sp
Definition: Debugger.h:519
lldb_private::Debugger::GetSelectedExecutionContext
ExecutionContext GetSelectedExecutionContext()
Definition: Debugger.cpp:980
lldb_private::Debugger::AdoptTopIOHandlerFilesIfInvalid
void AdoptTopIOHandlerFilesIfInvalid(lldb::FileSP &in, lldb::StreamFileSP &out, lldb::StreamFileSP &err)
Definition: Debugger.cpp:1109
lldb_private::Debugger::PrintProgress
void PrintProgress(const ProgressEventData &data)
lldb_private::Debugger::SetPropertyValue
Status SetPropertyValue(const ExecutionContext *exe_ctx, VarSetOperationType op, llvm::StringRef property_path, llvm::StringRef value) override
Definition: Debugger.cpp:190
lldb_private::Debugger::GetHighlightSource
bool GetHighlightSource() const
Definition: Debugger.cpp:435
IOHandler.h
lldb_private::Debugger::GetAutoConfirm
bool GetAutoConfirm() const
Definition: Debugger.cpp:254
lldb_private::HostThread
Definition: HostThread.h:29
lldb_private::Debugger::GetREPLLanguage
lldb::LanguageType GetREPLLanguage() const
Definition: Debugger.cpp:331
lldb_private::Debugger::DispatchInputEndOfFile
void DispatchInputEndOfFile()
Definition: Debugger.cpp:993
lldb_private::Debugger::operator=
const Debugger & operator=(const Debugger &)=delete
lldb_private::Debugger::GetCommandInterpreter
CommandInterpreter & GetCommandInterpreter()
Definition: Debugger.h:170
lldb_private::Debugger::HandleThreadEvent
void HandleThreadEvent(const lldb::EventSP &event_sp)
Definition: Debugger.cpp:1634
lldb_private::Debugger::RunREPL
Status RunREPL(lldb::LanguageType language, const char *repl_options)
Definition: Debugger.cpp:1937
lldb_private::Debugger::GetDebuggerAtIndex
static lldb::DebuggerSP GetDebuggerAtIndex(size_t index)
Definition: Debugger.cpp:1220
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:567
lldb_private::Debugger::SetPrompt
void SetPrompt(llvm::StringRef p)
Definition: Debugger.cpp:293
lldb_private::SourceManager::SourceFileCache
Definition: SourceManager.h:96
lldb_private::Debugger::GetShowProgress
bool GetShowProgress() const
Definition: Debugger.cpp:383
lldb-defines.h
lldb_private::Debugger::GetDummyTarget
Target & GetDummyTarget()
Definition: Debugger.h:377
lldb_private::Debugger::Debugger
Debugger(lldb::LogOutputCallback m_log_callback, void *baton)
Definition: Debugger.cpp:740
lldb_private::UserID
Definition: UserID.h:31
lldb_private::Debugger::SetOutputFile
void SetOutputFile(lldb::FileSP file)
Definition: Debugger.cpp:962
lldb_private::Debugger::GetThreadPool
static llvm::ThreadPool & GetThreadPool()
Shared thread poll. Use only with ThreadPoolTaskGroup.
Definition: Debugger.cpp:1981
lldb_private::Debugger::g_load_plugin_callback
static LoadPluginCallbackType g_load_plugin_callback
Definition: Debugger.h:559
lldb_private::Debugger::GetStopShowColumnAnsiSuffix
llvm::StringRef GetStopShowColumnAnsiSuffix() const
Definition: Debugger.cpp:452
lldb_private::Debugger::GetUseSourceCache
bool GetUseSourceCache() const
Definition: Debugger.cpp:421
lldb_private::Process
Definition: Process.h:338
lldb_private::Debugger::SetInputFile
Status SetInputFile(lldb::FileSP file)
lldb_private::Debugger::GetPrintDecls
bool GetPrintDecls() const
Definition: Debugger.cpp:507
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:1104
lldb_private::Debugger::StopEventHandlerThread
void StopEventHandlerThread()
Definition: Debugger.cpp:1800
lldb_private::Debugger::StartEventHandlerThread
bool StartEventHandlerThread()
Definition: Debugger.cpp:1760
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb_private::Debugger::RunIOHandlers
void RunIOHandlers()
Definition: Debugger.cpp:1011
lldb_private::TargetList
Definition: TargetList.h:21
lldb_private::Debugger::GetOutputStream
StreamFile & GetOutputStream()
Definition: Debugger.h:144
lldb_private::Debugger::StartIOHandlerThread
bool StartIOHandlerThread()
Definition: Debugger.cpp:1899
SourceManager.h
lldb_private::Debugger::m_current_event_id
llvm::Optional< uint64_t > m_current_event_id
Definition: Debugger.h:554
lldb_private::Debugger::CreateInstance
static lldb::DebuggerSP CreateInstance(lldb::LogOutputCallback log_callback=nullptr, void *baton=nullptr)
Definition: Debugger.cpp:652
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:502
lldb_private::Debugger::GetOutputStreamSP
lldb::StreamFileSP GetOutputStreamSP()
Definition: Debugger.h:134
lldb_private::Debugger::GetTopIOHandlerControlSequence
ConstString GetTopIOHandlerControlSequence(char ch)
Definition: Debugger.cpp:1088
lldb_private::Stream
Definition: Stream.h:28
lldb_private::Debugger::IsForwardingEvents
bool IsForwardingEvents()
Definition: Debugger.cpp:1650
lldb_private::Debugger::GetScriptLanguage
lldb::ScriptLanguage GetScriptLanguage() const
Definition: Debugger.cpp:319
lldb_private::Debugger::eStopDisassemblyTypeNever
@ eStopDisassemblyTypeNever
Definition: Debugger.h:252
lldb_private::Debugger::m_input_recorder
repro::DataRecorder * m_input_recorder
Used for shadowing the input file when capturing a reproducer.
Definition: Debugger.h:523
lldb_private::Debugger::GetUseExternalEditor
bool GetUseExternalEditor() const
Definition: Debugger.cpp:359
lldb-private-enumerations.h
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::Target
Definition: Target.h:464
lldb_private::Debugger::GetScriptInterpreter
ScriptInterpreter * GetScriptInterpreter(bool can_create=true, llvm::Optional< lldb::ScriptLanguage > language={})
Definition: Debugger.cpp:1461
lldb_private::Debugger::GetListener
lldb::ListenerSP GetListener()
Definition: Debugger.h:179
lldb_private::Debugger::m_io_handler_thread
HostThread m_io_handler_thread
Definition: Debugger.h:563
lldb_private::Debugger::GetStopDisassemblyMaxSize
uint32_t GetStopDisassemblyMaxSize() const
Definition: Debugger.cpp:275
lldb_private::Debugger::m_log_streams
llvm::StringMap< std::weak_ptr< llvm::raw_ostream > > m_log_streams
Definition: Debugger.h:556
lldb_private::Debugger::GetUseAutosuggestion
bool GetUseAutosuggestion() const
Definition: Debugger.cpp:405
lldb_private::Debugger::m_loaded_plugins
LoadedPluginsList m_loaded_plugins
Definition: Debugger.h:561
lldb_private::Debugger::SetErrorFile
void SetErrorFile(lldb::FileSP file)
Definition: Debugger.cpp:967
lldb_private::Debugger::ClearIOHandlers
void ClearIOHandlers()
Definition: Debugger.cpp:1000
Broadcaster.h
lldb_private::Debugger::ReportWarning
static void ReportWarning(std::string messsage, llvm::Optional< lldb::user_id_t > debugger_id=llvm::None, std::once_flag *once=nullptr)
Report warning events.
Definition: Debugger.cpp:1395
lldb_private::Debugger::GetStopShowColumn
lldb::StopShowColumn GetStopShowColumn() const
Definition: Debugger.cpp:441
lldb_private::Debugger::SaveInputTerminalState
void SaveInputTerminalState()
Definition: Debugger.cpp:972
lldb_private::Debugger::RemoveIOHandler
bool RemoveIOHandler(const lldb::IOHandlerSP &reader_sp)
Remove the given IO handler if it's currently active.
Definition: Debugger.cpp:1100
lldb_private::Properties
Definition: UserSettingsController.h:33
lldb_private::Debugger::GetInputFile
File & GetInputFile()
Definition: Debugger.h:138
lldb_private::Debugger::m_io_handler_synchronous_mutex
std::recursive_mutex m_io_handler_synchronous_mutex
Definition: Debugger.h:552
lldb_private::Debugger::m_listener_sp
lldb::ListenerSP m_listener_sp
Definition: Debugger.h:535
lldb_private::Debugger::eStopDisassemblyTypeAlways
@ eStopDisassemblyTypeAlways
Definition: Debugger.h:255
lldb_private::DiagnosticEventData::Type
Type
Definition: DebuggerEvents.h:53
lldb_private::Debugger::m_broadcaster
Broadcaster m_broadcaster
Public Debugger event broadcaster.
Definition: Debugger.h:565
Platform.h
lldb_private::FileSpec
Definition: FileSpec.h:56
lldb_private::Debugger::GetDisassemblyFormat
const FormatEntity::Entry * GetDisassemblyFormat() const
Definition: Debugger.cpp:260
lldb_private::Debugger::GetAutosuggestionAnsiSuffix
llvm::StringRef GetAutosuggestionAnsiSuffix() const
Definition: Debugger.cpp:416
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:427
lldb_private::Debugger::SetLoggingCallback
void SetLoggingCallback(lldb::LogOutputCallback log_callback, void *baton)
Definition: Debugger.cpp:1290
lldb_private::Debugger::IsHandlingEvents
bool IsHandlingEvents() const
Definition: Debugger.h:369
lldb_private::Debugger::GetStaticBroadcasterClass
static ConstString GetStaticBroadcasterClass()
Definition: Debugger.cpp:735
TargetList.h
lldb_private::Debugger::m_script_interpreter_mutex
std::recursive_mutex m_script_interpreter_mutex
Definition: Debugger.h:547
HostThread.h
lldb_private::Debugger::m_source_manager_up
std::unique_ptr< SourceManager > m_source_manager_up
Definition: Debugger.h:536
lldb_private::Debugger::GetAutoIndent
bool GetAutoIndent() const
Definition: Debugger.cpp:497
lldb_private::Debugger::DispatchInputInterrupt
void DispatchInputInterrupt()
Definition: Debugger.cpp:986
lldb_private::Debugger::GetOutputFile
File & GetOutputFile()
Definition: Debugger.h:140
lldb_private::Debugger::SettingsInitialize
static void SettingsInitialize()
Definition: Debugger.cpp:560
lldb_private::Debugger::SetREPLLanguage
bool SetREPLLanguage(lldb::LanguageType repl_lang)
Definition: Debugger.cpp:340
lldb_private::Debugger::GetStopShowColumnAnsiPrefix
llvm::StringRef GetStopShowColumnAnsiPrefix() const
Definition: Debugger.cpp:447
lldb_private::Debugger::GetThreadFormat
const FormatEntity::Entry * GetThreadFormat() const
Definition: Debugger.cpp:309
lldb_private::Debugger::m_instance_name
ConstString m_instance_name
Definition: Debugger.h:558
lldb_private::Debugger::GetAsyncOutputStream
lldb::StreamSP GetAsyncOutputStream()
Definition: Debugger.cpp:1204
lldb_private::ProgressEventData
Definition: DebuggerEvents.h:20
lldb_private::Debugger::GetEscapeNonPrintables
bool GetEscapeNonPrintables() const
Definition: Debugger.cpp:492
lldb_private::Debugger::eStopDisassemblyTypeNoDebugInfo
@ eStopDisassemblyTypeNoDebugInfo
Definition: Debugger.h:253
lldb_private::Debugger::GetAsyncErrorStream
lldb::StreamSP GetAsyncErrorStream()
Definition: Debugger.cpp:1208
lldb_private::Debugger::GetTerminalWidth
uint32_t GetTerminalWidth() const
Definition: Debugger.cpp:345
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:1410
lldb_private::Debugger::Initialize
static void Initialize(LoadPluginCallbackType load_plugin_callback)
Definition: Debugger.cpp:537
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::Debugger::GetShowProgressAnsiPrefix
llvm::StringRef GetShowProgressAnsiPrefix() const
Definition: Debugger.cpp:395
lldb-enumerations.h
lldb_private::Debugger::GetAutoOneLineSummaries
bool GetAutoOneLineSummaries() const
Definition: Debugger.cpp:487
lldb_private::Progress
A Progress indicator helper class.
Definition: Progress.h:55
lldb_private::Debugger::GetSourceManager
SourceManager & GetSourceManager()
Definition: Debugger.cpp:1477
lldb_private::Debugger::HandleProcessEvent
void HandleProcessEvent(const lldb::EventSP &event_sp)
Definition: Debugger.cpp:1551
lldb_private::Debugger::GetInputFileSP
lldb::FileSP GetInputFileSP()
Definition: Debugger.h:132
lldb_private::Debugger::SetShowProgress
bool SetShowProgress(bool show_progress)
Definition: Debugger.cpp:389
lldb_private::Debugger::DefaultEventHandler
lldb::thread_result_t DefaultEventHandler()
Definition: Debugger.cpp:1660
lldb_private::CommandInterpreter
Definition: CommandInterpreter.h:214
lldb_private::Debugger::eBroadcastBitError
@ eBroadcastBitError
Definition: Debugger.h:82
lldb_private::Debugger::m_error_stream_sp
lldb::StreamFileSP m_error_stream_sp
Definition: Debugger.h:520
lldb_private::File
Definition: File.h:35
lldb_private::Debugger::eBroadcastBitProgress
@ eBroadcastBitProgress
Definition: Debugger.h:80
lldb_private::Debugger
Definition: Debugger.h:72
lldb_private::Debugger::EnableForwardEvents
void EnableForwardEvents(const lldb::ListenerSP &listener_sp)
Definition: Debugger.cpp:1652
lldb_private::Debugger::PopIOHandler
bool PopIOHandler(const lldb::IOHandlerSP &reader_sp)
Definition: Debugger.cpp:1177
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::PlatformList
Definition: Platform.h:946
lldb::StopShowColumn
StopShowColumn
Definition: lldb-enumerations.h:500
lldb_private::Debugger::m_source_file_cache
SourceManager::SourceFileCache m_source_file_cache
Definition: Debugger.h:540
lldb_private::Debugger::SetScriptLanguage
bool SetScriptLanguage(lldb::ScriptLanguage script_lang)
Definition: Debugger.cpp:325
lldb_private::Debugger::FlushProcessOutput
void FlushProcessOutput(Process &process, bool flush_stdout, bool flush_stderr)
Definition: Debugger.cpp:1531
lldb_private::Debugger::StopDisassemblyType
StopDisassemblyType
Definition: Debugger.h:251
lldb_private::Debugger::m_io_handler_stack
IOHandlerStack m_io_handler_stack
Definition: Debugger.h:551
lldb_private::Debugger::GetInputRecorder
repro::DataRecorder * GetInputRecorder()
Definition: Debugger.cpp:870
UserID.h
lldb_private::Debugger::JoinIOHandlerThread
void JoinIOHandlerThread()
Definition: Debugger.cpp:1921
lldb_private::Debugger::GetTargetList
TargetList & GetTargetList()
Get accessor for the target list.
Definition: Debugger.h:200
lldb_private::Debugger::m_broadcaster_manager_sp
lldb::BroadcasterManagerSP m_broadcaster_manager_sp
Definition: Debugger.h:525
lldb-types.h
lldb_private::Debugger::m_terminal_state
TerminalState m_terminal_state
Definition: Debugger.h:531
lldb_private::Debugger::GetIOHandlerHelpPrologue
const char * GetIOHandlerHelpPrologue()
Definition: Debugger.cpp:1096
StreamFile.h
lldb_private::Debugger::eStopDisassemblyTypeNoSource
@ eStopDisassemblyTypeNoSource
Definition: Debugger.h:254
lldb_private::Debugger::GetStopDisassemblyDisplay
StopDisassemblyType GetStopDisassemblyDisplay() const
Definition: Debugger.cpp:474
lldb_private::Debugger::PrintAsync
void PrintAsync(const char *s, size_t len, bool is_stdout)
Definition: Debugger.cpp:1079
lldb_private::Debugger::Clear
void Clear()
Definition: Debugger.cpp:821
lldb_private::Debugger::GetNumDebuggers
static size_t GetNumDebuggers()
Definition: Debugger.cpp:1212
lldb_private::Debugger::IsTopIOHandler
bool IsTopIOHandler(const lldb::IOHandlerSP &reader_sp)
Definition: Debugger.cpp:1070
lldb_private::Debugger::FindDebuggerWithInstanceName
static lldb::DebuggerSP FindDebuggerWithInstanceName(ConstString instance_name)
Definition: Debugger.cpp:692
lldb_private::IOHandlerStack
Definition: IOHandler.h:470
lldb_private::Status
Definition: Status.h:44
lldb_private::Debugger::InstanceInitialize
void InstanceInitialize()
Definition: Debugger.cpp:626
lldb_private::Debugger::m_event_handler_thread
HostThread m_event_handler_thread
Definition: Debugger.h:562
lldb_private::Debugger::SetTerminalWidth
bool SetTerminalWidth(uint32_t term_width)
Definition: Debugger.cpp:351
lldb_private::Debugger::m_sync_broadcaster
Broadcaster m_sync_broadcaster
Private debugger synchronization.
Definition: Debugger.h:564
lldb_private::Debugger::GetNotifyVoid
bool GetNotifyVoid() const
Definition: Debugger.cpp:281
lldb_private::Debugger::PushIOHandler
void PushIOHandler(const lldb::IOHandlerSP &reader_sp, bool cancel_top_handler=true)
Definition: Debugger.cpp:1150
message
message(FATAL_ERROR "invalid libipt include path provided") endif() include_directories($
Definition: Plugins/Trace/intel-pt/CMakeLists.txt:6
uint32_t
lldb_private::Debugger::GetTabSize
uint32_t GetTabSize() const
Definition: Debugger.cpp:517
DebuggerEvents.h
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:462
lldb_private::Debugger::GetErrorStreamSP
lldb::StreamFileSP GetErrorStreamSP()
Definition: Debugger.h:136
lldb_private::Address
Definition: Address.h:59
lldb_private::Debugger::FindTargetWithProcessID
static lldb::TargetSP FindTargetWithProcessID(lldb::pid_t pid)
Definition: Debugger.cpp:707
lldb_private::Debugger::GetPlatformList
PlatformList & GetPlatformList()
Definition: Debugger.h:202
lldb_private::Debugger::GetCloseInputOnEOF
bool GetCloseInputOnEOF() const
Definition: Debugger.cpp:853
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:564
lldb_private::Debugger::GetBroadcaster
const Broadcaster & GetBroadcaster() const
Definition: Debugger.h:89
lldb_private::Debugger::FindDebuggerWithID
static lldb::DebuggerSP FindDebuggerWithID(lldb::user_id_t id)
Definition: Debugger.cpp:1232
lldb_private::FormatEntity::Entry
Definition: FormatEntity.h:40
lldb_private::Debugger::FindTargetWithProcess
static lldb::TargetSP FindTargetWithProcess(Process *process)
Definition: Debugger.cpp:721
lldb_private::Debugger::GetInstanceName
ConstString GetInstanceName()
Definition: Debugger.h:357
lldb_private::Debugger::m_log_callback_stream_sp
std::shared_ptr< llvm::raw_ostream > m_log_callback_stream_sp
Definition: Debugger.h:557
FormatEntity.h
lldb_private::Debugger::SetTabSize
bool SetTabSize(uint32_t tab_size)
Definition: Debugger.cpp:523
lldb_private::IOHandler::Type
Type
Definition: IOHandler.h:48
lldb_private::Debugger::~Debugger
~Debugger() override
Definition: Debugger.cpp:819
lldb_private::ScriptInterpreter
Definition: ScriptInterpreter.h:126
lldb_private::Debugger::m_output_flush_mutex
std::mutex m_output_flush_mutex
Definition: Debugger.h:507
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:1313
lldb_private::Debugger::HandleBreakpointEvent
void HandleBreakpointEvent(const lldb::EventSP &event_sp)
Definition: Debugger.cpp:1484
lldb_private::Debugger::HandleProgressEvent
void HandleProgressEvent(const lldb::EventSP &event_sp)
Definition: Debugger.cpp:1814
lldb-forward.h
lldb_private::Debugger::GetUseColor
bool GetUseColor() const
Definition: Debugger.cpp:370
Terminal.h
lldb_private::Debugger::LoadedPluginsList
std::vector< llvm::sys::DynamicLibrary > LoadedPluginsList
Definition: Debugger.h:560
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:365
lldb_private::Debugger::ReportDiagnosticImpl
static void ReportDiagnosticImpl(DiagnosticEventData::Type type, std::string message, llvm::Optional< lldb::user_id_t > debugger_id, std::once_flag *once)
Definition: Debugger.cpp:1366
lldb_private::Debugger::HandleDiagnosticEvent
void HandleDiagnosticEvent(const lldb::EventSP &event_sp)
Definition: Debugger.cpp:1888
lldb_private::Debugger::GetStopShowLineMarkerAnsiPrefix
llvm::StringRef GetStopShowLineMarkerAnsiPrefix() const
Definition: Debugger.cpp:457
lldb_private::HostThread::IsJoinable
bool IsJoinable() const
Definition: HostThread.cpp:30
lldb_private::Debugger::GetShowProgressAnsiSuffix
llvm::StringRef GetShowProgressAnsiSuffix() const
Definition: Debugger.cpp:400
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:187
lldb_private::Debugger::GetFrameFormatUnique
const FormatEntity::Entry * GetFrameFormatUnique() const
Definition: Debugger.cpp:270
lldb_private::Debugger::RestoreInputTerminalState
void RestoreInputTerminalState()
Definition: Debugger.cpp:978
lldb_private::Debugger::GetAsyncExecution
bool GetAsyncExecution()
Definition: Debugger.cpp:862
lldb_private::Debugger::GetThreadStopFormat
const FormatEntity::Entry * GetThreadStopFormat() const
Definition: Debugger.cpp:314
lldb_private::Debugger::m_target_list
TargetList m_target_list
Definition: Debugger.h:532
lldb_private::Debugger::Terminate
static void Terminate()
Definition: Debugger.cpp:545
FileSpec.h
lldb_private::Debugger::m_platform_list
PlatformList m_platform_list
Definition: Debugger.h:534
lldb_private::Debugger::m_input_file_sp
lldb::FileSP m_input_file_sp
Definition: Debugger.h:518
lldb_private::Debugger::StopIOHandlerThread
void StopIOHandlerThread()
Definition: Debugger.cpp:1914
lldb_private::Debugger::SetAsyncExecution
void SetAsyncExecution(bool async)
Definition: Debugger.cpp:866
ConstString.h
lldb_private::Debugger::GetReproducerPath
llvm::StringRef GetReproducerPath() const
Definition: Debugger.cpp:304
lldb_private::Debugger::ReportError
static void ReportError(std::string messsage, llvm::Optional< lldb::user_id_t > debugger_id=llvm::None, std::once_flag *once=nullptr)
Report error events.
Definition: Debugger.cpp:1402
lldb_private::StreamFile
Definition: StreamFile.h:22
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:1248
lldb_private::Debugger::eBroadcastBitEventThreadIsListening
@ eBroadcastBitEventThreadIsListening
Definition: Debugger.h:572
lldb_private::Debugger::GetStopSourceLineCount
uint32_t GetStopSourceLineCount(bool before) const
Definition: Debugger.cpp:467
lldb_private::TargetList::GetSelectedTarget
lldb::TargetSP GetSelectedTarget()
Definition: TargetList.cpp:528
lldb_private::Debugger::GetBroadcasterManager
lldb::BroadcasterManagerSP GetBroadcasterManager()
Definition: Debugger.h:379
lldb_private::Debugger::SetUseColor
bool SetUseColor(bool use_color)
Definition: Debugger.cpp:376
lldb_private::Debugger::GetSourceFileCache
SourceManager::SourceFileCache & GetSourceFileCache()
Definition: Debugger.h:511
lldb_private::Debugger::IOHandlerThread
lldb::thread_result_t IOHandlerThread()
Definition: Debugger.cpp:1808
lldb_private::Debugger::SetPrintDecls
bool SetPrintDecls(bool b)
Definition: Debugger.cpp:512
lldb_private::Debugger::m_command_interpreter_up
std::unique_ptr< CommandInterpreter > m_command_interpreter_up
Definition: Debugger.h:545
lldb_private::Debugger::GetAutosuggestionAnsiPrefix
llvm::StringRef GetAutosuggestionAnsiPrefix() const
Definition: Debugger.cpp:411
lldb_private::Debugger::m_dummy_target_sp
lldb::TargetSP m_dummy_target_sp
Definition: Debugger.h:568
lldb_private::Debugger::eBroadcastBitWarning
@ eBroadcastBitWarning
Definition: Debugger.h:81
lldb_private::Broadcaster
Definition: Broadcaster.h:242
lldb_private::Debugger::m_forward_listener_sp
lldb::ListenerSP m_forward_listener_sp
Definition: Debugger.h:566
lldb_private::Debugger::GetPrompt
llvm::StringRef GetPrompt() const
Definition: Debugger.cpp:287
lldb_private::Debugger::CancelForwardEvents
void CancelForwardEvents(const lldb::ListenerSP &listener_sp)
Definition: Debugger.cpp:1656
lldb_private::Debugger::GetErrorStream
StreamFile & GetErrorStream()
Definition: Debugger.h:146
lldb_private::Debugger::Destroy
static void Destroy(lldb::DebuggerSP &debugger_sp)
Definition: Debugger.cpp:663
lldb_private::Debugger::HasIOHandlerThread
bool HasIOHandlerThread()
Definition: Debugger.cpp:1897
ExecutionContext.h
lldb_private::Debugger::GetSelectedOrDummyTarget
Target & GetSelectedOrDummyTarget(bool prefer_dummy=false)
Definition: Debugger.cpp:1929
lldb_private::SourceManager
Definition: SourceManager.h:31
lldb_private::Debugger::SetInputString
Status SetInputString(const char *data)
Definition: Debugger.cpp:881
lldb_private::Debugger::m_script_interpreters
std::array< lldb::ScriptInterpreterSP, lldb::eScriptLanguageUnknown > m_script_interpreters
Definition: Debugger.h:549
lldb_private::Debugger::GetFrameFormat
const FormatEntity::Entry * GetFrameFormat() const
Definition: Debugger.cpp:265