LLDB  mainline
Target.h
Go to the documentation of this file.
1 //===-- Target.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_TARGET_TARGET_H
10 #define LLDB_TARGET_TARGET_H
11 
12 #include <list>
13 #include <map>
14 #include <memory>
15 #include <string>
16 #include <vector>
17 
21 #include "lldb/Core/Architecture.h"
22 #include "lldb/Core/Disassembler.h"
23 #include "lldb/Core/ModuleList.h"
28 #include "lldb/Symbol/TypeSystem.h"
32 #include "lldb/Target/Statistics.h"
33 #include "lldb/Target/ThreadSpec.h"
34 #include "lldb/Utility/ArchSpec.h"
37 #include "lldb/Utility/Timeout.h"
38 #include "lldb/lldb-public.h"
39 
40 namespace lldb_private {
41 
42 OptionEnumValues GetDynamicValueTypes();
43 
48 };
49 
54 };
55 
60 };
61 
66 };
67 
72 };
73 
75 public:
77 };
78 
79 class TargetProperties : public Properties {
80 public:
81  TargetProperties(Target *target);
82 
83  ~TargetProperties() override;
84 
86 
87  void SetDefaultArchitecture(const ArchSpec &arch);
88 
89  bool GetMoveToNearestCode() const;
90 
92 
94 
95  bool GetPreloadSymbols() const;
96 
97  void SetPreloadSymbols(bool b);
98 
99  bool GetDisableASLR() const;
100 
101  void SetDisableASLR(bool b);
102 
103  bool GetInheritTCC() const;
104 
105  void SetInheritTCC(bool b);
106 
107  bool GetDetachOnError() const;
108 
109  void SetDetachOnError(bool b);
110 
111  bool GetDisableSTDIO() const;
112 
113  void SetDisableSTDIO(bool b);
114 
115  const char *GetDisassemblyFlavor() const;
116 
118 
119  llvm::StringRef GetArg0() const;
120 
121  void SetArg0(llvm::StringRef arg);
122 
123  bool GetRunArguments(Args &args) const;
124 
125  void SetRunArguments(const Args &args);
126 
127  // Get the whole environment including the platform inherited environment and
128  // the target specific environment, excluding the unset environment variables.
129  Environment GetEnvironment() const;
130  // Get the platform inherited environment, excluding the unset environment
131  // variables.
133  // Get the target specific environment only, without the platform inherited
134  // environment.
136  // Set the target specific environment.
137  void SetEnvironment(Environment env);
138 
139  bool GetSkipPrologue() const;
140 
142 
143  FileSpecList GetExecutableSearchPaths();
144 
146 
147  FileSpecList GetDebugFileSearchPaths();
148 
149  FileSpecList GetClangModuleSearchPaths();
150 
151  bool GetEnableAutoImportClangModules() const;
152 
154 
155  bool GetEnableAutoApplyFixIts() const;
156 
157  uint64_t GetNumberOfRetriesWithFixits() const;
158 
159  bool GetEnableNotifyAboutFixIts() const;
160 
161  bool GetEnableSaveObjects() const;
162 
163  bool GetEnableSyntheticValue() const;
164 
166 
168 
170 
172 
176 
177  void SetStandardInputPath(llvm::StringRef path);
178  void SetStandardOutputPath(llvm::StringRef path);
179  void SetStandardErrorPath(llvm::StringRef path);
180 
181  void SetStandardInputPath(const char *path) = delete;
182  void SetStandardOutputPath(const char *path) = delete;
183  void SetStandardErrorPath(const char *path) = delete;
184 
186 
188 
189  llvm::StringRef GetExpressionPrefixContents();
190 
191  uint64_t GetExprErrorLimit() const;
192 
193  bool GetUseHexImmediates() const;
194 
195  bool GetUseFastStepping() const;
196 
198 
200 
202 
204 
206 
207  bool GetUserSpecifiedTrapHandlerNames(Args &args) const;
208 
209  void SetUserSpecifiedTrapHandlerNames(const Args &args);
210 
211  bool GetDisplayRuntimeSupportValues() const;
212 
213  void SetDisplayRuntimeSupportValues(bool b);
214 
215  bool GetDisplayRecognizedArguments() const;
216 
217  void SetDisplayRecognizedArguments(bool b);
218 
220 
221  void SetProcessLaunchInfo(const ProcessLaunchInfo &launch_info);
222 
223  bool GetInjectLocalVariables(ExecutionContext *exe_ctx) const;
224 
225  void SetInjectLocalVariables(ExecutionContext *exe_ctx, bool b);
226 
227  void SetRequireHardwareBreakpoints(bool b);
228 
229  bool GetRequireHardwareBreakpoints() const;
230 
231  bool GetAutoInstallMainExecutable() const;
232 
234 
235  void SetDebugUtilityExpression(bool debug);
236 
237  bool GetDebugUtilityExpression() const;
238 
239 private:
240  // Callbacks for m_launch_info.
251 
253 
254  // Member variables.
256  std::unique_ptr<TargetExperimentalProperties> m_experimental_properties_up;
258 };
259 
261 public:
262 // MSVC has a bug here that reports C4268: 'const' static/global data
263 // initialized with compiler generated default constructor fills the object
264 // with zeros. Confirmed that MSVC is *not* zero-initializing, it's just a
265 // bogus warning.
266 #if defined(_MSC_VER)
267 #pragma warning(push)
268 #pragma warning(disable : 4268)
269 #endif
270  static constexpr std::chrono::milliseconds default_timeout{500};
271 #if defined(_MSC_VER)
272 #pragma warning(pop)
273 #endif
274 
277 
278  EvaluateExpressionOptions() = default;
279 
281 
283  m_execution_policy = policy;
284  }
285 
287 
288  void SetLanguage(lldb::LanguageType language) { m_language = language; }
289 
290  bool DoesCoerceToId() const { return m_coerce_to_id; }
291 
292  const char *GetPrefix() const {
293  return (m_prefix.empty() ? nullptr : m_prefix.c_str());
294  }
295 
296  void SetPrefix(const char *prefix) {
297  if (prefix && prefix[0])
298  m_prefix = prefix;
299  else
300  m_prefix.clear();
301  }
302 
303  void SetCoerceToId(bool coerce = true) { m_coerce_to_id = coerce; }
304 
305  bool DoesUnwindOnError() const { return m_unwind_on_error; }
306 
307  void SetUnwindOnError(bool unwind = false) { m_unwind_on_error = unwind; }
308 
310 
311  void SetIgnoreBreakpoints(bool ignore = false) {
312  m_ignore_breakpoints = ignore;
313  }
314 
315  bool DoesKeepInMemory() const { return m_keep_in_memory; }
316 
317  void SetKeepInMemory(bool keep = true) { m_keep_in_memory = keep; }
318 
320 
321  void
323  m_use_dynamic = dynamic;
324  }
325 
326  const Timeout<std::micro> &GetTimeout() const { return m_timeout; }
327 
328  void SetTimeout(const Timeout<std::micro> &timeout) { m_timeout = timeout; }
329 
331  return m_one_thread_timeout;
332  }
333 
335  m_one_thread_timeout = timeout;
336  }
337 
338  bool GetTryAllThreads() const { return m_try_others; }
339 
340  void SetTryAllThreads(bool try_others = true) { m_try_others = try_others; }
341 
342  bool GetStopOthers() const { return m_stop_others; }
343 
344  void SetStopOthers(bool stop_others = true) { m_stop_others = stop_others; }
345 
346  bool GetDebug() const { return m_debug; }
347 
348  void SetDebug(bool b) {
349  m_debug = b;
350  if (m_debug)
351  m_generate_debug_info = true;
352  }
353 
355 
357 
358  bool GetColorizeErrors() const { return m_ansi_color_errors; }
359 
361 
362  bool GetTrapExceptions() const { return m_trap_exceptions; }
363 
364  void SetTrapExceptions(bool b) { m_trap_exceptions = b; }
365 
366  bool GetREPLEnabled() const { return m_repl; }
367 
368  void SetREPLEnabled(bool b) { m_repl = b; }
369 
370  void SetCancelCallback(lldb::ExpressionCancelCallback callback, void *baton) {
371  m_cancel_callback_baton = baton;
372  m_cancel_callback = callback;
373  }
374 
376  return ((m_cancel_callback != nullptr)
378  : false);
379  }
380 
381  // Allows the expression contents to be remapped to point to the specified
382  // file and line using #line directives.
383  void SetPoundLine(const char *path, uint32_t line) const {
384  if (path && path[0]) {
385  m_pound_line_file = path;
386  m_pound_line_line = line;
387  } else {
388  m_pound_line_file.clear();
389  m_pound_line_line = 0;
390  }
391  }
392 
393  const char *GetPoundLineFilePath() const {
394  return (m_pound_line_file.empty() ? nullptr : m_pound_line_file.c_str());
395  }
396 
398 
400 
401  bool GetResultIsInternal() const { return m_result_is_internal; }
402 
404 
405  bool GetAutoApplyFixIts() const { return m_auto_apply_fixits; }
406 
407  void SetRetriesWithFixIts(uint64_t number_of_retries) {
408  m_retries_with_fixits = number_of_retries;
409  }
410 
411  uint64_t GetRetriesWithFixIts() const { return m_retries_with_fixits; }
412 
414 
416 
417 private:
421  bool m_coerce_to_id = false;
422  bool m_unwind_on_error = true;
423  bool m_ignore_breakpoints = false;
424  bool m_keep_in_memory = false;
425  bool m_try_others = true;
426  bool m_stop_others = true;
427  bool m_debug = false;
428  bool m_trap_exceptions = true;
429  bool m_repl = false;
430  bool m_generate_debug_info = false;
431  bool m_ansi_color_errors = false;
432  bool m_result_is_internal = false;
433  bool m_auto_apply_fixits = true;
434  uint64_t m_retries_with_fixits = 1;
435  /// True if the executed code should be treated as utility code that is only
436  /// used by LLDB internally.
438 
443  void *m_cancel_callback_baton = nullptr;
444  // If m_pound_line_file is not empty and m_pound_line_line is non-zero, use
445  // #line %u "%s" before the expression content to remap where the source
446  // originates
449 };
450 
451 // Target
452 class Target : public std::enable_shared_from_this<Target>,
453  public TargetProperties,
454  public Broadcaster,
455  public ExecutionContextScope,
456  public ModuleList::Notifier {
457 public:
458  friend class TargetList;
459  friend class Debugger;
460 
461  /// Broadcaster event bits definitions.
462  enum {
468  };
469 
470  // These two functions fill out the Broadcaster interface:
471 
473 
474  ConstString &GetBroadcasterClass() const override {
475  return GetStaticBroadcasterClass();
476  }
477 
478  // This event data class is for use by the TargetList to broadcast new target
479  // notifications.
480  class TargetEventData : public EventData {
481  public:
482  TargetEventData(const lldb::TargetSP &target_sp);
483 
484  TargetEventData(const lldb::TargetSP &target_sp,
485  const ModuleList &module_list);
486 
487  ~TargetEventData() override;
488 
489  static ConstString GetFlavorString();
490 
491  ConstString GetFlavor() const override {
493  }
494 
495  void Dump(Stream *s) const override;
496 
497  static const TargetEventData *GetEventDataFromEvent(const Event *event_ptr);
498 
499  static lldb::TargetSP GetTargetFromEvent(const Event *event_ptr);
500 
501  static ModuleList GetModuleListFromEvent(const Event *event_ptr);
502 
503  const lldb::TargetSP &GetTarget() const { return m_target_sp; }
504 
505  const ModuleList &GetModuleList() const { return m_module_list; }
506 
507  private:
508  lldb::TargetSP m_target_sp;
510 
511  TargetEventData(const TargetEventData &) = delete;
512  const TargetEventData &operator=(const TargetEventData &) = delete;
513  };
514 
515  ~Target() override;
516 
517  static void SettingsInitialize();
518 
519  static void SettingsTerminate();
520 
521  static FileSpecList GetDefaultExecutableSearchPaths();
522 
523  static FileSpecList GetDefaultDebugFileSearchPaths();
524 
526 
527  static void SetDefaultArchitecture(const ArchSpec &arch);
528 
529  bool IsDummyTarget() const { return m_is_dummy_target; }
530 
531  /// Find a binary on the system and return its Module,
532  /// or return an existing Module that is already in the Target.
533  ///
534  /// Given a ModuleSpec, find a binary satisifying that specification,
535  /// or identify a matching Module already present in the Target,
536  /// and return a shared pointer to it.
537  ///
538  /// \param[in] module_spec
539  /// The criteria that must be matched for the binary being loaded.
540  /// e.g. UUID, architecture, file path.
541  ///
542  /// \param[in] notify
543  /// If notify is true, and the Module is new to this Target,
544  /// Target::ModulesDidLoad will be called.
545  /// If notify is false, it is assumed that the caller is adding
546  /// multiple Modules and will call ModulesDidLoad with the
547  /// full list at the end.
548  /// ModulesDidLoad must be called when a Module/Modules have
549  /// been added to the target, one way or the other.
550  ///
551  /// \param[out] error_ptr
552  /// Optional argument, pointing to a Status object to fill in
553  /// with any results / messages while attempting to find/load
554  /// this binary. Many callers will be internal functions that
555  /// will handle / summarize the failures in a custom way and
556  /// don't use these messages.
557  ///
558  /// \return
559  /// An empty ModuleSP will be returned if no matching file
560  /// was found. If error_ptr was non-nullptr, an error message
561  /// will likely be provided.
562  lldb::ModuleSP GetOrCreateModule(const ModuleSpec &module_spec, bool notify,
563  Status *error_ptr = nullptr);
564 
565  // Settings accessors
566 
568 
569  std::recursive_mutex &GetAPIMutex();
570 
571  void DeleteCurrentProcess();
572 
573  void CleanupProcess();
574 
575  /// Dump a description of this object to a Stream.
576  ///
577  /// Dump a description of the contents of this object to the
578  /// supplied stream \a s. The dumped content will be only what has
579  /// been loaded or parsed up to this point at which this function
580  /// is called, so this is a good way to see what has been parsed
581  /// in a target.
582  ///
583  /// \param[in] s
584  /// The stream to which to dump the object description.
585  void Dump(Stream *s, lldb::DescriptionLevel description_level);
586 
587  // If listener_sp is null, the listener of the owning Debugger object will be
588  // used.
589  const lldb::ProcessSP &CreateProcess(lldb::ListenerSP listener_sp,
590  llvm::StringRef plugin_name,
591  const FileSpec *crash_file,
592  bool can_connect);
593 
594  const lldb::ProcessSP &GetProcessSP() const;
595 
596  bool IsValid() { return m_valid; }
597 
598  void Destroy();
599 
600  Status Launch(ProcessLaunchInfo &launch_info,
601  Stream *stream); // Optional stream to receive first stop info
602 
603  Status Attach(ProcessAttachInfo &attach_info,
604  Stream *stream); // Optional stream to receive first stop info
605 
606  // This part handles the breakpoints.
607 
608  BreakpointList &GetBreakpointList(bool internal = false);
609 
610  const BreakpointList &GetBreakpointList(bool internal = false) const;
611 
612  lldb::BreakpointSP GetLastCreatedBreakpoint() {
614  }
615 
616  lldb::BreakpointSP GetBreakpointByID(lldb::break_id_t break_id);
617 
618  // Use this to create a file and line breakpoint to a given module or all
619  // module it is nullptr
620  lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules,
621  const FileSpec &file, uint32_t line_no,
622  uint32_t column, lldb::addr_t offset,
623  LazyBool check_inlines,
624  LazyBool skip_prologue, bool internal,
625  bool request_hardware,
626  LazyBool move_to_nearest_code);
627 
628  // Use this to create breakpoint that matches regex against the source lines
629  // in files given in source_file_list: If function_names is non-empty, also
630  // filter by function after the matches are made.
631  lldb::BreakpointSP CreateSourceRegexBreakpoint(
632  const FileSpecList *containingModules,
633  const FileSpecList *source_file_list,
634  const std::unordered_set<std::string> &function_names,
635  RegularExpression source_regex, bool internal, bool request_hardware,
636  LazyBool move_to_nearest_code);
637 
638  // Use this to create a breakpoint from a load address
639  lldb::BreakpointSP CreateBreakpoint(lldb::addr_t load_addr, bool internal,
640  bool request_hardware);
641 
642  // Use this to create a breakpoint from a load address and a module file spec
643  lldb::BreakpointSP CreateAddressInModuleBreakpoint(lldb::addr_t file_addr,
644  bool internal,
645  const FileSpec *file_spec,
646  bool request_hardware);
647 
648  // Use this to create Address breakpoints:
649  lldb::BreakpointSP CreateBreakpoint(const Address &addr, bool internal,
650  bool request_hardware);
651 
652  // Use this to create a function breakpoint by regexp in
653  // containingModule/containingSourceFiles, or all modules if it is nullptr
654  // When "skip_prologue is set to eLazyBoolCalculate, we use the current
655  // target setting, else we use the values passed in
656  lldb::BreakpointSP CreateFuncRegexBreakpoint(
657  const FileSpecList *containingModules,
658  const FileSpecList *containingSourceFiles, RegularExpression func_regexp,
659  lldb::LanguageType requested_language, LazyBool skip_prologue,
660  bool internal, bool request_hardware);
661 
662  // Use this to create a function breakpoint by name in containingModule, or
663  // all modules if it is nullptr When "skip_prologue is set to
664  // eLazyBoolCalculate, we use the current target setting, else we use the
665  // values passed in. func_name_type_mask is or'ed values from the
666  // FunctionNameType enum.
667  lldb::BreakpointSP CreateBreakpoint(
668  const FileSpecList *containingModules,
669  const FileSpecList *containingSourceFiles, const char *func_name,
670  lldb::FunctionNameType func_name_type_mask, lldb::LanguageType language,
671  lldb::addr_t offset, LazyBool skip_prologue, bool internal,
672  bool request_hardware);
673 
674  lldb::BreakpointSP
675  CreateExceptionBreakpoint(enum lldb::LanguageType language, bool catch_bp,
676  bool throw_bp, bool internal,
677  Args *additional_args = nullptr,
678  Status *additional_args_error = nullptr);
679 
680  lldb::BreakpointSP CreateScriptedBreakpoint(
681  const llvm::StringRef class_name, const FileSpecList *containingModules,
682  const FileSpecList *containingSourceFiles, bool internal,
683  bool request_hardware, StructuredData::ObjectSP extra_args_sp,
684  Status *creation_error = nullptr);
685 
686  // This is the same as the func_name breakpoint except that you can specify a
687  // vector of names. This is cheaper than a regular expression breakpoint in
688  // the case where you just want to set a breakpoint on a set of names you
689  // already know. func_name_type_mask is or'ed values from the
690  // FunctionNameType enum.
691  lldb::BreakpointSP CreateBreakpoint(
692  const FileSpecList *containingModules,
693  const FileSpecList *containingSourceFiles, const char *func_names[],
694  size_t num_names, lldb::FunctionNameType func_name_type_mask,
695  lldb::LanguageType language, lldb::addr_t offset, LazyBool skip_prologue,
696  bool internal, bool request_hardware);
697 
698  lldb::BreakpointSP
699  CreateBreakpoint(const FileSpecList *containingModules,
700  const FileSpecList *containingSourceFiles,
701  const std::vector<std::string> &func_names,
702  lldb::FunctionNameType func_name_type_mask,
703  lldb::LanguageType language, lldb::addr_t m_offset,
704  LazyBool skip_prologue, bool internal,
705  bool request_hardware);
706 
707  // Use this to create a general breakpoint:
708  lldb::BreakpointSP CreateBreakpoint(lldb::SearchFilterSP &filter_sp,
709  lldb::BreakpointResolverSP &resolver_sp,
710  bool internal, bool request_hardware,
711  bool resolve_indirect_symbols);
712 
713  // Use this to create a watchpoint:
714  lldb::WatchpointSP CreateWatchpoint(lldb::addr_t addr, size_t size,
715  const CompilerType *type, uint32_t kind,
716  Status &error);
717 
718  lldb::WatchpointSP GetLastCreatedWatchpoint() {
720  }
721 
723 
724  // Manages breakpoint names:
725  void AddNameToBreakpoint(BreakpointID &id, const char *name, Status &error);
726 
727  void AddNameToBreakpoint(lldb::BreakpointSP &bp_sp, const char *name,
728  Status &error);
729 
730  void RemoveNameFromBreakpoint(lldb::BreakpointSP &bp_sp, ConstString name);
731 
732  BreakpointName *FindBreakpointName(ConstString name, bool can_create,
733  Status &error);
734 
736 
738  const BreakpointOptions &options,
739  const BreakpointName::Permissions &permissions);
740  void ApplyNameToBreakpoints(BreakpointName &bp_name);
741 
742  // This takes ownership of the name obj passed in.
743  void AddBreakpointName(BreakpointName *bp_name);
744 
745  void GetBreakpointNames(std::vector<std::string> &names);
746 
747  // This call removes ALL breakpoints regardless of permission.
748  void RemoveAllBreakpoints(bool internal_also = false);
749 
750  // This removes all the breakpoints, but obeys the ePermDelete on them.
752 
753  void DisableAllBreakpoints(bool internal_also = false);
754 
756 
757  void EnableAllBreakpoints(bool internal_also = false);
758 
760 
762 
763  bool EnableBreakpointByID(lldb::break_id_t break_id);
764 
765  bool RemoveBreakpointByID(lldb::break_id_t break_id);
766 
767  // The flag 'end_to_end', default to true, signifies that the operation is
768  // performed end to end, for both the debugger and the debuggee.
769 
770  bool RemoveAllWatchpoints(bool end_to_end = true);
771 
772  bool DisableAllWatchpoints(bool end_to_end = true);
773 
774  bool EnableAllWatchpoints(bool end_to_end = true);
775 
777 
779 
780  bool IgnoreAllWatchpoints(uint32_t ignore_count);
781 
783 
784  bool EnableWatchpointByID(lldb::watch_id_t watch_id);
785 
786  bool RemoveWatchpointByID(lldb::watch_id_t watch_id);
787 
788  bool IgnoreWatchpointByID(lldb::watch_id_t watch_id, uint32_t ignore_count);
789 
791  const BreakpointIDList &bp_ids,
792  bool append);
793 
795  BreakpointIDList &new_bps);
796 
798  std::vector<std::string> &names,
799  BreakpointIDList &new_bps);
800 
801  /// Get \a load_addr as a callable code load address for this target
802  ///
803  /// Take \a load_addr and potentially add any address bits that are
804  /// needed to make the address callable. For ARM this can set bit
805  /// zero (if it already isn't) if \a load_addr is a thumb function.
806  /// If \a addr_class is set to AddressClass::eInvalid, then the address
807  /// adjustment will always happen. If it is set to an address class
808  /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
809  /// returned.
811  lldb::addr_t load_addr,
812  AddressClass addr_class = AddressClass::eInvalid) const;
813 
814  /// Get \a load_addr as an opcode for this target.
815  ///
816  /// Take \a load_addr and potentially strip any address bits that are
817  /// needed to make the address point to an opcode. For ARM this can
818  /// clear bit zero (if it already isn't) if \a load_addr is a
819  /// thumb function and load_addr is in code.
820  /// If \a addr_class is set to AddressClass::eInvalid, then the address
821  /// adjustment will always happen. If it is set to an address class
822  /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
823  /// returned.
826  AddressClass addr_class = AddressClass::eInvalid) const;
827 
828  // Get load_addr as breakable load address for this target. Take a addr and
829  // check if for any reason there is a better address than this to put a
830  // breakpoint on. If there is then return that address. For MIPS, if
831  // instruction at addr is a delay slot instruction then this method will find
832  // the address of its previous instruction and return that address.
834 
835  void ModulesDidLoad(ModuleList &module_list);
836 
837  void ModulesDidUnload(ModuleList &module_list, bool delete_locations);
838 
839  void SymbolsDidLoad(ModuleList &module_list);
840 
841  void ClearModules(bool delete_locations);
842 
843  /// Called as the last function in Process::DidExec().
844  ///
845  /// Process::DidExec() will clear a lot of state in the process,
846  /// then try to reload a dynamic loader plugin to discover what
847  /// binaries are currently available and then this function should
848  /// be called to allow the target to do any cleanup after everything
849  /// has been figured out. It can remove breakpoints that no longer
850  /// make sense as the exec might have changed the target
851  /// architecture, and unloaded some modules that might get deleted.
852  void DidExec();
853 
854  /// Gets the module for the main executable.
855  ///
856  /// Each process has a notion of a main executable that is the file
857  /// that will be executed or attached to. Executable files can have
858  /// dependent modules that are discovered from the object files, or
859  /// discovered at runtime as things are dynamically loaded.
860  ///
861  /// \return
862  /// The shared pointer to the executable module which can
863  /// contains a nullptr Module object if no executable has been
864  /// set.
865  ///
866  /// \see DynamicLoader
867  /// \see ObjectFile::GetDependentModules (FileSpecList&)
868  /// \see Process::SetExecutableModule(lldb::ModuleSP&)
869  lldb::ModuleSP GetExecutableModule();
870 
872 
873  /// Set the main executable module.
874  ///
875  /// Each process has a notion of a main executable that is the file
876  /// that will be executed or attached to. Executable files can have
877  /// dependent modules that are discovered from the object files, or
878  /// discovered at runtime as things are dynamically loaded.
879  ///
880  /// Setting the executable causes any of the current dependent
881  /// image information to be cleared and replaced with the static
882  /// dependent image information found by calling
883  /// ObjectFile::GetDependentModules (FileSpecList&) on the main
884  /// executable and any modules on which it depends. Calling
885  /// Process::GetImages() will return the newly found images that
886  /// were obtained from all of the object files.
887  ///
888  /// \param[in] module_sp
889  /// A shared pointer reference to the module that will become
890  /// the main executable for this process.
891  ///
892  /// \param[in] load_dependent_files
893  /// If \b true then ask the object files to track down any
894  /// known dependent files.
895  ///
896  /// \see ObjectFile::GetDependentModules (FileSpecList&)
897  /// \see Process::GetImages()
898  void SetExecutableModule(
899  lldb::ModuleSP &module_sp,
900  LoadDependentFiles load_dependent_files = eLoadDependentsDefault);
901 
902  bool LoadScriptingResources(std::list<Status> &errors,
903  Stream *feedback_stream = nullptr,
904  bool continue_on_error = true) {
906  this, errors, feedback_stream, continue_on_error);
907  }
908 
909  /// Get accessor for the images for this process.
910  ///
911  /// Each process has a notion of a main executable that is the file
912  /// that will be executed or attached to. Executable files can have
913  /// dependent modules that are discovered from the object files, or
914  /// discovered at runtime as things are dynamically loaded. After
915  /// a main executable has been set, the images will contain a list
916  /// of all the files that the executable depends upon as far as the
917  /// object files know. These images will usually contain valid file
918  /// virtual addresses only. When the process is launched or attached
919  /// to, the DynamicLoader plug-in will discover where these images
920  /// were loaded in memory and will resolve the load virtual
921  /// addresses is each image, and also in images that are loaded by
922  /// code.
923  ///
924  /// \return
925  /// A list of Module objects in a module list.
926  const ModuleList &GetImages() const { return m_images; }
927 
929 
930  /// Return whether this FileSpec corresponds to a module that should be
931  /// considered for general searches.
932  ///
933  /// This API will be consulted by the SearchFilterForUnconstrainedSearches
934  /// and any module that returns \b true will not be searched. Note the
935  /// SearchFilterForUnconstrainedSearches is the search filter that
936  /// gets used in the CreateBreakpoint calls when no modules is provided.
937  ///
938  /// The target call at present just consults the Platform's call of the
939  /// same name.
940  ///
941  /// \param[in] module_spec
942  /// Path to the module.
943  ///
944  /// \return \b true if the module should be excluded, \b false otherwise.
945  bool ModuleIsExcludedForUnconstrainedSearches(const FileSpec &module_spec);
946 
947  /// Return whether this module should be considered for general searches.
948  ///
949  /// This API will be consulted by the SearchFilterForUnconstrainedSearches
950  /// and any module that returns \b true will not be searched. Note the
951  /// SearchFilterForUnconstrainedSearches is the search filter that
952  /// gets used in the CreateBreakpoint calls when no modules is provided.
953  ///
954  /// The target call at present just consults the Platform's call of the
955  /// same name.
956  ///
957  /// FIXME: When we get time we should add a way for the user to set modules
958  /// that they
959  /// don't want searched, in addition to or instead of the platform ones.
960  ///
961  /// \param[in] module_sp
962  /// A shared pointer reference to the module that checked.
963  ///
964  /// \return \b true if the module should be excluded, \b false otherwise.
965  bool
966  ModuleIsExcludedForUnconstrainedSearches(const lldb::ModuleSP &module_sp);
967 
968  const ArchSpec &GetArchitecture() const { return m_arch.GetSpec(); }
969 
970  /// Set the architecture for this target.
971  ///
972  /// If the current target has no Images read in, then this just sets the
973  /// architecture, which will be used to select the architecture of the
974  /// ExecutableModule when that is set. If the current target has an
975  /// ExecutableModule, then calling SetArchitecture with a different
976  /// architecture from the currently selected one will reset the
977  /// ExecutableModule to that slice of the file backing the ExecutableModule.
978  /// If the file backing the ExecutableModule does not contain a fork of this
979  /// architecture, then this code will return false, and the architecture
980  /// won't be changed. If the input arch_spec is the same as the already set
981  /// architecture, this is a no-op.
982  ///
983  /// \param[in] arch_spec
984  /// The new architecture.
985  ///
986  /// \param[in] set_platform
987  /// If \b true, then the platform will be adjusted if the currently
988  /// selected platform is not compatible with the architecture being set.
989  /// If \b false, then just the architecture will be set even if the
990  /// currently selected platform isn't compatible (in case it might be
991  /// manually set following this function call).
992  ///
993  /// \return
994  /// \b true if the architecture was successfully set, \bfalse otherwise.
995  bool SetArchitecture(const ArchSpec &arch_spec, bool set_platform = false);
996 
997  bool MergeArchitecture(const ArchSpec &arch_spec);
998 
1000 
1002 
1003  size_t ReadMemoryFromFileCache(const Address &addr, void *dst, size_t dst_len,
1004  Status &error);
1005 
1006  // Reading memory through the target allows us to skip going to the process
1007  // for reading memory if possible and it allows us to try and read from any
1008  // constant sections in our object files on disk. If you always want live
1009  // program memory, read straight from the process. If you possibly want to
1010  // read from const sections in object files, read from the target. This
1011  // version of ReadMemory will try and read memory from the process if the
1012  // process is alive. The order is:
1013  // 1 - if (force_live_memory == false) and the address falls in a read-only
1014  // section, then read from the file cache
1015  // 2 - if there is a process, then read from memory
1016  // 3 - if there is no process, then read from the file cache
1017  size_t ReadMemory(const Address &addr, void *dst, size_t dst_len,
1018  Status &error, bool force_live_memory = false,
1019  lldb::addr_t *load_addr_ptr = nullptr);
1020 
1021  size_t ReadCStringFromMemory(const Address &addr, std::string &out_str,
1022  Status &error);
1023 
1024  size_t ReadCStringFromMemory(const Address &addr, char *dst,
1025  size_t dst_max_len, Status &result_error);
1026 
1027  /// Read a NULL terminated string from memory
1028  ///
1029  /// This function will read a cache page at a time until a NULL string
1030  /// terminator is found. It will stop reading if an aligned sequence of NULL
1031  /// termination \a type_width bytes is not found before reading \a
1032  /// cstr_max_len bytes. The results are always guaranteed to be NULL
1033  /// terminated, and that no more than (max_bytes - type_width) bytes will be
1034  /// read.
1035  ///
1036  /// \param[in] addr
1037  /// The address to start the memory read.
1038  ///
1039  /// \param[in] dst
1040  /// A character buffer containing at least max_bytes.
1041  ///
1042  /// \param[in] max_bytes
1043  /// The maximum number of bytes to read.
1044  ///
1045  /// \param[in] error
1046  /// The error status of the read operation.
1047  ///
1048  /// \param[in] type_width
1049  /// The size of the null terminator (1 to 4 bytes per
1050  /// character). Defaults to 1.
1051  ///
1052  /// \return
1053  /// The error status or the number of bytes prior to the null terminator.
1054  size_t ReadStringFromMemory(const Address &addr, char *dst, size_t max_bytes,
1055  Status &error, size_t type_width,
1056  bool force_live_memory = true);
1057 
1058  size_t ReadScalarIntegerFromMemory(const Address &addr, uint32_t byte_size,
1059  bool is_signed, Scalar &scalar,
1060  Status &error,
1061  bool force_live_memory = false);
1062 
1063  uint64_t ReadUnsignedIntegerFromMemory(const Address &addr,
1064  size_t integer_byte_size,
1065  uint64_t fail_value, Status &error,
1066  bool force_live_memory = false);
1067 
1068  bool ReadPointerFromMemory(const Address &addr, Status &error,
1069  Address &pointer_addr,
1070  bool force_live_memory = false);
1071 
1074  }
1075 
1076  static Target *GetTargetFromContexts(const ExecutionContext *exe_ctx_ptr,
1077  const SymbolContext *sc_ptr);
1078 
1079  // lldb::ExecutionContextScope pure virtual functions
1080  lldb::TargetSP CalculateTarget() override;
1081 
1082  lldb::ProcessSP CalculateProcess() override;
1083 
1084  lldb::ThreadSP CalculateThread() override;
1085 
1086  lldb::StackFrameSP CalculateStackFrame() override;
1087 
1088  void CalculateExecutionContext(ExecutionContext &exe_ctx) override;
1089 
1091 
1092  llvm::Expected<TypeSystem &>
1094  bool create_on_demand = true);
1095 
1096  std::vector<TypeSystem *> GetScratchTypeSystems(bool create_on_demand = true);
1097 
1100 
1101  // Creates a UserExpression for the given language, the rest of the
1102  // parameters have the same meaning as for the UserExpression constructor.
1103  // Returns a new-ed object which the caller owns.
1104 
1105  UserExpression *
1106  GetUserExpressionForLanguage(llvm::StringRef expr, llvm::StringRef prefix,
1107  lldb::LanguageType language,
1108  Expression::ResultType desired_type,
1109  const EvaluateExpressionOptions &options,
1110  ValueObject *ctx_obj, Status &error);
1111 
1112  // Creates a FunctionCaller for the given language, the rest of the
1113  // parameters have the same meaning as for the FunctionCaller constructor.
1114  // Since a FunctionCaller can't be
1115  // IR Interpreted, it makes no sense to call this with an
1116  // ExecutionContextScope that lacks
1117  // a Process.
1118  // Returns a new-ed object which the caller owns.
1119 
1121  const CompilerType &return_type,
1122  const Address &function_address,
1123  const ValueList &arg_value_list,
1124  const char *name, Status &error);
1125 
1126  /// Creates and installs a UtilityFunction for the given language.
1127  llvm::Expected<std::unique_ptr<UtilityFunction>>
1129  lldb::LanguageType language, ExecutionContext &exe_ctx);
1130 
1131  // Install any files through the platform that need be to installed prior to
1132  // launching or attaching.
1133  Status Install(ProcessLaunchInfo *launch_info);
1134 
1135  bool ResolveFileAddress(lldb::addr_t load_addr, Address &so_addr);
1136 
1137  bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr,
1139 
1140  bool SetSectionLoadAddress(const lldb::SectionSP &section,
1141  lldb::addr_t load_addr,
1142  bool warn_multiple = false);
1143 
1144  size_t UnloadModuleSections(const lldb::ModuleSP &module_sp);
1145 
1146  size_t UnloadModuleSections(const ModuleList &module_list);
1147 
1148  bool SetSectionUnloaded(const lldb::SectionSP &section_sp);
1149 
1150  bool SetSectionUnloaded(const lldb::SectionSP &section_sp,
1151  lldb::addr_t load_addr);
1152 
1153  void ClearAllLoadedSections();
1154 
1155  /// Set the \a Trace object containing processor trace information of this
1156  /// target.
1157  ///
1158  /// \param[in] trace_sp
1159  /// The trace object.
1160  void SetTrace(const lldb::TraceSP &trace_sp);
1161 
1162  /// Get the \a Trace object containing processor trace information of this
1163  /// target.
1164  ///
1165  /// \return
1166  /// The trace object. It might be undefined.
1167  lldb::TraceSP GetTrace();
1168 
1169  /// Create a \a Trace object for the current target using the using the
1170  /// default supported tracing technology for this process.
1171  ///
1172  /// \return
1173  /// The new \a Trace or an \a llvm::Error if a \a Trace already exists or
1174  /// the trace couldn't be created.
1175  llvm::Expected<lldb::TraceSP> CreateTrace();
1176 
1177  /// If a \a Trace object is present, this returns it, otherwise a new Trace is
1178  /// created with \a Trace::CreateTrace.
1179  llvm::Expected<lldb::TraceSP> GetTraceOrCreate();
1180 
1181  // Since expressions results can persist beyond the lifetime of a process,
1182  // and the const expression results are available after a process is gone, we
1183  // provide a way for expressions to be evaluated from the Target itself. If
1184  // an expression is going to be run, then it should have a frame filled in in
1185  // the execution context.
1187  llvm::StringRef expression, ExecutionContextScope *exe_scope,
1188  lldb::ValueObjectSP &result_valobj_sp,
1190  std::string *fixed_expression = nullptr, ValueObject *ctx_obj = nullptr);
1191 
1192  lldb::ExpressionVariableSP GetPersistentVariable(ConstString name);
1193 
1195 
1196  /// This method will return the address of the starting function for
1197  /// this binary, e.g. main() or its equivalent. This can be used as
1198  /// an address of a function that is not called once a binary has
1199  /// started running - e.g. as a return address for inferior function
1200  /// calls that are unambiguous completion of the function call, not
1201  /// called during the course of the inferior function code running.
1202  ///
1203  /// If no entry point can be found, an invalid address is returned.
1204  ///
1205  /// \param [out] err
1206  /// This object will be set to failure if no entry address could
1207  /// be found, and may contain a helpful error message.
1208  //
1209  /// \return
1210  /// Returns the entry address for this program, or an error
1211  /// if none can be found.
1212  llvm::Expected<lldb_private::Address> GetEntryPointAddress();
1213 
1214  // Target Stop Hooks
1215  class StopHook : public UserID {
1216  public:
1217  StopHook(const StopHook &rhs);
1218  virtual ~StopHook() = default;
1219 
1221  enum class StopHookResult : uint32_t {
1222  KeepStopped = 0,
1225  };
1226 
1227  lldb::TargetSP &GetTarget() { return m_target_sp; }
1228 
1229  // Set the specifier. The stop hook will own the specifier, and is
1230  // responsible for deleting it when we're done.
1231  void SetSpecifier(SymbolContextSpecifier *specifier);
1232 
1234 
1235  bool ExecutionContextPasses(const ExecutionContext &exe_ctx);
1236 
1237  // Called on stop, this gets passed the ExecutionContext for each "stop
1238  // with a reason" thread. It should add to the stream whatever text it
1239  // wants to show the user, and return False to indicate it wants the target
1240  // not to stop.
1241  virtual StopHookResult HandleStop(ExecutionContext &exe_ctx,
1242  lldb::StreamSP output) = 0;
1243 
1244  // Set the Thread Specifier. The stop hook will own the thread specifier,
1245  // and is responsible for deleting it when we're done.
1246  void SetThreadSpecifier(ThreadSpec *specifier);
1247 
1249 
1250  bool IsActive() { return m_active; }
1251 
1252  void SetIsActive(bool is_active) { m_active = is_active; }
1253 
1254  void SetAutoContinue(bool auto_continue) {
1255  m_auto_continue = auto_continue;
1256  }
1257 
1258  bool GetAutoContinue() const { return m_auto_continue; }
1259 
1260  void GetDescription(Stream *s, lldb::DescriptionLevel level) const;
1261  virtual void GetSubclassDescription(Stream *s,
1262  lldb::DescriptionLevel level) const = 0;
1263 
1264  protected:
1265  lldb::TargetSP m_target_sp;
1266  lldb::SymbolContextSpecifierSP m_specifier_sp;
1267  std::unique_ptr<ThreadSpec> m_thread_spec_up;
1268  bool m_active = true;
1269  bool m_auto_continue = false;
1270 
1271  StopHook(lldb::TargetSP target_sp, lldb::user_id_t uid);
1272  };
1273 
1275  public:
1276  virtual ~StopHookCommandLine() = default;
1277 
1279  void SetActionFromString(const std::string &strings);
1280  void SetActionFromStrings(const std::vector<std::string> &strings);
1281 
1283  lldb::StreamSP output_sp) override;
1285  lldb::DescriptionLevel level) const override;
1286 
1287  private:
1289  // Use CreateStopHook to make a new empty stop hook. The GetCommandPointer
1290  // and fill it with commands, and SetSpecifier to set the specifier shared
1291  // pointer (can be null, that will match anything.)
1292  StopHookCommandLine(lldb::TargetSP target_sp, lldb::user_id_t uid)
1293  : StopHook(target_sp, uid) {}
1294  friend class Target;
1295  };
1296 
1297  class StopHookScripted : public StopHook {
1298  public:
1299  virtual ~StopHookScripted() = default;
1301  lldb::StreamSP output) override;
1302 
1304  StructuredData::ObjectSP extra_args_sp);
1305 
1307  lldb::DescriptionLevel level) const override;
1308 
1309  private:
1311  /// This holds the dictionary of keys & values that can be used to
1312  /// parametrize any given callback's behavior.
1314  /// This holds the python callback object.
1316 
1317  /// Use CreateStopHook to make a new empty stop hook. The GetCommandPointer
1318  /// and fill it with commands, and SetSpecifier to set the specifier shared
1319  /// pointer (can be null, that will match anything.)
1320  StopHookScripted(lldb::TargetSP target_sp, lldb::user_id_t uid)
1321  : StopHook(target_sp, uid) {}
1322  friend class Target;
1323  };
1324 
1325  typedef std::shared_ptr<StopHook> StopHookSP;
1326 
1327  /// Add an empty stop hook to the Target's stop hook list, and returns a
1328  /// shared pointer to it in new_hook. Returns the id of the new hook.
1330 
1331  /// If you tried to create a stop hook, and that failed, call this to
1332  /// remove the stop hook, as it will also reset the stop hook counter.
1334 
1335  // Runs the stop hooks that have been registered for this target.
1336  // Returns true if the stop hooks cause the target to resume.
1337  bool RunStopHooks();
1338 
1339  size_t GetStopHookSize();
1340 
1341  bool SetSuppresStopHooks(bool suppress) {
1342  bool old_value = m_suppress_stop_hooks;
1343  m_suppress_stop_hooks = suppress;
1344  return old_value;
1345  }
1346 
1348 
1350 
1351  void RemoveAllStopHooks();
1352 
1354 
1355  bool SetStopHookActiveStateByID(lldb::user_id_t uid, bool active_state);
1356 
1357  void SetAllStopHooksActiveState(bool active_state);
1358 
1359  size_t GetNumStopHooks() const { return m_stop_hooks.size(); }
1360 
1362  if (index >= GetNumStopHooks())
1363  return StopHookSP();
1364  StopHookCollection::iterator pos = m_stop_hooks.begin();
1365 
1366  while (index > 0) {
1367  pos++;
1368  index--;
1369  }
1370  return (*pos).second;
1371  }
1372 
1373  lldb::PlatformSP GetPlatform() { return m_platform_sp; }
1374 
1375  void SetPlatform(const lldb::PlatformSP &platform_sp) {
1376  m_platform_sp = platform_sp;
1377  }
1378 
1380 
1381  // Methods.
1382  lldb::SearchFilterSP
1383  GetSearchFilterForModule(const FileSpec *containingModule);
1384 
1385  lldb::SearchFilterSP
1386  GetSearchFilterForModuleList(const FileSpecList *containingModuleList);
1387 
1388  lldb::SearchFilterSP
1389  GetSearchFilterForModuleAndCUList(const FileSpecList *containingModules,
1390  const FileSpecList *containingSourceFiles);
1391 
1392  lldb::REPLSP GetREPL(Status &err, lldb::LanguageType language,
1393  const char *repl_options, bool can_create);
1394 
1395  void SetREPL(lldb::LanguageType language, lldb::REPLSP repl_sp);
1396 
1399  }
1400 
1401 protected:
1402  /// Implementing of ModuleList::Notifier.
1403 
1404  void NotifyModuleAdded(const ModuleList &module_list,
1405  const lldb::ModuleSP &module_sp) override;
1406 
1407  void NotifyModuleRemoved(const ModuleList &module_list,
1408  const lldb::ModuleSP &module_sp) override;
1409 
1410  void NotifyModuleUpdated(const ModuleList &module_list,
1411  const lldb::ModuleSP &old_module_sp,
1412  const lldb::ModuleSP &new_module_sp) override;
1413 
1414  void NotifyWillClearList(const ModuleList &module_list) override;
1415 
1416  void NotifyModulesRemoved(lldb_private::ModuleList &module_list) override;
1417 
1418  class Arch {
1419  public:
1420  explicit Arch(const ArchSpec &spec);
1421  const Arch &operator=(const ArchSpec &spec);
1422 
1423  const ArchSpec &GetSpec() const { return m_spec; }
1424  Architecture *GetPlugin() const { return m_plugin_up.get(); }
1425 
1426  private:
1428  std::unique_ptr<Architecture> m_plugin_up;
1429  };
1430  // Member variables.
1432  lldb::PlatformSP m_platform_sp; ///< The platform for this target.
1433  std::recursive_mutex m_mutex; ///< An API mutex that is used by the lldb::SB*
1434  /// classes make the SB interface thread safe
1435  /// When the private state thread calls SB API's - usually because it is
1436  /// running OS plugin or Python ThreadPlan code - it should not block on the
1437  /// API mutex that is held by the code that kicked off the sequence of events
1438  /// that led us to run the code. We hand out this mutex instead when we
1439  /// detect that code is running on the private state thread.
1440  std::recursive_mutex m_private_mutex;
1442  ModuleList m_images; ///< The list of images for this process (shared
1443  /// libraries and anything dynamically loaded).
1447  using BreakpointNameList = std::map<ConstString, BreakpointName *>;
1449 
1450  lldb::BreakpointSP m_last_created_breakpoint;
1452  lldb::WatchpointSP m_last_created_watchpoint;
1453  // We want to tightly control the process destruction process so we can
1454  // correctly tear down everything that we need to, so the only class that
1455  // knows about the process lifespan is this target class.
1456  lldb::ProcessSP m_process_sp;
1457  lldb::SearchFilterSP m_search_filter_sp;
1460 
1461  typedef std::map<lldb::LanguageType, lldb::REPLSP> REPLMap;
1463 
1464  lldb::SourceManagerUP m_source_manager_up;
1465 
1466  typedef std::map<lldb::user_id_t, StopHookSP> StopHookCollection;
1469  uint32_t m_latest_stop_hook_id; /// This records the last natural stop at
1470  /// which we ran a stop-hook.
1471  bool m_valid;
1472  bool m_suppress_stop_hooks; /// Used to not run stop hooks for expressions
1475  /// An optional \a lldb_private::Trace object containing processor trace
1476  /// information of this target.
1477  lldb::TraceSP m_trace_sp;
1478  /// Stores the frame recognizers of this target.
1479  lldb::StackFrameRecognizerManagerUP m_frame_recognizer_manager_up;
1480 
1481  static void ImageSearchPathsChanged(const PathMappingList &path_list,
1482  void *baton);
1483 
1484  // Utilities for `statistics` command.
1485 private:
1486  // Target metrics storage.
1488 
1489 public:
1490  /// Get metrics associated with this target in JSON format.
1491  ///
1492  /// Target metrics help measure timings and information that is contained in
1493  /// a target. These are designed to help measure performance of a debug
1494  /// session as well as represent the current state of the target, like
1495  /// information on the currently modules, currently set breakpoints and more.
1496  ///
1497  /// \return
1498  /// Returns a JSON value that contains all target metrics.
1499  llvm::json::Value ReportStatistics();
1500 
1502 
1503 private:
1504  /// Construct with optional file and arch.
1505  ///
1506  /// This member is private. Clients must use
1507  /// TargetList::CreateTarget(const FileSpec*, const ArchSpec*)
1508  /// so all targets can be tracked from the central target list.
1509  ///
1510  /// \see TargetList::CreateTarget(const FileSpec*, const ArchSpec*)
1511  Target(Debugger &debugger, const ArchSpec &target_arch,
1512  const lldb::PlatformSP &platform_sp, bool is_dummy_target);
1513 
1514  // Helper function.
1515  bool ProcessIsValid();
1516 
1517  // Copy breakpoints, stop hooks and so forth from the dummy target:
1518  void PrimeFromDummyTarget(Target &target);
1519 
1520  void AddBreakpoint(lldb::BreakpointSP breakpoint_sp, bool internal);
1521 
1523 
1524  /// Return a recommended size for memory reads at \a addr, optimizing for
1525  /// cache usage.
1527 
1528  Target(const Target &) = delete;
1529  const Target &operator=(const Target &) = delete;
1530 };
1531 
1532 } // namespace lldb_private
1533 
1534 #endif // LLDB_TARGET_TARGET_H
lldb_private::EvaluateExpressionOptions::DoesKeepInMemory
bool DoesKeepInMemory() const
Definition: Target.h:315
lldb_private::TargetProperties::GetStandardInputPath
FileSpec GetStandardInputPath() const
Definition: Target.cpp:4194
lldb_private::Target::PrimeFromDummyTarget
void PrimeFromDummyTarget(Target &target)
Definition: Target.cpp:129
lldb_private::Target::GetFrameRecognizerManager
StackFrameRecognizerManager & GetFrameRecognizerManager()
Definition: Target.h:1397
lldb_private::Target::TargetEventData::GetTarget
const lldb::TargetSP & GetTarget() const
Definition: Target.h:503
lldb_private::ModuleList::LoadScriptingResourcesInTarget
bool LoadScriptingResourcesInTarget(Target *target, std::list< Status > &errors, Stream *feedback_stream=nullptr, bool continue_on_error=true)
Definition: ModuleList.cpp:1023
lldb_private::TargetProperties::DisableSTDIOValueChangedCallback
void DisableSTDIOValueChangedCallback()
Definition: Target.cpp:4434
lldb_private::Target::ConfigureBreakpointName
void ConfigureBreakpointName(BreakpointName &bp_name, const BreakpointOptions &options, const BreakpointName::Permissions &permissions)
Definition: Target.cpp:733
lldb_private::Target::StopHookScripted::~StopHookScripted
virtual ~StopHookScripted()=default
lldb_private::EvaluateExpressionOptions::m_cancel_callback
lldb::ExpressionCancelCallback m_cancel_callback
Definition: Target.h:442
lldb_private::EvaluateExpressionOptions::GetColorizeErrors
bool GetColorizeErrors() const
Definition: Target.h:358
BreakpointName.h
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::Target::StopHookCommandLine::StopHookCommandLine
StopHookCommandLine(lldb::TargetSP target_sp, lldb::user_id_t uid)
Definition: Target.h:1292
lldb_private::EvaluateExpressionOptions::GetTimeout
const Timeout< std::micro > & GetTimeout() const
Definition: Target.h:326
lldb-public.h
lldb_private::Target::Destroy
void Destroy()
Definition: Target.cpp:269
lldb_private::Target::StopHook::StopHook
StopHook(const StopHook &rhs)
Definition: Target.cpp:3336
lldb_private::TargetProperties::ComputeEnvironment
Environment ComputeEnvironment() const
Definition: Target.cpp:3999
lldb_private::MemoryModuleLoadLevel
MemoryModuleLoadLevel
Definition: lldb-private-enumerations.h:169
lldb_private::Target::NotifyWillClearList
void NotifyWillClearList(const ModuleList &module_list) override
Definition: Target.cpp:1572
lldb_private::BreakpointList
General Outline: Allows adding and removing breakpoints and find by ID and index.
Definition: BreakpointList.h:25
lldb_private::Architecture
Definition: Architecture.h:17
lldb_private::TargetProperties::GetDisplayExpressionsInCrashlogs
bool GetDisplayExpressionsInCrashlogs() const
Definition: Target.cpp:4272
lldb_private::ArchSpec
Definition: ArchSpec.h:33
lldb_private::Target::RemoveNameFromBreakpoint
void RemoveNameFromBreakpoint(lldb::BreakpointSP &bp_sp, ConstString name)
Definition: Target.cpp:728
lldb_private::RegularExpression
Definition: RegularExpression.h:18
lldb_private::Target::m_latest_stop_hook_id
uint32_t m_latest_stop_hook_id
Definition: Target.h:1469
lldb_private::Target::m_last_created_breakpoint
lldb::BreakpointSP m_last_created_breakpoint
Definition: Target.h:1450
lldb_private::TargetProperties::SetArg0
void SetArg0(llvm::StringRef arg)
Definition: Target.cpp:3982
lldb_private::TargetProperties::GetRequireHardwareBreakpoints
bool GetRequireHardwareBreakpoints() const
Definition: Target.cpp:4367
lldb_private::Target::DeleteBreakpointName
void DeleteBreakpointName(ConstString name)
Definition: Target.cpp:717
lldb_private::TargetProperties::GetInheritTCC
bool GetInheritTCC() const
Definition: Target.cpp:3926
lldb_private::TargetProperties::SetRequireHardwareBreakpoints
void SetRequireHardwareBreakpoints(bool b)
Definition: Target.cpp:4373
lldb_private::Event
Definition: Event.h:180
lldb_private::Target::GetEntryPointAddress
llvm::Expected< lldb_private::Address > GetEntryPointAddress()
This method will return the address of the starting function for this binary, e.g.
Definition: Target.cpp:2538
lldb_private::TargetProperties::GetTargetEnvironment
Environment GetTargetEnvironment() const
Definition: Target.cpp:4060
lldb_private::Target::ModuleIsExcludedForUnconstrainedSearches
bool ModuleIsExcludedForUnconstrainedSearches(const FileSpec &module_spec)
Return whether this FileSpec corresponds to a module that should be considered for general searches.
Definition: Target.cpp:1653
lldb_private::TargetProperties::OutputPathValueChangedCallback
void OutputPathValueChangedCallback()
Definition: Target.cpp:4403
lldb_private::Target::ClearModules
void ClearModules(bool delete_locations)
Definition: Target.cpp:1380
lldb_private::EvaluateExpressionOptions::SetTimeout
void SetTimeout(const Timeout< std::micro > &timeout)
Definition: Target.h:328
lldb_private::EvaluateExpressionOptions::SetREPLEnabled
void SetREPLEnabled(bool b)
Definition: Target.h:368
lldb_private::EvaluateExpressionOptions::SetLanguage
void SetLanguage(lldb::LanguageType language)
Definition: Target.h:288
lldb_private::Target::m_repl_map
REPLMap m_repl_map
Definition: Target.h:1462
lldb_private::Target::SymbolsDidLoad
void SymbolsDidLoad(ModuleList &module_list)
Definition: Target.cpp:1627
lldb_private::TargetProperties::GetExprErrorLimit
uint64_t GetExprErrorLimit() const
Definition: Target.cpp:4248
lldb_private::ExecutionPolicy
ExecutionPolicy
Expression execution policies.
Definition: lldb-private-enumerations.h:144
lldb_private::Target::StopHookCommandLine::HandleStop
StopHookResult HandleStop(ExecutionContext &exc_ctx, lldb::StreamSP output_sp) override
Definition: Target.cpp:3440
lldb_private::Target::StopHook::m_target_sp
lldb::TargetSP m_target_sp
Definition: Target.h:1265
lldb_private::Target::m_suppress_stop_hooks
bool m_suppress_stop_hooks
Definition: Target.h:1472
lldb_private::AddressClass
AddressClass
Definition: lldb-private-enumerations.h:48
lldb_private::Target::m_stats
TargetStats m_stats
Definition: Target.h:1487
lldb_private::Target::DisableBreakpointByID
bool DisableBreakpointByID(lldb::break_id_t break_id)
Definition: Target.cpp:950
lldb_private::StructuredData::GenericSP
std::shared_ptr< Generic > GenericSP
Definition: StructuredData.h:68
lldb::eNoDynamicValues
@ eNoDynamicValues
Definition: lldb-enumerations.h:495
lldb_private::Target::StopHook::StopHookKind::ScriptBased
@ ScriptBased
lldb_private::Target::StopHookCommandLine::SetActionFromStrings
void SetActionFromStrings(const std::vector< std::string > &strings)
Definition: Target.cpp:3433
lldb_private::TargetProperties::SetStandardInputPath
void SetStandardInputPath(llvm::StringRef path)
Definition: Target.cpp:4199
lldb_private::Target::eBroadcastBitModulesUnloaded
@ eBroadcastBitModulesUnloaded
Definition: Target.h:465
lldb_private::TargetProperties::SetDisplayRuntimeSupportValues
void SetDisplayRuntimeSupportValues(bool b)
Definition: Target.cpp:4320
lldb_private::TargetProperties::SetDisplayRecognizedArguments
void SetDisplayRecognizedArguments(bool b)
Definition: Target.cpp:4330
lldb_private::Target::StopHook::m_thread_spec_up
std::unique_ptr< ThreadSpec > m_thread_spec_up
Definition: Target.h:1267
lldb_private::TargetProperties::GetPreloadSymbols
bool GetPreloadSymbols() const
Definition: Target.cpp:3904
lldb_private::Target::GetOrCreateModule
lldb::ModuleSP GetOrCreateModule(const ModuleSpec &module_spec, bool notify, Status *error_ptr=nullptr)
Find a binary on the system and return its Module, or return an existing Module that is already in th...
Definition: Target.cpp:2038
lldb::ExpressionCancelCallback
bool(* ExpressionCancelCallback)(ExpressionEvaluationPhase phase, void *baton)
Definition: lldb-types.h:74
lldb::ExpressionResults
ExpressionResults
The results of expression evaluation.
Definition: lldb-enumerations.h:270
lldb_private::Target::StopHook::SetAutoContinue
void SetAutoContinue(bool auto_continue)
Definition: Target.h:1254
lldb_private::Target::GetBreakpointNames
void GetBreakpointNames(std::vector< std::string > &names)
Definition: Target.cpp:756
lldb_private::Target::operator=
const Target & operator=(const Target &)=delete
ProcessLaunchInfo.h
lldb_private::Target::StopHook::m_auto_continue
bool m_auto_continue
Definition: Target.h:1269
lldb_private::UserID
Definition: UserID.h:31
lldb_private::Target::UnloadModuleSections
size_t UnloadModuleSections(const lldb::ModuleSP &module_sp)
Definition: Target.cpp:2922
lldb_private::LoadDependentFiles
LoadDependentFiles
Definition: Target.h:62
lldb_private::TargetProperties::GetMaximumSizeOfStringSummary
uint32_t GetMaximumSizeOfStringSummary() const
Definition: Target.cpp:4182
lldb_private::eImportStdModuleTrue
@ eImportStdModuleTrue
Definition: Target.h:71
lldb_private::Target::CalculateThread
lldb::ThreadSP CalculateThread() override
Definition: Target.cpp:2239
lldb_private::Scalar
Definition: Scalar.h:34
lldb_private::eImportStdModuleFallback
@ eImportStdModuleFallback
Definition: Target.h:70
lldb_private::EvaluateExpressionOptions::DoesCoerceToId
bool DoesCoerceToId() const
Definition: Target.h:290
lldb_private::Target::GetExecutableModulePointer
Module * GetExecutableModulePointer()
Definition: Target.cpp:1358
Architecture.h
lldb_private::TargetStats
A class that represents statistics for a since lldb_private::Target.
Definition: Statistics.h:94
lldb_private::Target::StopHook::HandleStop
virtual StopHookResult HandleStop(ExecutionContext &exe_ctx, lldb::StreamSP output)=0
lldb_private::TargetProperties::GetEnableSyntheticValue
bool GetEnableSyntheticValue() const
Definition: Target.cpp:4164
lldb_private::Target::CalculateProcess
lldb::ProcessSP CalculateProcess() override
Definition: Target.cpp:2237
lldb_private::Target::DisableAllBreakpoints
void DisableAllBreakpoints(bool internal_also=false)
Definition: Target.cpp:896
lldb_private::eLoadScriptFromSymFileFalse
@ eLoadScriptFromSymFileFalse
Definition: Target.h:52
lldb_private::Target::REPLMap
std::map< lldb::LanguageType, lldb::REPLSP > REPLMap
Definition: Target.h:1461
lldb_private::EventData
Definition: Event.h:36
lldb_private::Target::GetExecutableModule
lldb::ModuleSP GetExecutableModule()
Gets the module for the main executable.
Definition: Target.cpp:1344
lldb_private::EvaluateExpressionOptions::SetExecutionPolicy
void SetExecutionPolicy(ExecutionPolicy policy=eExecutionPolicyAlways)
Definition: Target.h:282
lldb_private::Target::BreakpointNameList
std::map< ConstString, BreakpointName * > BreakpointNameList
Definition: Target.h:1447
lldb_private::TargetProperties::GetMemoryModuleLoadLevel
MemoryModuleLoadLevel GetMemoryModuleLoadLevel() const
Definition: Target.cpp:4298
lldb_private::EvaluateExpressionOptions::GetPrefix
const char * GetPrefix() const
Definition: Target.h:292
lldb_private::Target::AddBreakpoint
void AddBreakpoint(lldb::BreakpointSP breakpoint_sp, bool internal)
Definition: Target.cpp:642
lldb_private::EvaluateExpressionOptions::SetIsForUtilityExpr
void SetIsForUtilityExpr(bool b)
Definition: Target.h:415
lldb_private::TargetProperties::~TargetProperties
~TargetProperties() override
lldb_private::Target::ClearAllWatchpointHistoricValues
bool ClearAllWatchpointHistoricValues()
Definition: Target.cpp:1242
lldb_private::Target::StopHookCommandLine::m_commands
StringList m_commands
Definition: Target.h:1288
lldb_private::TargetProperties::SetDisableASLR
void SetDisableASLR(bool b)
Definition: Target.cpp:3921
lldb_private::Target::Arch::operator=
const Arch & operator=(const ArchSpec &spec)
Definition: Target.cpp:77
lldb_private::EvaluateExpressionOptions::DoesIgnoreBreakpoints
bool DoesIgnoreBreakpoints() const
Definition: Target.h:309
lldb_private::EvaluateExpressionOptions::SetTrapExceptions
void SetTrapExceptions(bool b)
Definition: Target.h:364
lldb_private::EvaluateExpressionOptions
Definition: Target.h:260
lldb_private::TargetProperties::GetLoadScriptFromSymbolFile
LoadScriptFromSymFile GetLoadScriptFromSymbolFile() const
Definition: Target.cpp:4278
lldb_private::Target::m_valid
bool m_valid
This records the last natural stop at which we ran a stop-hook.
Definition: Target.h:1471
lldb_private::TargetProperties::m_experimental_properties_up
std::unique_ptr< TargetExperimentalProperties > m_experimental_properties_up
Definition: Target.h:256
lldb_private::TargetProperties::GetInjectLocalVariables
bool GetInjectLocalVariables(ExecutionContext *exe_ctx) const
Definition: Target.cpp:3847
lldb_private::EvaluateExpressionOptions::SetPoundLine
void SetPoundLine(const char *path, uint32_t line) const
Definition: Target.h:383
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb_private::EvaluateExpressionOptions::m_repl
bool m_repl
Definition: Target.h:429
lldb_private::Target::StopHookScripted
Definition: Target.h:1297
lldb_private::TargetList
Definition: TargetList.h:21
lldb_private::Target::StopHook::GetAutoContinue
bool GetAutoContinue() const
Definition: Target.h:1258
lldb_private::eLoadDependentsDefault
@ eLoadDependentsDefault
Definition: Target.h:63
lldb_private::EvaluateExpressionOptions::SetCancelCallback
void SetCancelCallback(lldb::ExpressionCancelCallback callback, void *baton)
Definition: Target.h:370
lldb_private::Target::m_watchpoint_list
WatchpointList m_watchpoint_list
Definition: Target.h:1451
lldb_private::Target::StopHook::GetTarget
lldb::TargetSP & GetTarget()
Definition: Target.h:1227
lldb_private::Module
Definition: Module.h:85
lldb_private::Target::StopHookScripted::m_extra_args
StructuredDataImpl m_extra_args
This holds the dictionary of keys & values that can be used to parametrize any given callback's behav...
Definition: Target.h:1313
lldb_private::Target::GetScratchTypeSystemForLanguage
llvm::Expected< TypeSystem & > GetScratchTypeSystemForLanguage(lldb::LanguageType language, bool create_on_demand=true)
Definition: Target.cpp:2261
lldb_private::Target::GetReasonableReadSize
lldb::addr_t GetReasonableReadSize(const Address &addr)
Return a recommended size for memory reads at addr, optimizing for cache usage.
Definition: Target.cpp:1906
lldb_private::Target::GetImageSearchPathList
PathMappingList & GetImageSearchPathList()
Definition: Target.cpp:2248
lldb_private::Target::StopHookCommandLine::SetActionFromString
void SetActionFromString(const std::string &strings)
Definition: Target.cpp:3429
lldb_private::Target::TargetEventData::GetEventDataFromEvent
static const TargetEventData * GetEventDataFromEvent(const Event *event_ptr)
Definition: Target.cpp:4478
lldb_private::ValueList
Definition: Value.h:157
lldb_private::Target::m_platform_sp
lldb::PlatformSP m_platform_sp
The platform for this target.
Definition: Target.h:1432
lldb_private::BreakpointName
Definition: BreakpointName.h:30
lldb_private::Target::CreateExceptionBreakpoint
lldb::BreakpointSP CreateExceptionBreakpoint(enum lldb::LanguageType language, bool catch_bp, bool throw_bp, bool internal, Args *additional_args=nullptr, Status *additional_args_error=nullptr)
Definition: Target.cpp:580
Disassembler.h
lldb_private::TargetProperties::SetDebugUtilityExpression
void SetDebugUtilityExpression(bool debug)
Definition: Target.cpp:4447
lldb_private::UserExpression
Definition: UserExpression.h:35
lldb_private::TargetProperties::InputPathValueChangedCallback
void InputPathValueChangedCallback()
Definition: Target.cpp:4398
lldb_private::Target::GetTargetFromContexts
static Target * GetTargetFromContexts(const ExecutionContext *exe_ctx_ptr, const SymbolContext *sc_ptr)
Definition: Target.cpp:2428
lldb_private::Target::m_scratch_type_system_map
TypeSystemMap m_scratch_type_system_map
Definition: Target.h:1459
lldb_private::eLoadScriptFromSymFileTrue
@ eLoadScriptFromSymFileTrue
Definition: Target.h:51
lldb_private::Target::ReadMemoryFromFileCache
size_t ReadMemoryFromFileCache(const Address &addr, void *dst, size_t dst_len, Status &error)
Definition: Target.cpp:1685
lldb_private::Stream
Definition: Stream.h:28
lldb_private::Target::GetWatchpointList
WatchpointList & GetWatchpointList()
Definition: Target.h:722
lldb_private::Args
Definition: Args.h:33
lldb_private::Target::CreateBreakpoint
lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules, const FileSpec &file, uint32_t line_no, uint32_t column, lldb::addr_t offset, LazyBool check_inlines, LazyBool skip_prologue, bool internal, bool request_hardware, LazyBool move_to_nearest_code)
Definition: Target.cpp:331
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::EvaluateExpressionOptions::m_one_thread_timeout
Timeout< std::micro > m_one_thread_timeout
Definition: Target.h:441
lldb_private::EvaluateExpressionOptions::m_generate_debug_info
bool m_generate_debug_info
Definition: Target.h:430
lldb_private::StackFrameRecognizerManager
Class that provides a registry of known stack frame recognizers.
Definition: StackFrameRecognizer.h:101
lldb_private::LazyBool
LazyBool
Definition: lldb-private-enumerations.h:115
lldb_private::Target::GetBreakpointList
BreakpointList & GetBreakpointList(bool internal=false)
Definition: Target.cpp:289
lldb_private::eExecutionPolicyAlways
@ eExecutionPolicyAlways
Definition: lldb-private-enumerations.h:147
lldb_private::EvaluateExpressionOptions::GetAutoApplyFixIts
bool GetAutoApplyFixIts() const
Definition: Target.h:405
lldb_private::Target::SerializeBreakpointsToFile
Status SerializeBreakpointsToFile(const FileSpec &file, const BreakpointIDList &bp_ids, bool append)
Definition: Target.cpp:987
lldb_private::Target::GetDebugger
Debugger & GetDebugger()
Definition: Target.h:1001
lldb_private::Target::FinalizeFileActions
void FinalizeFileActions(ProcessLaunchInfo &info)
Definition: Target.cpp:3252
lldb_private::Target::DidExec
void DidExec()
Called as the last function in Process::DidExec().
Definition: Target.cpp:1387
lldb_private::Target::m_source_manager_up
lldb::SourceManagerUP m_source_manager_up
Definition: Target.h:1464
lldb_private::EvaluateExpressionOptions::m_stop_others
bool m_stop_others
Definition: Target.h:426
lldb_private::Target::ResolveLoadAddress
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, uint32_t stop_id=SectionLoadHistory::eStopIDNow)
Definition: Target.cpp:2882
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::Target
Definition: Target.h:452
lldb_private::Target::StopHook::m_active
bool m_active
Definition: Target.h:1268
lldb_private::TargetProperties::GetMaximumNumberOfChildrenToDisplay
uint32_t GetMaximumNumberOfChildrenToDisplay() const
Definition: Target.cpp:4176
lldb_private::EvaluateExpressionOptions::SetRetriesWithFixIts
void SetRetriesWithFixIts(uint64_t number_of_retries)
Definition: Target.h:407
lldb_private::EvaluateExpressionOptions::GetREPLEnabled
bool GetREPLEnabled() const
Definition: Target.h:366
lldb_private::Target::GetFunctionCallerForLanguage
FunctionCaller * GetFunctionCallerForLanguage(lldb::LanguageType language, const CompilerType &return_type, const Address &function_address, const ValueList &arg_value_list, const char *name, Status &error)
Definition: Target.cpp:2357
lldb_private::TargetProperties::GetStandardErrorPath
FileSpec GetStandardErrorPath() const
Definition: Target.cpp:4214
lldb_private::Target::m_debugger
Debugger & m_debugger
Definition: Target.h:1431
lldb_private::Target::StopHookCommandLine::GetSubclassDescription
void GetSubclassDescription(Stream *s, lldb::DescriptionLevel level) const override
Definition: Target.cpp:3410
lldb_private::Target::CreateProcess
const lldb::ProcessSP & CreateProcess(lldb::ListenerSP listener_sp, llvm::StringRef plugin_name, const FileSpec *crash_file, bool can_connect)
Definition: Target.cpp:199
lldb_private::EvaluateExpressionOptions::SetResultIsInternal
void SetResultIsInternal(bool b)
Definition: Target.h:399
lldb_private::Target::GetImages
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition: Target.h:926
lldb_private::AddressClass::eInvalid
@ eInvalid
lldb_private::Target::m_private_mutex
std::recursive_mutex m_private_mutex
When the private state thread calls SB API's - usually because it is running OS plugin or Python Thre...
Definition: Target.h:1440
lldb_private::Target::StopHook::StopHookResult::RequestContinue
@ RequestContinue
lldb_private::Target::GetPersistentVariable
lldb::ExpressionVariableSP GetPersistentVariable(ConstString name)
Definition: Target.cpp:2506
lldb_private::TargetProperties::SetDisableSTDIO
void SetDisableSTDIO(bool b)
Definition: Target.cpp:3954
lldb_private::EvaluateExpressionOptions::default_timeout
static constexpr std::chrono::milliseconds default_timeout
Definition: Target.h:270
lldb_private::EvaluateExpressionOptions::GetGenerateDebugInfo
bool GetGenerateDebugInfo() const
Definition: Target.h:354
Broadcaster.h
lldb_private::EvaluateExpressionOptions::EvaluateExpressionOptions
EvaluateExpressionOptions()=default
lldb_private::Target::StopHook::m_specifier_sp
lldb::SymbolContextSpecifierSP m_specifier_sp
Definition: Target.h:1266
lldb_private::eLoadScriptFromSymFileWarn
@ eLoadScriptFromSymFileWarn
Definition: Target.h:53
lldb_private::Target::TargetEventData::GetFlavorString
static ConstString GetFlavorString()
Definition: Target.cpp:4463
lldb_private::Expression::ResultType
ResultType
Definition: Expression.h:35
lldb_private::TargetProperties::GetDisableSTDIO
bool GetDisableSTDIO() const
Definition: Target.cpp:3948
lldb_private::Target::GetSuppressStopHooks
bool GetSuppressStopHooks()
Definition: Target.h:1347
lldb_private::Target::IgnoreWatchpointByID
bool IgnoreWatchpointByID(lldb::watch_id_t watch_id, uint32_t ignore_count)
Definition: Target.cpp:1328
lldb_private::EvaluateExpressionOptions::m_result_is_internal
bool m_result_is_internal
Definition: Target.h:432
lldb_private::Target::Arch::Arch
Arch(const ArchSpec &spec)
Definition: Target.cpp:73
lldb_private::Properties
Definition: UserSettingsController.h:33
lldb_private::Target::GetStopHookByID
StopHookSP GetStopHookByID(lldb::user_id_t uid)
Definition: Target.cpp:2629
lldb_private::Target::StopHook::GetSubclassDescription
virtual void GetSubclassDescription(Stream *s, lldb::DescriptionLevel level) const =0
lldb_private::Target::GetPlatform
lldb::PlatformSP GetPlatform()
Definition: Target.h:1373
lldb_private::EvaluateExpressionOptions::GetUseDynamic
lldb::DynamicValueType GetUseDynamic() const
Definition: Target.h:319
BreakpointList.h
lldb_private::Target::m_next_persistent_variable_index
unsigned m_next_persistent_variable_index
Definition: Target.h:1474
lldb_private::FileSpec
Definition: FileSpec.h:56
lldb_private::Target::GetLastCreatedBreakpoint
lldb::BreakpointSP GetLastCreatedBreakpoint()
Definition: Target.h:612
lldb_private::TargetProperties::SetPreferDynamicValue
bool SetPreferDynamicValue(lldb::DynamicValueType d)
Definition: Target.cpp:3899
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::EvaluateExpressionOptions::m_execution_policy
ExecutionPolicy m_execution_policy
Definition: Target.h:418
lldb_private::Target::GetSearchFilterForModule
lldb::SearchFilterSP GetSearchFilterForModule(const FileSpec *containingModule)
Definition: Target.cpp:508
lldb_private::TargetProperties::DisableASLRValueChangedCallback
void DisableASLRValueChangedCallback()
Definition: Target.cpp:4420
lldb_private::TargetProperties::GetPreferDynamicValue
lldb::DynamicValueType GetPreferDynamicValue() const
Definition: Target.cpp:3892
lldb_private::TargetProperties::GetArg0
llvm::StringRef GetArg0() const
Definition: Target.cpp:3976
lldb_private::Target::GetStopHookAtIndex
StopHookSP GetStopHookAtIndex(size_t index)
Definition: Target.h:1361
lldb_private::TargetExperimentalProperties
Definition: Target.h:74
lldb_private::Target::ReadUnsignedIntegerFromMemory
uint64_t ReadUnsignedIntegerFromMemory(const Address &addr, size_t integer_byte_size, uint64_t fail_value, Status &error, bool force_live_memory=false)
Definition: Target.cpp:1997
lldb_private::TargetProperties::GetDisplayRecognizedArguments
bool GetDisplayRecognizedArguments() const
Definition: Target.cpp:4325
lldb_private::eInlineBreakpointsNever
@ eInlineBreakpointsNever
Definition: Target.h:45
lldb_private::eImportStdModuleFalse
@ eImportStdModuleFalse
Definition: Target.h:69
ModuleList.h
LLDBAssert.h
lldb_private::TargetProperties
Definition: Target.h:79
lldb_private::Target::m_arch
Arch m_arch
Definition: Target.h:1441
lldb_private::Target::m_images
ModuleList m_images
The list of images for this process (shared libraries and anything dynamically loaded).
Definition: Target.h:1442
lldb_private::TargetProperties::GetSkipPrologue
bool GetSkipPrologue() const
Definition: Target.cpp:4077
lldb_private::Target::CreateSourceRegexBreakpoint
lldb::BreakpointSP CreateSourceRegexBreakpoint(const FileSpecList *containingModules, const FileSpecList *source_file_list, const std::unordered_set< std::string > &function_names, RegularExpression source_regex, bool internal, bool request_hardware, LazyBool move_to_nearest_code)
Definition: Target.cpp:314
lldb_private::ProcessLaunchInfo
Definition: ProcessLaunchInfo.h:31
lldb_private::ModuleList
Definition: ModuleList.h:79
lldb_private::TargetProperties::DetachOnErrorValueChangedCallback
void DetachOnErrorValueChangedCallback()
Definition: Target.cpp:4413
lldb_private::EvaluateExpressionOptions::default_execution_policy
static constexpr ExecutionPolicy default_execution_policy
Definition: Target.h:275
lldb_private::SymbolContextSpecifier
Definition: SymbolContext.h:328
lldb_private::Target::CreateBreakpointsFromFile
Status CreateBreakpointsFromFile(const FileSpec &file, BreakpointIDList &new_bps)
Definition: Target.cpp:1079
lldb_private::ExecutionContextScope
Definition: ExecutionContextScope.h:32
lldb_private::Target::RemoveAllStopHooks
void RemoveAllStopHooks()
Definition: Target.cpp:2627
lldb_private::Target::GetBroadcasterClass
ConstString & GetBroadcasterClass() const override
This needs to be filled in if you are going to register the broadcaster with the broadcaster manager ...
Definition: Target.h:474
lldb_private::Target::GetAPIMutex
std::recursive_mutex & GetAPIMutex()
Definition: Target.cpp:4505
lldb_private::TargetProperties::GetDetachOnError
bool GetDetachOnError() const
Definition: Target.cpp:3937
lldb_private::Target::GetLastCreatedWatchpoint
lldb::WatchpointSP GetLastCreatedWatchpoint()
Definition: Target.h:718
lldb_private::eLoadDependentsNo
@ eLoadDependentsNo
Definition: Target.h:65
lldb_private::TargetProperties::SetRunArguments
void SetRunArguments(const Args &args)
Definition: Target.cpp:3993
lldb_private::Target::SetSectionLoadAddress
bool SetSectionLoadAddress(const lldb::SectionSP &section, lldb::addr_t load_addr, bool warn_multiple=false)
Definition: Target.cpp:2892
ThreadSpec.h
lldb_private::Target::EnableAllBreakpoints
void EnableAllBreakpoints(bool internal_also=false)
Definition: Target.cpp:913
lldb_private::TargetProperties::GetInlineStrategy
InlineStrategy GetInlineStrategy() const
Definition: Target.cpp:3970
lldb_private::Target::StopHook::GetThreadSpecifier
ThreadSpec * GetThreadSpecifier()
Definition: Target.h:1248
lldb_private::Target::Arch::GetPlugin
Architecture * GetPlugin() const
Definition: Target.h:1424
lldb_private::EvaluateExpressionOptions::m_cancel_callback_baton
void * m_cancel_callback_baton
Definition: Target.h:443
lldb_private::Target::StopHookCommandLine::~StopHookCommandLine
virtual ~StopHookCommandLine()=default
lldb_private::Target::eBroadcastBitSymbolsLoaded
@ eBroadcastBitSymbolsLoaded
Definition: Target.h:467
lldb_private::StructuredData::ObjectSP
std::shared_ptr< Object > ObjectSP
Definition: StructuredData.h:59
lldb_private::Target::StopHookCommandLine
Definition: Target.h:1274
lldb_private::Target::m_image_search_paths
PathMappingList m_image_search_paths
Definition: Target.h:1458
lldb_private::TargetProperties::RunArgsValueChangedCallback
void RunArgsValueChangedCallback()
Definition: Target.cpp:4388
lldb_private::TargetProperties::UpdateLaunchInfoFromProperties
void UpdateLaunchInfoFromProperties()
Definition: Target.cpp:3834
lldb_private::Target::ClearAllLoadedSections
void ClearAllLoadedSections()
Definition: Target.cpp:2963
lldb_private::Target::EnableAllowedBreakpoints
void EnableAllowedBreakpoints()
Definition: Target.cpp:923
lldb_private::EvaluateExpressionOptions::m_try_others
bool m_try_others
Definition: Target.h:425
lldb_private::EvaluateExpressionOptions::m_retries_with_fixits
uint64_t m_retries_with_fixits
Definition: Target.h:434
lldb_private::TypeSystemMap
Definition: TypeSystem.h:506
lldb_private::Target::GetBreakableLoadAddress
lldb::addr_t GetBreakableLoadAddress(lldb::addr_t addr)
Definition: Target.cpp:2589
lldb_private::EvaluateExpressionOptions::m_coerce_to_id
bool m_coerce_to_id
Definition: Target.h:421
lldb_private::Target::ResolveFileAddress
bool ResolveFileAddress(lldb::addr_t load_addr, Address &so_addr)
Definition: Target.cpp:2887
lldb_private::TargetProperties::SetStandardOutputPath
void SetStandardOutputPath(llvm::StringRef path)
Definition: Target.cpp:4209
lldb_private::Target::CleanupProcess
void CleanupProcess()
Definition: Target.cpp:170
lldb_private::Target::TargetEventData::~TargetEventData
~TargetEventData() override
lldb::break_id_t
int32_t break_id_t
Definition: lldb-types.h:88
lldb_private::Target::CreateUtilityFunction
llvm::Expected< std::unique_ptr< UtilityFunction > > CreateUtilityFunction(std::string expression, std::string name, lldb::LanguageType language, ExecutionContext &exe_ctx)
Creates and installs a UtilityFunction for the given language.
Definition: Target.cpp:2381
lldb_private::Target::SetSuppresStopHooks
bool SetSuppresStopHooks(bool suppress)
Definition: Target.h:1341
lldb_private::BreakpointName::Permissions
Definition: BreakpointName.h:32
lldb_private::Target::m_process_sp
lldb::ProcessSP m_process_sp
Definition: Target.h:1456
lldb_private::Target::RunStopHooks
bool RunStopHooks()
Definition: Target.cpp:2657
lldb_private::StringList
Definition: StringList.h:26
lldb_private::Target::DeleteCurrentProcess
void DeleteCurrentProcess()
Definition: Target.cpp:185
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::Target::StopHook::StopHookKind::CommandBased
@ CommandBased
lldb_private::Target::StopHook::StopHookResult::AlreadyContinued
@ AlreadyContinued
lldb_private::TargetProperties::SetStandardErrorPath
void SetStandardErrorPath(llvm::StringRef path)
Definition: Target.cpp:4219
lldb_private::Target::CreateAddressInModuleBreakpoint
lldb::BreakpointSP CreateAddressInModuleBreakpoint(lldb::addr_t file_addr, bool internal, const FileSpec *file_spec, bool request_hardware)
Definition: Target.cpp:417
lldb_private::BreakpointOptions
Definition: BreakpointOptions.h:27
lldb_private::Target::GetCallableLoadAddress
lldb::addr_t GetCallableLoadAddress(lldb::addr_t load_addr, AddressClass addr_class=AddressClass::eInvalid) const
Get load_addr as a callable code load address for this target.
Definition: Target.cpp:2574
lldb_private::Target::DisableAllWatchpoints
bool DisableAllWatchpoints(bool end_to_end=true)
Definition: Target.cpp:1175
lldb_private::Target::GetImages
ModuleList & GetImages()
Definition: Target.h:928
lldb_private::EvaluateExpressionOptions::SetColorizeErrors
void SetColorizeErrors(bool b)
Definition: Target.h:360
lldb_private::EvaluateExpressionOptions::m_ansi_color_errors
bool m_ansi_color_errors
Definition: Target.h:431
lldb_private::Target::m_is_dummy_target
bool m_is_dummy_target
Used to not run stop hooks for expressions.
Definition: Target.h:1473
lldb_private::Target::AddNameToBreakpoint
void AddNameToBreakpoint(BreakpointID &id, const char *name, Status &error)
Definition: Target.cpp:665
lldb_private::Target::NotifyModuleUpdated
void NotifyModuleUpdated(const ModuleList &module_list, const lldb::ModuleSP &old_module_sp, const lldb::ModuleSP &new_module_sp) override
Definition: Target.cpp:1594
lldb_private::Target::Dump
void Dump(Stream *s, lldb::DescriptionLevel description_level)
Dump a description of this object to a Stream.
Definition: Target.cpp:151
lldb_private::EvaluateExpressionOptions::SetTryAllThreads
void SetTryAllThreads(bool try_others=true)
Definition: Target.h:340
lldb_private::EvaluateExpressionOptions::m_keep_in_memory
bool m_keep_in_memory
Definition: Target.h:424
lldb_private::StructuredDataImpl
Definition: StructuredDataImpl.h:26
lldb_private::TargetProperties::GetRunArguments
bool GetRunArguments(Args &args) const
Definition: Target.cpp:3988
lldb_private::Target::m_last_created_watchpoint
lldb::WatchpointSP m_last_created_watchpoint
Definition: Target.h:1452
lldb_private::Target::m_internal_breakpoint_list
BreakpointList m_internal_breakpoint_list
Definition: Target.h:1446
lldb_private::Target::StopHookSP
std::shared_ptr< StopHook > StopHookSP
Definition: Target.h:1325
lldb_private::Target::NotifyModuleAdded
void NotifyModuleAdded(const ModuleList &module_list, const lldb::ModuleSP &module_sp) override
Implementing of ModuleList::Notifier.
Definition: Target.cpp:1574
lldb_private::Target::ApplyNameToBreakpoints
void ApplyNameToBreakpoints(BreakpointName &bp_name)
Definition: Target.cpp:741
lldb::ExpressionEvaluationPhase
ExpressionEvaluationPhase
Expression Evaluation Stages.
Definition: lldb-enumerations.h:955
lldb_private::TargetProperties::Arg0ValueChangedCallback
void Arg0ValueChangedCallback()
Definition: Target.cpp:4384
lldb_private::Target::StopHook::StopHookResult::KeepStopped
@ KeepStopped
lldb_private::Target::SetArchitecture
bool SetArchitecture(const ArchSpec &arch_spec, bool set_platform=false)
Set the architecture for this target.
Definition: Target.cpp:1459
lldb_private::Target::StopHookCollection
std::map< lldb::user_id_t, StopHookSP > StopHookCollection
Definition: Target.h:1466
lldb_private::TargetProperties::GetMoveToNearestCode
bool GetMoveToNearestCode() const
Definition: Target.cpp:3886
lldb::DynamicValueType
DynamicValueType
Definition: lldb-enumerations.h:494
lldb_private::TargetProperties::GetExpressionPrefixContents
llvm::StringRef GetExpressionPrefixContents()
Definition: Target.cpp:4233
lldb_private::Debugger
Definition: Debugger.h:70
lldb_private::eLoadCWDlldbinitWarn
@ eLoadCWDlldbinitWarn
Definition: Target.h:59
lldb_private::SectionLoadList
Definition: SectionLoadList.h:22
lldb_private::Target::eBroadcastBitModulesLoaded
@ eBroadcastBitModulesLoaded
Definition: Target.h:464
lldb_private::TargetProperties::InheritTCCValueChangedCallback
void InheritTCCValueChangedCallback()
Definition: Target.cpp:4427
lldb_private::Target::DisableAllowedBreakpoints
void DisableAllowedBreakpoints()
Definition: Target.cpp:906
lldb_private::Target::CreateTrace
llvm::Expected< lldb::TraceSP > CreateTrace()
Create a Trace object for the current target using the using the default supported tracing technology...
Definition: Target.cpp:3138
lldb_private::Target::GetPersistentExpressionStateForLanguage
PersistentExpressionState * GetPersistentExpressionStateForLanguage(lldb::LanguageType language)
Definition: Target.cpp:2319
lldb_private::Target::ProcessIsValid
bool ProcessIsValid()
Definition: Target.cpp:764
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb::watch_id_t
int32_t watch_id_t
Definition: lldb-types.h:89
lldb_private::eLoadCWDlldbinitTrue
@ eLoadCWDlldbinitTrue
Definition: Target.h:57
lldb_private::TargetProperties::EnvVarsValueChangedCallback
void EnvVarsValueChangedCallback()
Definition: Target.cpp:4394
lldb_private::EvaluateExpressionOptions::SetUnwindOnError
void SetUnwindOnError(bool unwind=false)
Definition: Target.h:307
lldb_private::EvaluateExpressionOptions::SetKeepInMemory
void SetKeepInMemory(bool keep=true)
Definition: Target.h:317
lldb_private::Target::CreateWatchpoint
lldb::WatchpointSP CreateWatchpoint(lldb::addr_t addr, size_t size, const CompilerType *type, uint32_t kind, Status &error)
Definition: Target.cpp:789
TypeSystem.h
lldb_private::Target::m_breakpoint_names
BreakpointNameList m_breakpoint_names
Definition: Target.h:1448
lldb_private::Target::SetTrace
void SetTrace(const lldb::TraceSP &trace_sp)
Set the Trace object containing processor trace information of this target.
Definition: Target.cpp:3134
lldb_private::EvaluateExpressionOptions::IsForUtilityExpr
bool IsForUtilityExpr() const
Definition: Target.h:413
lldb_private::TargetProperties::SetInjectLocalVariables
void SetInjectLocalVariables(ExecutionContext *exe_ctx, bool b)
Definition: Target.cpp:3860
lldb_private::Target::GetOpcodeLoadAddress
lldb::addr_t GetOpcodeLoadAddress(lldb::addr_t load_addr, AddressClass addr_class=AddressClass::eInvalid) const
Get load_addr as an opcode for this target.
Definition: Target.cpp:2582
lldb_private::Target::ReadStringFromMemory
size_t ReadStringFromMemory(const Address &addr, char *dst, size_t max_bytes, Status &error, size_t type_width, bool force_live_memory=true)
Read a NULL terminated string from memory.
Definition: Target.cpp:1919
lldb_private::TargetProperties::ErrorPathValueChangedCallback
void ErrorPathValueChangedCallback()
Definition: Target.cpp:4408
lldb_private::TargetProperties::GetDisplayRuntimeSupportValues
bool GetDisplayRuntimeSupportValues() const
Definition: Target.cpp:4315
lldb_private::ThreadSpec
Definition: ThreadSpec.h:33
lldb_private::TargetProperties::SetProcessLaunchInfo
void SetProcessLaunchInfo(const ProcessLaunchInfo &launch_info)
Definition: Target.cpp:4339
lldb_private::Target::m_mutex
std::recursive_mutex m_mutex
An API mutex that is used by the lldb::SB* classes make the SB interface thread safe.
Definition: Target.h:1433
lldb_private::EvaluateExpressionOptions::m_running_utility_expression
bool m_running_utility_expression
True if the executed code should be treated as utility code that is only used by LLDB internally.
Definition: Target.h:437
lldb_private::TargetProperties::GetEnableAutoApplyFixIts
bool GetEnableAutoApplyFixIts() const
Definition: Target.cpp:4140
lldb_private::SectionLoadHistory
Definition: SectionLoadHistory.h:19
lldb_private::ProcessAttachInfo
Definition: Process.h:113
lldb_private::Target::m_breakpoint_list
BreakpointList m_breakpoint_list
Definition: Target.h:1445
lldb_private::Target::SetExecutableModule
void SetExecutableModule(lldb::ModuleSP &module_sp, LoadDependentFiles load_dependent_files=eLoadDependentsDefault)
Set the main executable module.
Definition: Target.cpp:1393
lldb_private::TargetProperties::GetProcessLaunchInfo
const ProcessLaunchInfo & GetProcessLaunchInfo() const
Definition: Target.cpp:4335
lldb_private::Target::TargetEventData::m_module_list
ModuleList m_module_list
Definition: Target.h:509
lldb_private::eLoadDependentsYes
@ eLoadDependentsYes
Definition: Target.h:64
lldb_private::TargetProperties::GetDebugFileSearchPaths
FileSpecList GetDebugFileSearchPaths()
Definition: Target.cpp:4110
lldb_private::EvaluateExpressionOptions::SetIgnoreBreakpoints
void SetIgnoreBreakpoints(bool ignore=false)
Definition: Target.h:311
lldb_private::TargetExperimentalProperties::TargetExperimentalProperties
TargetExperimentalProperties()
Definition: Target.cpp:3767
lldb_private::Target::GetStaticBroadcasterClass
static ConstString & GetStaticBroadcasterClass()
Definition: Target.cpp:83
lldb_private::Target::Attach
Status Attach(ProcessAttachInfo &attach_info, Stream *stream)
Definition: Target.cpp:3169
lldb_private::Target::SettingsTerminate
static void SettingsTerminate()
Definition: Target.cpp:2407
lldb_private::Target::GetProcessSP
const lldb::ProcessSP & GetProcessSP() const
Definition: Target.cpp:211
lldb_private::TargetProperties::GetDebugUtilityExpression
bool GetDebugUtilityExpression() const
Definition: Target.cpp:4441
lldb_private::Target::DisableWatchpointByID
bool DisableWatchpointByID(lldb::watch_id_t watch_id)
Definition: Target.cpp:1274
lldb_private::Target::Launch
Status Launch(ProcessLaunchInfo &launch_info, Stream *stream)
Definition: Target.cpp:2965
lldb_private::Target::GetTraceOrCreate
llvm::Expected< lldb::TraceSP > GetTraceOrCreate()
If a Trace object is present, this returns it, otherwise a new Trace is created with Trace::CreateTra...
Definition: Target.cpp:3163
lldb_private::Target::GetArchitecturePlugin
Architecture * GetArchitecturePlugin() const
Definition: Target.h:999
lldb_private::Target::GetDefaultExecutableSearchPaths
static FileSpecList GetDefaultExecutableSearchPaths()
Definition: Target.cpp:2409
lldb_private::SectionLoadHistory::GetCurrentSectionLoadList
SectionLoadList & GetCurrentSectionLoadList()
Definition: SectionLoadHistory.cpp:95
lldb_private::Target::StopHook::SetSpecifier
void SetSpecifier(SymbolContextSpecifier *specifier)
Definition: Target.cpp:3344
lldb_private::ModuleSpec
Definition: ModuleSpec.h:26
lldb_private::Target::GetArchitecture
const ArchSpec & GetArchitecture() const
Definition: Target.h:968
lldb_private::Target::SetSectionUnloaded
bool SetSectionUnloaded(const lldb::SectionSP &section_sp)
Definition: Target.cpp:2941
lldb_private::EvaluateExpressionOptions::SetOneThreadTimeout
void SetOneThreadTimeout(const Timeout< std::micro > &timeout)
Definition: Target.h:334
lldb_private::Target::GetStopHookSize
size_t GetStopHookSize()
lldb_private::Status
Definition: Status.h:44
lldb_private::EvaluateExpressionOptions::m_trap_exceptions
bool m_trap_exceptions
Definition: Target.h:428
lldb_private::WatchpointList
Definition: WatchpointList.h:27
lldb_private::ValueObject
ValueObject:
Definition: ValueObject.h:105
lldb_private::TargetProperties::GetEnvironment
Environment GetEnvironment() const
Definition: Target.cpp:4028
lldb_private::EvaluateExpressionOptions::GetLanguage
lldb::LanguageType GetLanguage() const
Definition: Target.h:286
lldb_private::Target::CreateStopHook
StopHookSP CreateStopHook(StopHook::StopHookKind kind)
Add an empty stop hook to the Target's stop hook list, and returns a shared pointer to it in new_hook...
Definition: Target.cpp:2600
lldb_private::Timeout< std::micro >
lldb_private::TargetProperties::GetLoadCWDlldbinitFile
LoadCWDlldbinitFile GetLoadCWDlldbinitFile() const
Definition: Target.cpp:4285
lldb_private::Target::GetDefaultArchitecture
static ArchSpec GetDefaultArchitecture()
Definition: Target.cpp:2417
lldb_private::Target::ReadMemory
size_t ReadMemory(const Address &addr, void *dst, size_t dst_len, Status &error, bool force_live_memory=false, lldb::addr_t *load_addr_ptr=nullptr)
Definition: Target.cpp:1718
lldb_private::Target::Install
Status Install(ProcessLaunchInfo *launch_info)
Definition: Target.cpp:2834
lldb_private::Target::IsValid
bool IsValid()
Definition: Target.h:596
lldb_private::Target::AddBreakpointName
void AddBreakpointName(BreakpointName *bp_name)
Definition: Target.cpp:691
lldb_private::EvaluateExpressionOptions::m_pound_line_line
uint32_t m_pound_line_line
Definition: Target.h:448
lldb_private::EvaluateExpressionOptions::m_use_dynamic
lldb::DynamicValueType m_use_dynamic
Definition: Target.h:439
lldb::eLanguageTypeUnknown
@ eLanguageTypeUnknown
Unknown or invalid language value.
Definition: lldb-enumerations.h:437
lldb_private::TargetProperties::GetEnableAutoImportClangModules
bool GetEnableAutoImportClangModules() const
Definition: Target.cpp:4128
lldb_private::Target::SetREPL
void SetREPL(lldb::LanguageType language, lldb::REPLSP repl_sp)
Definition: Target.cpp:263
lldb_private::Target::GetREPL
lldb::REPLSP GetREPL(Status &err, lldb::LanguageType language, const char *repl_options, bool can_create)
Definition: Target.cpp:213
uint32_t
lldb_private::Target::ImageSearchPathsChanged
static void ImageSearchPathsChanged(const PathMappingList &path_list, void *baton)
Definition: Target.cpp:2252
lldb_private::Target::CalculateExecutionContext
void CalculateExecutionContext(ExecutionContext &exe_ctx) override
Reconstruct the object's execution context into sc.
Definition: Target.cpp:2243
lldb_private::EvaluateExpressionOptions::GetStopOthers
bool GetStopOthers() const
Definition: Target.h:342
lldb_private::Target::GetStatistics
TargetStats & GetStatistics()
Definition: Target.h:1501
lldb_private::EvaluateExpressionOptions::SetUseDynamic
void SetUseDynamic(lldb::DynamicValueType dynamic=lldb::eDynamicCanRunTarget)
Definition: Target.h:322
lldb_private::PathMappingList
Definition: PathMappingList.h:19
UserSettingsController.h
lldb_private::EvaluateExpressionOptions::SetCoerceToId
void SetCoerceToId(bool coerce=true)
Definition: Target.h:303
lldb_private::Target::RemoveAllBreakpoints
void RemoveAllBreakpoints(bool internal_also=false)
Definition: Target.cpp:884
lldb_private::TargetProperties::m_target
Target * m_target
Definition: Target.h:257
lldb_private::Address
Definition: Address.h:59
lldb_private::Target::GetPersistentSymbol
lldb::addr_t GetPersistentSymbol(ConstString name)
Definition: Target.cpp:2522
lldb_private::Target::ModulesDidLoad
void ModulesDidLoad(ModuleList &module_list)
Definition: Target.cpp:1610
lldb_private::eInlineBreakpointsAlways
@ eInlineBreakpointsAlways
Definition: Target.h:47
lldb_private::TargetProperties::AppendExecutableSearchPaths
void AppendExecutableSearchPaths(const FileSpec &)
Definition: Target.cpp:4092
lldb_private::Target::EvaluateExpression
lldb::ExpressionResults EvaluateExpression(llvm::StringRef expression, ExecutionContextScope *exe_scope, lldb::ValueObjectSP &result_valobj_sp, const EvaluateExpressionOptions &options=EvaluateExpressionOptions(), std::string *fixed_expression=nullptr, ValueObject *ctx_obj=nullptr)
Definition: Target.cpp:2442
lldb_private::Target::StopHook
Definition: Target.h:1215
lldb_private::EvaluateExpressionOptions::m_prefix
std::string m_prefix
Definition: Target.h:420
lldb_private::TargetProperties::GetImportStdModule
ImportStdModule GetImportStdModule() const
Definition: Target.cpp:4134
lldb_private::BreakpointID
Definition: BreakpointID.h:22
lldb_private::TargetProperties::GetHexImmediateStyle
Disassembler::HexImmediateStyle GetHexImmediateStyle() const
Definition: Target.cpp:4291
lldb_private::TargetProperties::m_launch_info
ProcessLaunchInfo m_launch_info
Definition: Target.h:255
lldb_private::SectionLoadHistory::eStopIDNow
@ eStopIDNow
Definition: SectionLoadHistory.h:24
lldb_private::EvaluateExpressionOptions::m_debug
bool m_debug
Definition: Target.h:427
lldb_private::Target::GetSearchFilterForModuleAndCUList
lldb::SearchFilterSP GetSearchFilterForModuleAndCUList(const FileSpecList *containingModules, const FileSpecList *containingSourceFiles)
Definition: Target.cpp:543
lldb_private::Target::m_stop_hooks
StopHookCollection m_stop_hooks
Definition: Target.h:1467
lldb_private::Disassembler::HexImmediateStyle
HexImmediateStyle
Definition: Disassembler.h:381
lldb_private::Target::eBroadcastBitBreakpointChanged
@ eBroadcastBitBreakpointChanged
Definition: Target.h:463
ExecutionContextScope.h
lldb_private::EvaluateExpressionOptions::m_language
lldb::LanguageType m_language
Definition: Target.h:419
lldb_private::Target::TargetEventData::operator=
const TargetEventData & operator=(const TargetEventData &)=delete
lldb_private::Target::StopHook::IsActive
bool IsActive()
Definition: Target.h:1250
lldb_private::Target::StopHookScripted::StopHookScripted
StopHookScripted(lldb::TargetSP target_sp, lldb::user_id_t uid)
Use CreateStopHook to make a new empty stop hook.
Definition: Target.h:1320
lldb_private::Target::GetSearchFilterForModuleList
lldb::SearchFilterSP GetSearchFilterForModuleList(const FileSpecList *containingModuleList)
Definition: Target.cpp:526
lldb_private::Target::TargetEventData::GetModuleList
const ModuleList & GetModuleList() const
Definition: Target.h:505
ArchSpec.h
lldb_private::Target::IsDummyTarget
bool IsDummyTarget() const
Definition: Target.h:529
lldb_private::Target::ClearAllWatchpointHitCounts
bool ClearAllWatchpointHitCounts()
Definition: Target.cpp:1228
lldb_private::TargetProperties::GetBreakpointsConsultPlatformAvoidList
bool GetBreakpointsConsultPlatformAvoidList()
Definition: Target.cpp:4254
lldb_private::Environment
Definition: Environment.h:18
lldb_private::EvaluateExpressionOptions::GetTryAllThreads
bool GetTryAllThreads() const
Definition: Target.h:338
Timeout.h
lldb_private::eLoadCWDlldbinitFalse
@ eLoadCWDlldbinitFalse
Definition: Target.h:58
lldb_private::EvaluateExpressionOptions::SetGenerateDebugInfo
void SetGenerateDebugInfo(bool b)
Definition: Target.h:356
lldb_private::Target::StopHookScripted::m_implementation_sp
StructuredData::GenericSP m_implementation_sp
This holds the python callback object.
Definition: Target.h:1315
lldb_private::Target::StopHook::ExecutionContextPasses
bool ExecutionContextPasses(const ExecutionContext &exe_ctx)
Definition: Target.cpp:3352
lldb_private::Target::m_stop_hook_next_id
lldb::user_id_t m_stop_hook_next_id
Definition: Target.h:1468
lldb_private::Target::GetScratchTypeSystems
std::vector< TypeSystem * > GetScratchTypeSystems(bool create_on_demand=true)
Definition: Target.cpp:2289
lldb_private::TargetProperties::GetUseFastStepping
bool GetUseFastStepping() const
Definition: Target.cpp:4266
lldb_private::EvaluateExpressionOptions::DoesUnwindOnError
bool DoesUnwindOnError() const
Definition: Target.h:305
lldb_private::Target::SetAllStopHooksActiveState
void SetAllStopHooksActiveState(bool active_state)
Definition: Target.cpp:2650
SectionLoadHistory.h
lldb_private::TargetProperties::GetUserSpecifiedTrapHandlerNames
bool GetUserSpecifiedTrapHandlerNames(Args &args) const
Definition: Target.cpp:4305
lldb_private::TargetProperties::GetStandardOutputPath
FileSpec GetStandardOutputPath() const
Definition: Target.cpp:4204
lldb_private::Target::StopHookScripted::HandleStop
StopHookResult HandleStop(ExecutionContext &exc_ctx, lldb::StreamSP output) override
Definition: Target.cpp:3495
lldb_private::Target::RemoveBreakpointByID
bool RemoveBreakpointByID(lldb::break_id_t break_id)
Definition: Target.cpp:930
lldb_private::Target::TargetEventData::Dump
void Dump(Stream *s) const override
Definition: Target.cpp:4468
lldb_private::Target::GetSectionLoadList
SectionLoadList & GetSectionLoadList()
Definition: Target.h:1072
lldb_private::Target::UndoCreateStopHook
void UndoCreateStopHook(lldb::user_id_t uid)
If you tried to create a stop hook, and that failed, call this to remove the stop hook,...
Definition: Target.cpp:2615
lldb_private::Target::Arch::m_plugin_up
std::unique_ptr< Architecture > m_plugin_up
Definition: Target.h:1428
lldb_private::eExecutionPolicyOnlyWhenNeeded
@ eExecutionPolicyOnlyWhenNeeded
Definition: lldb-private-enumerations.h:145
lldb_private::TargetProperties::GetUseHexImmediates
bool GetUseHexImmediates() const
Definition: Target.cpp:4260
lldb_private::TargetProperties::SetInheritTCC
void SetInheritTCC(bool b)
Definition: Target.cpp:3932
StructuredDataImpl.h
lldb_private::eInlineBreakpointsHeaders
@ eInlineBreakpointsHeaders
Definition: Target.h:46
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
lldb_private::Target::StopHook::~StopHook
virtual ~StopHook()=default
lldb_private::EvaluateExpressionOptions::m_ignore_breakpoints
bool m_ignore_breakpoints
Definition: Target.h:423
Statistics.h
lldb_private::Target::GetUserExpressionForLanguage
UserExpression * GetUserExpressionForLanguage(llvm::StringRef expr, llvm::StringRef prefix, lldb::LanguageType language, Expression::ResultType desired_type, const EvaluateExpressionOptions &options, ValueObject *ctx_obj, Status &error)
Definition: Target.cpp:2333
lldb_private::Target::RemoveWatchpointByID
bool RemoveWatchpointByID(lldb::watch_id_t watch_id)
Definition: Target.cpp:1312
lldb_private::Target::GetGlobalProperties
static TargetProperties & GetGlobalProperties()
Definition: Target.cpp:2826
lldb_private::TargetProperties::SetUserSpecifiedTrapHandlerNames
void SetUserSpecifiedTrapHandlerNames(const Args &args)
Definition: Target.cpp:4310
lldb_private::TargetProperties::GetNumberOfRetriesWithFixits
uint64_t GetNumberOfRetriesWithFixits() const
Definition: Target.cpp:4146
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
lldb_private::PersistentExpressionState
Definition: ExpressionVariable.h:203
lldb_private::Target::TargetEventData::TargetEventData
TargetEventData(const lldb::TargetSP &target_sp)
Definition: Target.cpp:4454
lldb_private::Target::TargetEventData::GetFlavor
ConstString GetFlavor() const override
Definition: Target.h:491
lldb_private::Target::StopHook::StopHookResult
StopHookResult
Definition: Target.h:1221
lldb_private::Target::CalculateTarget
lldb::TargetSP CalculateTarget() override
Definition: Target.cpp:2235
lldb_private::EvaluateExpressionOptions::GetExecutionPolicy
ExecutionPolicy GetExecutionPolicy() const
Definition: Target.h:280
lldb_private::Target::ReadCStringFromMemory
size_t ReadCStringFromMemory(const Address &addr, std::string &out_str, Status &error)
Definition: Target.cpp:1831
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::EvaluateExpressionOptions::GetTrapExceptions
bool GetTrapExceptions() const
Definition: Target.h:362
lldb_private::TargetProperties::GetLanguage
lldb::LanguageType GetLanguage() const
Definition: Target.cpp:4224
lldb_private::Target::NotifyModuleRemoved
void NotifyModuleRemoved(const ModuleList &module_list, const lldb::ModuleSP &module_sp) override
Definition: Target.cpp:1584
lldb_private::TargetProperties::GetMaxZeroPaddingInFloatFormat
uint32_t GetMaxZeroPaddingInFloatFormat() const
Definition: Target.cpp:4170
lldb_private::EvaluateExpressionOptions::GetResultIsInternal
bool GetResultIsInternal() const
Definition: Target.h:401
lldb_private::Target::Arch::GetSpec
const ArchSpec & GetSpec() const
Definition: Target.h:1423
lldb_private::Target::ReadScalarIntegerFromMemory
size_t ReadScalarIntegerFromMemory(const Address &addr, uint32_t byte_size, bool is_signed, Scalar &scalar, Status &error, bool force_live_memory=false)
Definition: Target.cpp:1968
lldb_private::TargetProperties::GetMaximumMemReadSize
uint32_t GetMaximumMemReadSize() const
Definition: Target.cpp:4188
lldb::eDynamicCanRunTarget
@ eDynamicCanRunTarget
Definition: lldb-enumerations.h:496
lldb_private::TargetProperties::GetEnableNotifyAboutFixIts
bool GetEnableNotifyAboutFixIts() const
Definition: Target.cpp:4152
lldb_private::Target::StopHookCommandLine::GetCommands
StringList & GetCommands()
Definition: Target.h:1278
lldb_private::Target::Arch
Definition: Target.h:1418
lldb_private::Target::eBroadcastBitWatchpointChanged
@ eBroadcastBitWatchpointChanged
Definition: Target.h:466
lldb_private::Target::GetTrace
lldb::TraceSP GetTrace()
Get the Trace object containing processor trace information of this target.
Definition: Target.cpp:3136
lldb_private::Target::m_search_filter_sp
lldb::SearchFilterSP m_search_filter_sp
Definition: Target.h:1457
lldb_private::EvaluateExpressionOptions::InvokeCancelCallback
bool InvokeCancelCallback(lldb::ExpressionEvaluationPhase phase) const
Definition: Target.h:375
lldb_private::EvaluateExpressionOptions::SetDebug
void SetDebug(bool b)
Definition: Target.h:348
lldb_private::Target::LoadScriptingResources
bool LoadScriptingResources(std::list< Status > &errors, Stream *feedback_stream=nullptr, bool continue_on_error=true)
Definition: Target.h:902
lldb_private::Target::TargetEventData::m_target_sp
lldb::TargetSP m_target_sp
Definition: Target.h:508
lldb_private::Target::StopHook::GetSpecifier
SymbolContextSpecifier * GetSpecifier()
Definition: Target.h:1233
lldb_private::Target::TargetEventData::GetModuleListFromEvent
static ModuleList GetModuleListFromEvent(const Event *event_ptr)
Definition: Target.cpp:4497
lldb_private::Target::NotifyModulesRemoved
void NotifyModulesRemoved(lldb_private::ModuleList &module_list) override
Definition: Target.cpp:1606
lldb_private::Target::IgnoreAllWatchpoints
bool IgnoreAllWatchpoints(uint32_t ignore_count)
Definition: Target.cpp:1257
lldb_private::Target::~Target
~Target() override
Definition: Target.cpp:123
lldb_private::TargetProperties::GetSourcePathMap
PathMappingList & GetSourcePathMap() const
Definition: Target.cpp:4083
lldb_private::TargetProperties::SetDefaultArchitecture
void SetDefaultArchitecture(const ArchSpec &arch)
Definition: Target.cpp:3879
lldb_private::Target::StopHook::SetIsActive
void SetIsActive(bool is_active)
Definition: Target.h:1252
lldb_private::TargetProperties::GetDisableASLR
bool GetDisableASLR() const
Definition: Target.cpp:3915
lldb_private::Target::CreateScriptedBreakpoint
lldb::BreakpointSP CreateScriptedBreakpoint(const llvm::StringRef class_name, const FileSpecList *containingModules, const FileSpecList *containingSourceFiles, bool internal, bool request_hardware, StructuredData::ObjectSP extra_args_sp, Status *creation_error=nullptr)
Definition: Target.cpp:597
lldb_private::Target::GetDefaultDebugFileSearchPaths
static FileSpecList GetDefaultDebugFileSearchPaths()
Definition: Target.cpp:2413
lldb_private::Target::RemoveStopHookByID
bool RemoveStopHookByID(lldb::user_id_t uid)
Definition: Target.cpp:2622
lldb_private::EvaluateExpressionOptions::m_auto_apply_fixits
bool m_auto_apply_fixits
Definition: Target.h:433
lldb_private::EvaluateExpressionOptions::SetStopOthers
void SetStopOthers(bool stop_others=true)
Definition: Target.h:344
lldb_private::Target::GetBreakpointByID
lldb::BreakpointSP GetBreakpointByID(lldb::break_id_t break_id)
Definition: Target.cpp:303
lldb_private::Target::GetSourceManager
SourceManager & GetSourceManager()
Definition: Target.cpp:2594
lldb_private::Target::StopHook::GetDescription
void GetDescription(Stream *s, lldb::DescriptionLevel level) const
Definition: Target.cpp:3368
lldb_private::Target::ModulesDidUnload
void ModulesDidUnload(ModuleList &module_list, bool delete_locations)
Definition: Target.cpp:1642
lldb_private::Target::SetPlatform
void SetPlatform(const lldb::PlatformSP &platform_sp)
Definition: Target.h:1375
lldb_private::Target::EnableAllWatchpoints
bool EnableAllWatchpoints(bool end_to_end=true)
Definition: Target.cpp:1202
lldb_private::EvaluateExpressionOptions::m_timeout
Timeout< std::micro > m_timeout
Definition: Target.h:440
lldb_private::Target::SetDefaultArchitecture
static void SetDefaultArchitecture(const ArchSpec &arch)
Definition: Target.cpp:2421
lldb_private::TargetProperties::SetPreloadSymbols
void SetPreloadSymbols(bool b)
Definition: Target.cpp:3910
lldb_private::TargetProperties::TargetProperties
TargetProperties(Target *target)
Definition: Target.cpp:3774
lldb_private::Target::EnableBreakpointByID
bool EnableBreakpointByID(lldb::break_id_t break_id)
Definition: Target.cpp:968
lldb_private::Target::StopHookScripted::GetSubclassDescription
void GetSubclassDescription(Stream *s, lldb::DescriptionLevel level) const override
Definition: Target.cpp:3512
lldb_private::Target::TargetEventData
Definition: Target.h:480
Expression.h
lldb_private::EvaluateExpressionOptions::GetRetriesWithFixIts
uint64_t GetRetriesWithFixIts() const
Definition: Target.h:411
lldb_private::Target::CreateFuncRegexBreakpoint
lldb::BreakpointSP CreateFuncRegexBreakpoint(const FileSpecList *containingModules, const FileSpecList *containingSourceFiles, RegularExpression func_regexp, lldb::LanguageType requested_language, LazyBool skip_prologue, bool internal, bool request_hardware)
Definition: Target.cpp:563
lldb_private::GetDynamicValueTypes
OptionEnumValues GetDynamicValueTypes()
Definition: Target.cpp:3573
WatchpointList.h
lldb_private::Broadcaster
Definition: Broadcaster.h:242
lldb_private::LoadCWDlldbinitFile
LoadCWDlldbinitFile
Definition: Target.h:56
PathMappingList.h
lldb_private::ImportStdModule
ImportStdModule
Definition: Target.h:68
lldb_private::Target::StopHook::SetThreadSpecifier
void SetThreadSpecifier(ThreadSpec *specifier)
Definition: Target.cpp:3348
lldb_private::TargetProperties::GetDisassemblyFlavor
const char * GetDisassemblyFlavor() const
Definition: Target.cpp:3959
lldb_private::TargetProperties::GetDefaultArchitecture
ArchSpec GetDefaultArchitecture() const
Definition: Target.cpp:3871
lldb_private::Target::EnableWatchpointByID
bool EnableWatchpointByID(lldb::watch_id_t watch_id)
Definition: Target.cpp:1293
lldb_private::Target::SettingsInitialize
static void SettingsInitialize()
Definition: Target.cpp:2405
lldb_private::TargetProperties::GetClangModuleSearchPaths
FileSpecList GetClangModuleSearchPaths()
Definition: Target.cpp:4119
lldb_private::EvaluateExpressionOptions::SetPrefix
void SetPrefix(const char *prefix)
Definition: Target.h:296
lldb_private::TargetProperties::GetEnableSaveObjects
bool GetEnableSaveObjects() const
Definition: Target.cpp:4158
lldb_private::Target::Target
Target(Debugger &debugger, const ArchSpec &target_arch, const lldb::PlatformSP &platform_sp, bool is_dummy_target)
Construct with optional file and arch.
Definition: Target.cpp:88
lldb_private::Target::StopHookScripted::SetScriptCallback
Status SetScriptCallback(std::string class_name, StructuredData::ObjectSP extra_args_sp)
Definition: Target.cpp:3474
lldb_private::Target::FindBreakpointName
BreakpointName * FindBreakpointName(ConstString name, bool can_create, Status &error)
Definition: Target.cpp:695
lldb_private::Target::m_frame_recognizer_manager_up
lldb::StackFrameRecognizerManagerUP m_frame_recognizer_manager_up
Stores the frame recognizers of this target.
Definition: Target.h:1479
lldb_private::TargetProperties::GetAutoInstallMainExecutable
bool GetAutoInstallMainExecutable() const
Definition: Target.cpp:4378
lldb_private::Target::StopHookScripted::m_class_name
std::string m_class_name
Definition: Target.h:1310
lldb_private::Target::ReportStatistics
llvm::json::Value ReportStatistics()
Get metrics associated with this target in JSON format.
Definition: Target.cpp:4513
lldb_private::EvaluateExpressionOptions::GetDebug
bool GetDebug() const
Definition: Target.h:346
lldb_private::Target::CalculateStackFrame
lldb::StackFrameSP CalculateStackFrame() override
Definition: Target.cpp:2241
lldb_private::Target::TargetEventData::GetTargetFromEvent
static lldb::TargetSP GetTargetFromEvent(const Event *event_ptr)
Definition: Target.cpp:4488
lldb_private::EvaluateExpressionOptions::GetPoundLineFilePath
const char * GetPoundLineFilePath() const
Definition: Target.h:393
lldb_private::Target::GetNumStopHooks
size_t GetNumStopHooks() const
Definition: Target.h:1359
lldb_private::BreakpointIDList
Definition: BreakpointIDList.h:25
lldb_private::EvaluateExpressionOptions::GetPoundLineLine
uint32_t GetPoundLineLine() const
Definition: Target.h:397
lldb_private::Target::m_section_load_history
SectionLoadHistory m_section_load_history
Definition: Target.h:1444
lldb_private::TargetProperties::GetInheritedEnvironment
Environment GetInheritedEnvironment() const
Definition: Target.cpp:4032
lldb_private::TargetProperties::GetExecutableSearchPaths
FileSpecList GetExecutableSearchPaths()
Definition: Target.cpp:4101
lldb_private::TargetProperties::SetEnvironment
void SetEnvironment(Environment env)
Definition: Target.cpp:4071
lldb_private::TargetProperties::SetDetachOnError
void SetDetachOnError(bool b)
Definition: Target.cpp:3943
lldb_private::ModuleList::Notifier
Definition: ModuleList.h:81
lldb::DescriptionLevel
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
Definition: lldb-enumerations.h:207
lldb_private::Target::Arch::m_spec
ArchSpec m_spec
Definition: Target.h:1427
lldb_private::SourceManager
Definition: SourceManager.h:31
lldb_private::EvaluateExpressionOptions::GetOneThreadTimeout
const Timeout< std::micro > & GetOneThreadTimeout() const
Definition: Target.h:330
lldb_private::Target::RemoveAllWatchpoints
bool RemoveAllWatchpoints(bool end_to_end=true)
Definition: Target.cpp:1146
lldb_private::EvaluateExpressionOptions::m_pound_line_file
std::string m_pound_line_file
Definition: Target.h:447
lldb_private::EvaluateExpressionOptions::m_unwind_on_error
bool m_unwind_on_error
Definition: Target.h:422
lldb_private::InlineStrategy
InlineStrategy
Definition: Target.h:44
lldb_private::Target::RemoveAllowedBreakpoints
void RemoveAllowedBreakpoints()
Definition: Target.cpp:875
lldb_private::Target::StopHook::StopHookKind
StopHookKind
Definition: Target.h:1220
lldb_private::Target::MergeArchitecture
bool MergeArchitecture(const ArchSpec &arch_spec)
Definition: Target.cpp:1547
lldb_private::FunctionCaller
Definition: FunctionCaller.h:56
lldb_private::LoadScriptFromSymFile
LoadScriptFromSymFile
Definition: Target.h:50
lldb_private::Target::SetStopHookActiveStateByID
bool SetStopHookActiveStateByID(lldb::user_id_t uid, bool active_state)
Definition: Target.cpp:2639
lldb_private::Target::m_trace_sp
lldb::TraceSP m_trace_sp
An optional lldb_private::Trace object containing processor trace information of this target.
Definition: Target.h:1477
lldb_private::EvaluateExpressionOptions::SetAutoApplyFixIts
void SetAutoApplyFixIts(bool b)
Definition: Target.h:403
lldb_private::Target::ReadPointerFromMemory
bool ReadPointerFromMemory(const Address &addr, Status &error, Address &pointer_addr, bool force_live_memory=false)
Definition: Target.cpp:2008