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  Status SetInputString(const char *data);
180 
181  // This method will setup data recorder if reproducer enabled.
182  // On reply mode this method should take instructions from reproducer file.
183  Status SetInputFile(lldb::FileSP file);
184 
185  void SetInputFile(lldb::FileSP file, repro::DataRecorder *recorder);
186 
187  void SetOutputFile(lldb::FileSP file);
188 
189  void SetErrorFile(lldb::FileSP file);
190 
191  void SaveInputTerminalState();
192 
194 
195  lldb::StreamSP GetAsyncOutputStream();
196 
197  lldb::StreamSP GetAsyncErrorStream();
198 
200  assert(m_command_interpreter_up.get());
201  return *m_command_interpreter_up;
202  }
203 
205  GetScriptInterpreter(bool can_create = true,
206  llvm::Optional<lldb::ScriptLanguage> language = {});
207 
208  lldb::ListenerSP GetListener() { return m_listener_sp; }
209 
210  // This returns the Debugger's scratch source manager. It won't be able to
211  // look up files in debug information, but it can look up files by absolute
212  // path and display them to you. To get the target's source manager, call
213  // GetSourceManager on the target instead.
215 
216  lldb::TargetSP GetSelectedTarget() {
218  }
219 
221  /// Get accessor for the target list.
222  ///
223  /// The target list is part of the global debugger object. This the single
224  /// debugger shared instance to control where targets get created and to
225  /// allow for tracking and searching for targets based on certain criteria.
226  ///
227  /// \return
228  /// A global shared target list.
230 
232 
233  void DispatchInputInterrupt();
234 
235  void DispatchInputEndOfFile();
236 
237  // If any of the streams are not set, set them to the in/out/err stream of
238  // the top most input reader to ensure they at least have something
239  void AdoptTopIOHandlerFilesIfInvalid(lldb::FileSP &in,
240  lldb::StreamFileSP &out,
241  lldb::StreamFileSP &err);
242 
243  /// Run the given IO handler and return immediately.
244  void RunIOHandlerAsync(const lldb::IOHandlerSP &reader_sp,
245  bool cancel_top_handler = true);
246 
247  /// Run the given IO handler and block until it's complete.
248  void RunIOHandlerSync(const lldb::IOHandlerSP &reader_sp);
249 
250  /// Remove the given IO handler if it's currently active.
251  bool RemoveIOHandler(const lldb::IOHandlerSP &reader_sp);
252 
253  bool IsTopIOHandler(const lldb::IOHandlerSP &reader_sp);
254 
256  IOHandler::Type second_top_type);
257 
258  void PrintAsync(const char *s, size_t len, bool is_stdout);
259 
261 
262  const char *GetIOHandlerCommandPrefix();
263 
264  const char *GetIOHandlerHelpPrologue();
265 
266  void ClearIOHandlers();
267 
268  bool GetCloseInputOnEOF() const;
269 
270  void SetCloseInputOnEOF(bool b);
271 
272  bool EnableLog(llvm::StringRef channel,
273  llvm::ArrayRef<const char *> categories,
274  llvm::StringRef log_file, uint32_t log_options,
275  llvm::raw_ostream &error_stream);
276 
277  void SetLoggingCallback(lldb::LogOutputCallback log_callback, void *baton);
278 
279  // Properties Functions
285  };
286 
288  VarSetOperationType op, llvm::StringRef property_path,
289  llvm::StringRef value) override;
290 
291  bool GetAutoConfirm() const;
292 
294 
295  const FormatEntity::Entry *GetFrameFormat() const;
296 
298 
300 
301  const FormatEntity::Entry *GetThreadFormat() const;
302 
304 
306 
307  bool SetScriptLanguage(lldb::ScriptLanguage script_lang);
308 
309  uint32_t GetTerminalWidth() const;
310 
311  bool SetTerminalWidth(uint32_t term_width);
312 
313  llvm::StringRef GetPrompt() const;
314 
315  void SetPrompt(llvm::StringRef p);
316  void SetPrompt(const char *) = delete;
317 
318  llvm::StringRef GetReproducerPath() const;
319 
320  bool GetUseExternalEditor() const;
321 
322  bool SetUseExternalEditor(bool use_external_editor_p);
323 
324  bool GetUseColor() const;
325 
326  bool SetUseColor(bool use_color);
327 
328  bool GetUseAutosuggestion() const;
329 
330  bool GetUseSourceCache() const;
331 
332  bool SetUseSourceCache(bool use_source_cache);
333 
334  bool GetHighlightSource() const;
335 
337 
338  llvm::StringRef GetStopShowColumnAnsiPrefix() const;
339 
340  llvm::StringRef GetStopShowColumnAnsiSuffix() const;
341 
342  uint32_t GetStopSourceLineCount(bool before) const;
343 
345 
347 
348  llvm::StringRef GetStopShowLineMarkerAnsiPrefix() const;
349 
350  llvm::StringRef GetStopShowLineMarkerAnsiSuffix() const;
351 
352  bool GetAutoOneLineSummaries() const;
353 
354  bool GetAutoIndent() const;
355 
356  bool SetAutoIndent(bool b);
357 
358  bool GetPrintDecls() const;
359 
360  bool SetPrintDecls(bool b);
361 
362  uint32_t GetTabSize() const;
363 
364  bool SetTabSize(uint32_t tab_size);
365 
366  bool GetEscapeNonPrintables() const;
367 
368  bool GetNotifyVoid() const;
369 
371 
372  bool LoadPlugin(const FileSpec &spec, Status &error);
373 
374  void RunIOHandlers();
375 
376  bool IsForwardingEvents();
377 
378  void EnableForwardEvents(const lldb::ListenerSP &listener_sp);
379 
380  void CancelForwardEvents(const lldb::ListenerSP &listener_sp);
381 
383 
384  Status RunREPL(lldb::LanguageType language, const char *repl_options);
385 
386  // This is for use in the command interpreter, when you either want the
387  // selected target, or if no target is present you want to prime the dummy
388  // target with entities that will be copied over to new targets.
389  Target &GetSelectedOrDummyTarget(bool prefer_dummy = false);
391 
392  lldb::BroadcasterManagerSP GetBroadcasterManager() {
394  }
395 
396 protected:
397  friend class CommandInterpreter;
398  friend class REPL;
399  friend class Progress;
400 
401  /// Report progress events.
402  ///
403  /// Progress events will be delivered to any debuggers that have listeners
404  /// for the eBroadcastBitProgress. This function is called by the
405  /// lldb_private::Progress class to deliver the events to any debuggers that
406  /// qualify.
407  ///
408  /// \param [in] progress_id
409  /// The unique integer identifier for the progress to report.
410  ///
411  /// \param[in] message
412  /// The title of the progress dialog to display in the UI.
413  ///
414  /// \param [in] completed
415  /// The amount of work completed. If \a completed is zero, then this event
416  /// is a progress started event. If \a completed is equal to \a total, then
417  /// this event is a progress end event. Otherwise completed indicates the
418  /// current progress compare to the total value.
419  ///
420  /// \param [in] total
421  /// The total amount of work units that need to be completed. If this value
422  /// is UINT64_MAX, then an indeterminate progress indicator should be
423  /// displayed.
424  ///
425  /// \param [in] debugger_id
426  /// If this optional parameter has a value, it indicates the unique
427  /// debugger identifier that this progress should be delivered to. If this
428  /// optional parameter does not have a value, the progress will be
429  /// delivered to all debuggers.
430  static void ReportProgress(uint64_t progress_id, const std::string &message,
431  uint64_t completed, uint64_t total,
432  llvm::Optional<lldb::user_id_t> debugger_id);
433 
435 
436  void StopEventHandlerThread();
437 
439 
440  void PushIOHandler(const lldb::IOHandlerSP &reader_sp,
441  bool cancel_top_handler = true);
442 
443  bool PopIOHandler(const lldb::IOHandlerSP &reader_sp);
444 
445  bool HasIOHandlerThread();
446 
447  bool StartIOHandlerThread();
448 
449  void StopIOHandlerThread();
450 
451  void JoinIOHandlerThread();
452 
454 
455  void DefaultEventHandler();
456 
457  void HandleBreakpointEvent(const lldb::EventSP &event_sp);
458 
459  void HandleProcessEvent(const lldb::EventSP &event_sp);
460 
461  void HandleThreadEvent(const lldb::EventSP &event_sp);
462 
463  // Ensures two threads don't attempt to flush process output in parallel.
465  void FlushProcessOutput(Process &process, bool flush_stdout,
466  bool flush_stderr);
467 
469  return m_source_file_cache;
470  }
471 
472  void InstanceInitialize();
473 
474  // these should never be NULL
475  lldb::FileSP m_input_file_sp;
476  lldb::StreamFileSP m_output_stream_sp;
477  lldb::StreamFileSP m_error_stream_sp;
478 
479  /// Used for shadowing the input file when capturing a reproducer.
481 
482  lldb::BroadcasterManagerSP m_broadcaster_manager_sp; // The debugger acts as a
483  // broadcaster manager of
484  // last resort.
485  // It needs to get constructed before the target_list or any other member
486  // that might want to broadcast through the debugger.
487 
488  TerminalState m_terminal_state;
490 
492  lldb::ListenerSP m_listener_sp;
493  std::unique_ptr<SourceManager> m_source_manager_up; // This is a scratch
494  // source manager that we
495  // return if we have no
496  // targets.
498  // for targets created in
499  // this debugger used this
500  // shared
501  // source file cache.
502  std::unique_ptr<CommandInterpreter> m_command_interpreter_up;
503 
504  std::recursive_mutex m_script_interpreter_mutex;
505  std::array<lldb::ScriptInterpreterSP, lldb::eScriptLanguageUnknown>
507 
509  std::recursive_mutex m_io_handler_synchronous_mutex;
510 
511  llvm::StringMap<std::weak_ptr<llvm::raw_ostream>> m_log_streams;
512  std::shared_ptr<llvm::raw_ostream> m_log_callback_stream_sp;
514  static LoadPluginCallbackType g_load_plugin_callback;
515  typedef std::vector<llvm::sys::DynamicLibrary> LoadedPluginsList;
519  Broadcaster m_sync_broadcaster; ///< Private debugger synchronization.
520  Broadcaster m_broadcaster; ///< Public Debugger event broadcaster.
521  lldb::ListenerSP m_forward_listener_sp;
522  llvm::once_flag m_clear_once;
523  lldb::TargetSP m_dummy_target_sp;
524 
525  // Events for m_sync_broadcaster
526  enum {
528  };
529 
530 private:
531  // Use Debugger::CreateInstance() to get a shared pointer to a new debugger
532  // object
533  Debugger(lldb::LogOutputCallback m_log_callback, void *baton);
534 
535  Debugger(const Debugger &) = delete;
536  const Debugger &operator=(const Debugger &) = delete;
537 };
538 
539 } // namespace lldb_private
540 
541 #endif // LLDB_CORE_DEBUGGER_H
lldb_private::Debugger::SettingsTerminate
static void SettingsTerminate()
Definition: Debugger.cpp:512
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:1023
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::Debugger::GetIOHandlerCommandPrefix
const char * GetIOHandlerCommandPrefix()
Definition: Debugger.cpp:1038
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:985
lldb-private-types.h
llvm
Definition: Debugger.h:49
lldb_private::Debugger::SetCloseInputOnEOF
void SetCloseInputOnEOF(bool b)
Definition: Debugger.cpp:808
lldb::ScriptLanguage
ScriptLanguage
Script interpreter types.
Definition: lldb-enumerations.h:216
lldb_private::Debugger::GetDisassemblyLineCount
uint32_t GetDisassemblyLineCount() const
Definition: Debugger.cpp:431
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:476
lldb_private::Debugger::GetSelectedExecutionContext
ExecutionContext GetSelectedExecutionContext()
Definition: Debugger.cpp:929
lldb_private::Debugger::AdoptTopIOHandlerFilesIfInvalid
void AdoptTopIOHandlerFilesIfInvalid(lldb::FileSP &in, lldb::StreamFileSP &out, lldb::StreamFileSP &err)
Definition: Debugger.cpp:1055
lldb_private::Debugger::SetPropertyValue
Status SetPropertyValue(const ExecutionContext *exe_ctx, VarSetOperationType op, llvm::StringRef property_path, llvm::StringRef value) override
Definition: Debugger.cpp:186
lldb_private::Debugger::GetHighlightSource
bool GetHighlightSource() const
Definition: Debugger.cpp:385
lldb_private::Event
Definition: Event.h:180
IOHandler.h
lldb_private::Debugger::GetAutoConfirm
bool GetAutoConfirm() const
Definition: Debugger.cpp:250
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:942
lldb_private::Debugger::operator=
const Debugger & operator=(const Debugger &)=delete
lldb_private::Debugger::GetCommandInterpreter
CommandInterpreter & GetCommandInterpreter()
Definition: Debugger.h:199
lldb_private::Debugger::HandleThreadEvent
void HandleThreadEvent(const lldb::EventSP &event_sp)
Definition: Debugger.cpp:1537
lldb_private::Debugger::RunREPL
Status RunREPL(lldb::LanguageType language, const char *repl_options)
Definition: Debugger.cpp:1752
lldb_private::Debugger::GetDebuggerAtIndex
static lldb::DebuggerSP GetDebuggerAtIndex(size_t index)
Definition: Debugger.cpp:1166
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:522
lldb_private::Debugger::SetPrompt
void SetPrompt(llvm::StringRef p)
Definition: Debugger.cpp:289
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:390
lldb_private::Debugger::Debugger
Debugger(lldb::LogOutputCallback m_log_callback, void *baton)
Definition: Debugger.cpp:690
lldb_private::UserID
Definition: UserID.h:31
lldb_private::Debugger::SetOutputFile
void SetOutputFile(lldb::FileSP file)
Definition: Debugger.cpp:911
lldb_private::Debugger::g_load_plugin_callback
static LoadPluginCallbackType g_load_plugin_callback
Definition: Debugger.h:514
lldb_private::Debugger::GetStopShowColumnAnsiSuffix
llvm::StringRef GetStopShowColumnAnsiSuffix() const
Definition: Debugger.cpp:402
lldb_private::Debugger::GetUseSourceCache
bool GetUseSourceCache() const
Definition: Debugger.cpp:371
lldb_private::Process
Definition: Process.h:341
lldb_private::Debugger::SetInputFile
Status SetInputFile(lldb::FileSP file)
lldb_private::EventData
Definition: Event.h:36
lldb_private::Debugger::GetPrintDecls
bool GetPrintDecls() const
Definition: Debugger.cpp:457
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:1050
lldb_private::Debugger::StopEventHandlerThread
void StopEventHandlerThread()
Definition: Debugger.cpp:1696
lldb_private::Debugger::StartEventHandlerThread
bool StartEventHandlerThread()
Definition: Debugger.cpp:1656
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb_private::Debugger::RunIOHandlers
void RunIOHandlers()
Definition: Debugger.cpp:960
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:1713
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:602
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:452
lldb_private::Debugger::GetOutputStreamSP
lldb::StreamFileSP GetOutputStreamSP()
Definition: Debugger.h:163
lldb_private::Debugger::GetTopIOHandlerControlSequence
ConstString GetTopIOHandlerControlSequence(char ch)
Definition: Debugger.cpp:1034
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:1553
lldb_private::Debugger::ProgressEventData::GetFlavor
ConstString GetFlavor() const override
Definition: Debugger.cpp:1250
lldb_private::Debugger::GetScriptLanguage
lldb::ScriptLanguage GetScriptLanguage() const
Definition: Debugger.cpp:315
lldb_private::Debugger::eStopDisassemblyTypeNever
@ eStopDisassemblyTypeNever
Definition: Debugger.h:281
lldb_private::Debugger::m_input_recorder
repro::DataRecorder * m_input_recorder
Used for shadowing the input file when capturing a reproducer.
Definition: Debugger.h:480
lldb_private::Debugger::GetUseExternalEditor
bool GetUseExternalEditor() const
Definition: Debugger.cpp:341
lldb-private-enumerations.h
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::Target
Definition: Target.h:451
lldb_private::Debugger::GetScriptInterpreter
ScriptInterpreter * GetScriptInterpreter(bool can_create=true, llvm::Optional< lldb::ScriptLanguage > language={})
Definition: Debugger.cpp:1364
lldb_private::Debugger::GetListener
lldb::ListenerSP GetListener()
Definition: Debugger.h:208
lldb_private::Debugger::m_io_handler_thread
HostThread m_io_handler_thread
Definition: Debugger.h:518
lldb_private::Debugger::GetStopDisassemblyMaxSize
uint32_t GetStopDisassemblyMaxSize() const
Definition: Debugger.cpp:271
lldb_private::Debugger::DefaultEventHandler
void DefaultEventHandler()
Definition: Debugger.cpp:1563
lldb_private::Debugger::m_log_streams
llvm::StringMap< std::weak_ptr< llvm::raw_ostream > > m_log_streams
Definition: Debugger.h:511
lldb_private::Debugger::GetUseAutosuggestion
bool GetUseAutosuggestion() const
Definition: Debugger.cpp:365
lldb_private::Debugger::m_loaded_plugins
LoadedPluginsList m_loaded_plugins
Definition: Debugger.h:516
lldb_private::Debugger::SetErrorFile
void SetErrorFile(lldb::FileSP file)
Definition: Debugger.cpp:916
lldb_private::Debugger::ClearIOHandlers
void ClearIOHandlers()
Definition: Debugger.cpp:949
Broadcaster.h
lldb_private::Debugger::GetStopShowColumn
lldb::StopShowColumn GetStopShowColumn() const
Definition: Debugger.cpp:391
lldb_private::Debugger::SaveInputTerminalState
void SaveInputTerminalState()
Definition: Debugger.cpp:921
lldb_private::Debugger::RemoveIOHandler
bool RemoveIOHandler(const lldb::IOHandlerSP &reader_sp)
Remove the given IO handler if it's currently active.
Definition: Debugger.cpp:1046
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:509
lldb_private::Debugger::m_listener_sp
lldb::ListenerSP m_listener_sp
Definition: Debugger.h:492
lldb_private::Debugger::eStopDisassemblyTypeAlways
@ eStopDisassemblyTypeAlways
Definition: Debugger.h:284
lldb_private::Debugger::m_broadcaster
Broadcaster m_broadcaster
Public Debugger event broadcaster.
Definition: Debugger.h:520
Platform.h
lldb_private::FileSpec
Definition: FileSpec.h:56
lldb_private::Debugger::GetDisassemblyFormat
const FormatEntity::Entry * GetDisassemblyFormat() const
Definition: Debugger.cpp:256
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:377
lldb_private::Debugger::SetLoggingCallback
void SetLoggingCallback(lldb::LogOutputCallback log_callback, void *baton)
Definition: Debugger.cpp:1236
lldb_private::Debugger::IsHandlingEvents
bool IsHandlingEvents() const
Definition: Debugger.h:382
lldb_private::Debugger::GetStaticBroadcasterClass
static ConstString GetStaticBroadcasterClass()
Definition: Debugger.cpp:685
TargetList.h
lldb_private::Debugger::m_script_interpreter_mutex
std::recursive_mutex m_script_interpreter_mutex
Definition: Debugger.h:504
lldb_private::Debugger::ProgressEventData::Dump
void Dump(Stream *s) const override
Definition: Debugger.cpp:1254
HostThread.h
lldb_private::Debugger::m_source_manager_up
std::unique_ptr< SourceManager > m_source_manager_up
Definition: Debugger.h:493
lldb_private::Debugger::GetAutoIndent
bool GetAutoIndent() const
Definition: Debugger.cpp:447
lldb_private::Debugger::DispatchInputInterrupt
void DispatchInputInterrupt()
Definition: Debugger.cpp:935
lldb_private::Debugger::GetOutputFile
File & GetOutputFile()
Definition: Debugger.h:169
lldb_private::Debugger::SettingsInitialize
static void SettingsInitialize()
Definition: Debugger.cpp:510
lldb_private::Debugger::GetStopShowColumnAnsiPrefix
llvm::StringRef GetStopShowColumnAnsiPrefix() const
Definition: Debugger.cpp:397
lldb_private::Debugger::GetThreadFormat
const FormatEntity::Entry * GetThreadFormat() const
Definition: Debugger.cpp:305
lldb_private::Debugger::m_instance_name
ConstString m_instance_name
Definition: Debugger.h:513
lldb_private::Debugger::GetAsyncOutputStream
lldb::StreamSP GetAsyncOutputStream()
Definition: Debugger.cpp:1150
lldb_private::Debugger::GetEscapeNonPrintables
bool GetEscapeNonPrintables() const
Definition: Debugger.cpp:442
lldb_private::Debugger::eStopDisassemblyTypeNoDebugInfo
@ eStopDisassemblyTypeNoDebugInfo
Definition: Debugger.h:282
lldb_private::Debugger::GetAsyncErrorStream
lldb::StreamSP GetAsyncErrorStream()
Definition: Debugger.cpp:1154
lldb_private::Debugger::GetTerminalWidth
uint32_t GetTerminalWidth() const
Definition: Debugger.cpp:327
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:1313
lldb_private::Debugger::Initialize
static void Initialize(LoadPluginCallbackType load_plugin_callback)
Definition: Debugger.cpp:487
lldb_private::ConstString
Definition: ConstString.h:40
lldb-enumerations.h
lldb_private::Debugger::GetAutoOneLineSummaries
bool GetAutoOneLineSummaries() const
Definition: Debugger.cpp:437
lldb_private::Progress
A Progress indicator helper class.
Definition: Progress.h:55
lldb_private::Debugger::GetSourceManager
SourceManager & GetSourceManager()
Definition: Debugger.cpp:1380
lldb_private::Debugger::HandleProcessEvent
void HandleProcessEvent(const lldb::EventSP &event_sp)
Definition: Debugger.cpp:1454
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:477
lldb_private::File
Definition: File.h:35
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:1555
lldb_private::Debugger::PopIOHandler
bool PopIOHandler(const lldb::IOHandlerSP &reader_sp)
Definition: Debugger.cpp:1123
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb::thread_arg_t
void * thread_arg_t
Definition: lldb-types.h:61
lldb_private::PlatformList
Definition: Platform.h:959
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:497
lldb_private::Debugger::SetScriptLanguage
bool SetScriptLanguage(lldb::ScriptLanguage script_lang)
Definition: Debugger.cpp:321
lldb_private::Debugger::FlushProcessOutput
void FlushProcessOutput(Process &process, bool flush_stdout, bool flush_stderr)
Definition: Debugger.cpp:1434
lldb_private::Debugger::StopDisassemblyType
StopDisassemblyType
Definition: Debugger.h:280
lldb_private::Debugger::m_io_handler_stack
IOHandlerStack m_io_handler_stack
Definition: Debugger.h:508
lldb_private::Debugger::GetInputRecorder
repro::DataRecorder * GetInputRecorder()
Definition: Debugger.cpp:820
UserID.h
lldb_private::Debugger::JoinIOHandlerThread
void JoinIOHandlerThread()
Definition: Debugger.cpp:1736
lldb_private::Debugger::GetTargetList
TargetList & GetTargetList()
Get accessor for the target list.
Definition: Debugger.h:229
lldb_private::Debugger::m_broadcaster_manager_sp
lldb::BroadcasterManagerSP m_broadcaster_manager_sp
Definition: Debugger.h:482
lldb-types.h
lldb_private::Debugger::m_terminal_state
TerminalState m_terminal_state
Definition: Debugger.h:488
lldb_private::Debugger::ProgressEventData::GetID
uint64_t GetID() const
Definition: Debugger.h:104
lldb_private::Debugger::GetIOHandlerHelpPrologue
const char * GetIOHandlerHelpPrologue()
Definition: Debugger.cpp:1042
StreamFile.h
lldb_private::Debugger::eStopDisassemblyTypeNoSource
@ eStopDisassemblyTypeNoSource
Definition: Debugger.h:283
lldb_private::Debugger::ProgressEventData::GetFlavorString
static ConstString GetFlavorString()
Definition: Debugger.cpp:1245
lldb_private::Debugger::ProgressEventData::GetEventDataFromEvent
static const ProgressEventData * GetEventDataFromEvent(const Event *event_ptr)
Definition: Debugger.cpp:1267
lldb_private::Debugger::GetStopDisassemblyDisplay
StopDisassemblyType GetStopDisassemblyDisplay() const
Definition: Debugger.cpp:424
lldb_private::Debugger::PrintAsync
void PrintAsync(const char *s, size_t len, bool is_stdout)
Definition: Debugger.cpp:1028
lldb_private::Debugger::Clear
void Clear()
Definition: Debugger.cpp:771
lldb_private::Debugger::GetNumDebuggers
static size_t GetNumDebuggers()
Definition: Debugger.cpp:1158
lldb_private::Debugger::IsTopIOHandler
bool IsTopIOHandler(const lldb::IOHandlerSP &reader_sp)
Definition: Debugger.cpp:1019
lldb_private::Debugger::FindDebuggerWithInstanceName
static lldb::DebuggerSP FindDebuggerWithInstanceName(ConstString instance_name)
Definition: Debugger.cpp:642
lldb_private::IOHandlerStack
Definition: IOHandler.h:470
lldb_private::Status
Definition: Status.h:44
lldb_private::Debugger::InstanceInitialize
void InstanceInitialize()
Definition: Debugger.cpp:576
lldb_private::Debugger::m_event_handler_thread
HostThread m_event_handler_thread
Definition: Debugger.h:517
lldb_private::Debugger::SetTerminalWidth
bool SetTerminalWidth(uint32_t term_width)
Definition: Debugger.cpp:333
lldb_private::Debugger::m_sync_broadcaster
Broadcaster m_sync_broadcaster
Private debugger synchronization.
Definition: Debugger.h:519
lldb_private::Debugger::GetNotifyVoid
bool GetNotifyVoid() const
Definition: Debugger.cpp:277
lldb_private::Debugger::PushIOHandler
void PushIOHandler(const lldb::IOHandlerSP &reader_sp, bool cancel_top_handler=true)
Definition: Debugger.cpp:1096
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:467
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:412
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:657
lldb_private::Debugger::GetPlatformList
PlatformList & GetPlatformList()
Definition: Debugger.h:231
lldb_private::Debugger::GetCloseInputOnEOF
bool GetCloseInputOnEOF() const
Definition: Debugger.cpp:803
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:514
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:1178
lldb_private::FormatEntity::Entry
Definition: FormatEntity.h:40
lldb_private::Debugger::FindTargetWithProcess
static lldb::TargetSP FindTargetWithProcess(Process *process)
Definition: Debugger.cpp:671
lldb_private::Debugger::GetInstanceName
ConstString GetInstanceName()
Definition: Debugger.h:370
lldb_private::Debugger::m_log_callback_stream_sp
std::shared_ptr< llvm::raw_ostream > m_log_callback_stream_sp
Definition: Debugger.h:512
FormatEntity.h
lldb_private::Debugger::SetTabSize
bool SetTabSize(uint32_t tab_size)
Definition: Debugger.cpp:473
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:1651
lldb_private::IOHandler::Type
Type
Definition: IOHandler.h:48
lldb_private::Debugger::~Debugger
~Debugger() override
Definition: Debugger.cpp:769
lldb_private::ScriptInterpreter
Definition: ScriptInterpreter.h:126
lldb_private::Debugger::m_output_flush_mutex
std::mutex m_output_flush_mutex
Definition: Debugger.h:464
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:1289
lldb_private::Debugger::HandleBreakpointEvent
void HandleBreakpointEvent(const lldb::EventSP &event_sp)
Definition: Debugger.cpp:1387
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:352
Terminal.h
lldb_private::Debugger::LoadedPluginsList
std::vector< llvm::sys::DynamicLibrary > LoadedPluginsList
Definition: Debugger.h:515
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:347
lldb_private::Debugger::GetStopShowLineMarkerAnsiPrefix
llvm::StringRef GetStopShowLineMarkerAnsiPrefix() const
Definition: Debugger.cpp:407
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:216
lldb_private::Debugger::GetFrameFormatUnique
const FormatEntity::Entry * GetFrameFormatUnique() const
Definition: Debugger.cpp:266
lldb_private::Debugger::RestoreInputTerminalState
void RestoreInputTerminalState()
Definition: Debugger.cpp:927
lldb_private::Debugger::GetAsyncExecution
bool GetAsyncExecution()
Definition: Debugger.cpp:812
lldb_private::Debugger::GetThreadStopFormat
const FormatEntity::Entry * GetThreadStopFormat() const
Definition: Debugger.cpp:310
lldb_private::Debugger::m_target_list
TargetList m_target_list
Definition: Debugger.h:489
lldb_private::Debugger::Terminate
static void Terminate()
Definition: Debugger.cpp:495
FileSpec.h
lldb_private::Debugger::m_platform_list
PlatformList m_platform_list
Definition: Debugger.h:491
lldb_private::Debugger::m_input_file_sp
lldb::FileSP m_input_file_sp
Definition: Debugger.h:475
lldb_private::Debugger::StopIOHandlerThread
void StopIOHandlerThread()
Definition: Debugger.cpp:1729
lldb_private::Debugger::SetAsyncExecution
void SetAsyncExecution(bool async)
Definition: Debugger.cpp:816
ConstString.h
lldb_private::Debugger::GetReproducerPath
llvm::StringRef GetReproducerPath() const
Definition: Debugger.cpp:300
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:1194
lldb_private::Debugger::eBroadcastBitEventThreadIsListening
@ eBroadcastBitEventThreadIsListening
Definition: Debugger.h:527
lldb_private::Debugger::GetStopSourceLineCount
uint32_t GetStopSourceLineCount(bool before) const
Definition: Debugger.cpp:417
lldb_private::TargetList::GetSelectedTarget
lldb::TargetSP GetSelectedTarget()
Definition: TargetList.cpp:576
lldb_private::Debugger::GetBroadcasterManager
lldb::BroadcasterManagerSP GetBroadcasterManager()
Definition: Debugger.h:392
lldb_private::Debugger::SetUseColor
bool SetUseColor(bool use_color)
Definition: Debugger.cpp:358
lldb_private::Debugger::GetSourceFileCache
SourceManager::SourceFileCache & GetSourceFileCache()
Definition: Debugger.h:468
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:462
lldb_private::Debugger::m_command_interpreter_up
std::unique_ptr< CommandInterpreter > m_command_interpreter_up
Definition: Debugger.h:502
lldb_private::Debugger::m_dummy_target_sp
lldb::TargetSP m_dummy_target_sp
Definition: Debugger.h:523
lldb_private::Broadcaster
Definition: Broadcaster.h:242
lldb_private::Debugger::m_forward_listener_sp
lldb::ListenerSP m_forward_listener_sp
Definition: Debugger.h:521
lldb_private::Debugger::GetPrompt
llvm::StringRef GetPrompt() const
Definition: Debugger.cpp:283
lldb_private::Debugger::CancelForwardEvents
void CancelForwardEvents(const lldb::ListenerSP &listener_sp)
Definition: Debugger.cpp:1559
lldb_private::Debugger::GetErrorStream
StreamFile & GetErrorStream()
Definition: Debugger.h:175
lldb_private::Debugger::Destroy
static void Destroy(lldb::DebuggerSP &debugger_sp)
Definition: Debugger.cpp:613
lldb_private::Debugger::HasIOHandlerThread
bool HasIOHandlerThread()
Definition: Debugger.cpp:1711
lldb_private::Debugger::IOHandlerThread
static lldb::thread_result_t IOHandlerThread(lldb::thread_arg_t arg)
Definition: Debugger.cpp:1704
ExecutionContext.h
lldb_private::Debugger::GetSelectedOrDummyTarget
Target & GetSelectedOrDummyTarget(bool prefer_dummy=false)
Definition: Debugger.cpp:1744
lldb_private::SourceManager
Definition: SourceManager.h:31
lldb_private::Debugger::SetInputString
Status SetInputString(const char *data)
Definition: Debugger.cpp:831
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:506
lldb_private::Debugger::GetFrameFormat
const FormatEntity::Entry * GetFrameFormat() const
Definition: Debugger.cpp:261