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 <optional>
16#include <string>
17#include <type_traits>
18#include <vector>
19
23#include "lldb/Core/Address.h"
46#include "lldb/Utility/Stream.h"
49#include "lldb/lldb-public.h"
50#include "llvm/ADT/MapVector.h"
51#include "llvm/ADT/StringRef.h"
52#include "llvm/Support/Casting.h"
53
54namespace lldb_private {
55
57
63
70
76
82
89
91
96
98public:
99 TargetProperties(Target *target);
100
102
104
105 void SetDefaultArchitecture(const ArchSpec &arch);
106
107 bool GetMoveToNearestCode() const;
108
110
112
113 bool GetPreloadSymbols() const;
114
115 void SetPreloadSymbols(bool b);
116
117 bool GetDisableASLR() const;
118
119 void SetDisableASLR(bool b);
120
121 bool GetInheritTCC() const;
122
123 void SetInheritTCC(bool b);
124
125 bool GetDetachOnError() const;
126
127 void SetDetachOnError(bool b);
128
129 bool GetDisableSTDIO() const;
130
131 void SetDisableSTDIO(bool b);
132
133 llvm::StringRef GetLaunchWorkingDirectory() const;
134
135 bool GetParallelModuleLoad() const;
136
137 const char *GetDisassemblyFlavor() const;
138
139 const char *GetDisassemblyCPU() const;
140
141 const char *GetDisassemblyFeatures() const;
142
144
146
147 llvm::StringRef GetArg0() const;
148
149 void SetArg0(llvm::StringRef arg);
150
151 bool GetRunArguments(Args &args) const;
152
153 void SetRunArguments(const Args &args);
154
155 // Get the whole environment including the platform inherited environment and
156 // the target specific environment, excluding the unset environment variables.
158 // Get the platform inherited environment, excluding the unset environment
159 // variables.
161 // Get the target specific environment only, without the platform inherited
162 // environment.
164 // Set the target specific environment.
165 void SetEnvironment(Environment env);
166
167 bool GetSkipPrologue() const;
168
170
172
173 bool GetAutoSourceMapRelative() const;
174
176
178
180
182
184
186
188
189 bool GetEnableAutoApplyFixIts() const;
190
191 uint64_t GetNumberOfRetriesWithFixits() const;
192
193 bool GetEnableNotifyAboutFixIts() const;
194
196
197 JITEngine GetJITEngine() const;
198
199 bool GetEnableSyntheticValue() const;
200
202
203 uint32_t GetMaxZeroPaddingInFloatFormat() const;
204
206
207 /// Get the max depth value, augmented with a bool to indicate whether the
208 /// depth is the default.
209 ///
210 /// When the user has customized the max depth, the bool will be false.
211 ///
212 /// \returns the max depth, and true if the max depth is the system default,
213 /// otherwise false.
214 std::pair<uint32_t, bool> GetMaximumDepthOfChildrenToDisplay() const;
215
216 uint32_t GetMaximumSizeOfStringSummary() const;
217
218 uint32_t GetMaximumMemReadSize() const;
219
223
224 void SetStandardInputPath(llvm::StringRef path);
225 void SetStandardOutputPath(llvm::StringRef path);
226 void SetStandardErrorPath(llvm::StringRef path);
227
228 void SetStandardInputPath(const char *path) = delete;
229 void SetStandardOutputPath(const char *path) = delete;
230 void SetStandardErrorPath(const char *path) = delete;
231
234
236
237 llvm::StringRef GetExpressionPrefixContents();
238
239 uint64_t GetExprErrorLimit() const;
240
241 uint64_t GetExprAllocAddress() const;
242
243 uint64_t GetExprAllocSize() const;
244
245 uint64_t GetExprAllocAlign() const;
246
247 bool GetUseHexImmediates() const;
248
249 bool GetUseFastStepping() const;
250
252
254
255 /// Set the target-wide target.load-script-from-symbol-file setting.
256 /// See \c SetAutoLoadScriptsForModule for overriding this setting
257 /// per-module.
259
261
263
265
266 bool GetUserSpecifiedTrapHandlerNames(Args &args) const;
267
268 void SetUserSpecifiedTrapHandlerNames(const Args &args);
269
271
273
275
277
279
280 void SetProcessLaunchInfo(const ProcessLaunchInfo &launch_info);
281
282 bool GetInjectLocalVariables(ExecutionContext *exe_ctx) const;
283
284 bool GetUseDIL(ExecutionContext *exe_ctx) const;
285
286 void SetUseDIL(ExecutionContext *exe_ctx, bool b);
287
288 bool GetUseDILForCreatingValues() const;
289
290 void SetUseDILForCreatingValues(bool b);
291
293
295
296 bool GetAutoInstallMainExecutable() const;
297
299
300 void SetDebugUtilityExpression(bool debug);
301
302 bool GetDebugUtilityExpression() const;
303
304 void SetCheckValueObjectOwnership(bool check);
305
306 bool GetCheckValueObjectOwnership() const;
307
308 std::optional<LoadScriptFromSymFile>
309 GetAutoLoadScriptsForModule(llvm::StringRef module_name) const;
310
311 /// Set the \c LoadScriptFromSymFile for a module called \c module_name
312 /// (excluding file extension). LLDB will prefer this over the target-wide
313 /// target.load-script-from-symbol-file setting
314 /// (see \c SetLoadScriptFromSymbolFile).
315 void SetAutoLoadScriptsForModule(llvm::StringRef module_name,
316 LoadScriptFromSymFile load_style);
317
318private:
319 std::optional<bool>
320 GetExperimentalPropertyValue(size_t prop_idx,
321 ExecutionContext *exe_ctx = nullptr) const;
322
323 // Callbacks for m_launch_info.
334
335 // Settings checker for target.jit-save-objects-dir:
336 void CheckJITObjectsDir();
337
339
340 // Member variables.
342 std::unique_ptr<TargetExperimentalProperties> m_experimental_properties_up;
344};
345
347public:
349
350// MSVC has a bug here that reports C4268: 'const' static/global data
351// initialized with compiler generated default constructor fills the object
352// with zeros. Confirmed that MSVC is *not* zero-initializing, it's just a
353// bogus warning.
354#if defined(_MSC_VER)
355#pragma warning(push)
356#pragma warning(disable : 4268)
357#endif
358 static constexpr std::chrono::milliseconds default_timeout{500};
359#if defined(_MSC_VER)
360#pragma warning(pop)
361#endif
362
365
367
371
373
374 void SetLanguage(lldb::LanguageType language_type) {
375 m_language = SourceLanguage(language_type);
376 }
377
379 m_preferred_lookup_contexts = std::move(contexts);
380 }
381
385
386 /// Set the language using a pair of language code and version as
387 /// defined by the DWARF 6 specification.
388 /// WARNING: These codes may change until DWARF 6 is finalized.
389 void SetLanguage(uint16_t name, uint32_t version) {
390 m_language = SourceLanguage(name, version);
391 }
392
393 bool DoesCoerceToId() const { return m_coerce_to_id; }
394
395 const char *GetPrefix() const {
396 return (m_prefix.empty() ? nullptr : m_prefix.c_str());
397 }
398
399 void SetPrefix(const char *prefix) {
400 if (prefix && prefix[0])
401 m_prefix = prefix;
402 else
403 m_prefix.clear();
404 }
405
406 void SetCoerceToId(bool coerce = true) { m_coerce_to_id = coerce; }
407
408 bool DoesUnwindOnError() const { return m_unwind_on_error; }
409
410 void SetUnwindOnError(bool unwind = false) { m_unwind_on_error = unwind; }
411
413
414 void SetIgnoreBreakpoints(bool ignore = false) {
415 m_ignore_breakpoints = ignore;
416 }
417
418 bool DoesKeepInMemory() const { return m_keep_in_memory; }
419
420 void SetKeepInMemory(bool keep = true) { m_keep_in_memory = keep; }
421
423
424 void
428
429 const Timeout<std::micro> &GetTimeout() const { return m_timeout; }
430
431 void SetTimeout(const Timeout<std::micro> &timeout) { m_timeout = timeout; }
432
436
438 m_one_thread_timeout = timeout;
439 }
440
441 bool GetTryAllThreads() const { return m_try_others; }
442
443 void SetTryAllThreads(bool try_others = true) { m_try_others = try_others; }
444
445 bool GetStopOthers() const { return m_stop_others; }
446
447 void SetStopOthers(bool stop_others = true) { m_stop_others = stop_others; }
448
449 bool GetDebug() const { return m_debug; }
450
451 void SetDebug(bool b) {
452 m_debug = b;
453 if (m_debug)
455 }
456
458
460
461 bool GetColorizeErrors() const { return m_ansi_color_errors; }
462
464
465 bool GetTrapExceptions() const { return m_trap_exceptions; }
466
468
469 bool GetStopOnFork() const { return m_stop_on_fork; }
470
471 void SetStopOnFork(bool b) { m_stop_on_fork = b; }
472
473 bool GetREPLEnabled() const { return m_repl; }
474
475 void SetREPLEnabled(bool b) { m_repl = b; }
476
479 m_cancel_callback = callback;
480 }
481
483 return ((m_cancel_callback != nullptr)
485 : false);
486 }
487
488 // Allows the expression contents to be remapped to point to the specified
489 // file and line using #line directives.
490 void SetPoundLine(const char *path, uint32_t line) const {
491 if (path && path[0]) {
492 m_pound_line_file = path;
493 m_pound_line_line = line;
494 } else {
495 m_pound_line_file.clear();
497 }
498 }
499
500 const char *GetPoundLineFilePath() const {
501 return (m_pound_line_file.empty() ? nullptr : m_pound_line_file.c_str());
502 }
503
504 uint32_t GetPoundLineLine() const { return m_pound_line_line; }
505
507
511
513
515
516 void SetRetriesWithFixIts(uint64_t number_of_retries) {
517 m_retries_with_fixits = number_of_retries;
518 }
519
520 uint64_t GetRetriesWithFixIts() const { return m_retries_with_fixits; }
521
523
525
526 /// Set language-plugin specific option called \c option_name to
527 /// the specified boolean \c value.
528 llvm::Error SetBooleanLanguageOption(llvm::StringRef option_name, bool value);
529
530 /// Get the language-plugin specific boolean option called \c option_name.
531 ///
532 /// If the option doesn't exist or is not a boolean option, returns false.
533 /// Otherwise returns the boolean value of the option.
534 llvm::Expected<bool>
535 GetBooleanLanguageOption(llvm::StringRef option_name) const;
536
537 void SetCppIgnoreContextQualifiers(bool value);
538
540
541 void SetTryDILFirst(bool b) { m_try_DIL_first = b; }
542
543 bool GetTryDILFirst() const { return m_try_DIL_first; }
544
545private:
547
549
552 std::string m_prefix;
553 bool m_coerce_to_id = false;
554 bool m_unwind_on_error = true;
556 bool m_keep_in_memory = false;
557 bool m_try_others = true;
558 bool m_stop_others = true;
559 bool m_debug = false;
560 bool m_trap_exceptions = true;
561 bool m_stop_on_fork = false;
562 bool m_repl = false;
568 /// True if the executed code should be treated as utility code that is only
569 /// used by LLDB internally.
571 /// If enabled, Data Inspection Language (DIL) should attempt to evaluate the
572 /// expression first. If DIL is not called or fails, the evaluation falls
573 /// back to UserExpression.
574 bool m_try_DIL_first = false;
575
580 void *m_cancel_callback_baton = nullptr;
581 // If m_pound_line_file is not empty and m_pound_line_line is non-zero, use
582 // #line %u "%s" before the expression content to remap where the source
583 // originates
584 mutable std::string m_pound_line_file;
585 mutable uint32_t m_pound_line_line = 0;
586
587 /// Dictionary mapping names of language-plugin specific options
588 /// to values.
590
591 /// During expression evaluation, any SymbolContext in this list will be
592 /// used for symbol/function lookup before any other context (except for
593 /// the module corresponding to the current frame).
595};
596
597// Target
598class Target : public std::enable_shared_from_this<Target>,
599 public TargetProperties,
600 public Broadcaster,
602 public ModuleList::Notifier {
603public:
604 friend class TargetList;
605 friend class Debugger;
606 friend class TargetAPIMutex;
607
608 /// Broadcaster event bits definitions.
609 enum {
617 };
618
619 // These two functions fill out the Broadcaster interface:
620
621 static llvm::StringRef GetStaticBroadcasterClass();
622
623 llvm::StringRef GetBroadcasterClass() const override {
625 }
626
627 // This event data class is for use by the TargetList to broadcast new target
628 // notifications.
629 class TargetEventData : public EventData {
630 public:
631 TargetEventData(const lldb::TargetSP &target_sp);
632
633 TargetEventData(const lldb::TargetSP &target_sp,
634 const ModuleList &module_list);
635
636 // Constructor for eBroadcastBitNewTargetCreated events. For this event
637 // type:
638 // - target_sp is the parent target (the subject/broadcaster of the event)
639 // - created_target_sp is the newly created target
640 TargetEventData(const lldb::TargetSP &target_sp,
641 const lldb::TargetSP &created_target_sp);
642
644
645 static llvm::StringRef GetFlavorString();
646
647 llvm::StringRef GetFlavor() const override {
649 }
650
651 void Dump(Stream *s) const override;
652
653 static const TargetEventData *GetEventDataFromEvent(const Event *event_ptr);
654
655 static lldb::TargetSP GetTargetFromEvent(const Event *event_ptr);
656
657 // For eBroadcastBitNewTargetCreated events, returns the newly created
658 // target. For other event types, returns an invalid target.
659 static lldb::TargetSP GetCreatedTargetFromEvent(const Event *event_ptr);
660
661 static ModuleList GetModuleListFromEvent(const Event *event_ptr);
662
663 const lldb::TargetSP &GetTarget() const { return m_target_sp; }
664
666 return m_created_target_sp;
667 }
668
669 const ModuleList &GetModuleList() const { return m_module_list; }
670
671 private:
675
677 const TargetEventData &operator=(const TargetEventData &) = delete;
678 };
679
680 ~Target() override;
681
682 static void SettingsInitialize();
683
684 static void SettingsTerminate();
685
687
689
691
692 static void SetDefaultArchitecture(const ArchSpec &arch);
693
694 bool IsDummyTarget() const { return m_is_dummy_target; }
695
696 /// Get the globally unique ID for this target.
697 ///
698 /// This ID is unique across all debugger instances and all targets,
699 /// within the same lldb process. The ID is assigned
700 /// during target construction and remains constant for the target's lifetime.
701 /// The first target created (typically the dummy target) gets ID 1.
702 ///
703 /// \return
704 /// The globally unique ID for this target.
706
707 const std::string &GetLabel() const { return m_label; }
708
709 /// Set a label for a target.
710 ///
711 /// The label cannot be used by another target or be only integral.
712 ///
713 /// \return
714 /// The label for this target or an error if the label didn't match the
715 /// requirements.
716 llvm::Error SetLabel(llvm::StringRef label);
717
718 /// Get the target session name for this target.
719 ///
720 /// Provides a meaningful name for IDEs or tools to display for dynamically
721 /// created targets. Defaults to "Session {ID}" based on the globally unique
722 /// ID.
723 ///
724 /// \return
725 /// The target session name for this target.
726 llvm::StringRef GetTargetSessionName() { return m_target_session_name; }
727
728 /// Set the target session name for this target.
729 ///
730 /// This should typically be set along with the event
731 /// eBroadcastBitNewTargetCreated. Useful for scripts or triggers that
732 /// automatically create targets and want to provide meaningful names that
733 /// IDEs or other tools can display to help users identify the origin and
734 /// purpose of each target.
735 ///
736 /// \param[in] target_session_name
737 /// The target session name to set for this target.
738 void SetTargetSessionName(llvm::StringRef target_session_name) {
739 m_target_session_name = target_session_name.str();
740 }
741
742 /// Find a binary on the system and return its Module,
743 /// or return an existing Module that is already in the Target.
744 ///
745 /// Given a ModuleSpec, find a binary satisifying that specification,
746 /// or identify a matching Module already present in the Target,
747 /// and return a shared pointer to it.
748 ///
749 /// Note that this function previously also preloaded the module's symbols
750 /// depending on a setting. This function no longer does any module
751 /// preloading because that can potentially cause deadlocks when called in
752 /// parallel with this function.
753 ///
754 /// \param[in] module_spec
755 /// The criteria that must be matched for the binary being loaded.
756 /// e.g. UUID, architecture, file path.
757 ///
758 /// \param[in] notify
759 /// If notify is true, and the Module is new to this Target,
760 /// Target::ModulesDidLoad will be called. See note in
761 /// Target::ModulesDidLoad about thread-safety with
762 /// Target::GetOrCreateModule.
763 /// If notify is false, it is assumed that the caller is adding
764 /// multiple Modules and will call ModulesDidLoad with the
765 /// full list at the end.
766 /// ModulesDidLoad must be called when a Module/Modules have
767 /// been added to the target, one way or the other.
768 ///
769 /// \param[out] error_ptr
770 /// Optional argument, pointing to a Status object to fill in
771 /// with any results / messages while attempting to find/load
772 /// this binary. Many callers will be internal functions that
773 /// will handle / summarize the failures in a custom way and
774 /// don't use these messages.
775 ///
776 /// \param[in] invoke_symbol_locators
777 /// Whether to search beyond the Target's modules, the shared module list
778 /// and the locate module callback, i.e. with the platform and the symbol
779 /// locators. A caller that has already searched passes false.
780 ///
781 /// \return
782 /// An empty ModuleSP will be returned if no matching file
783 /// was found. If error_ptr was non-nullptr, an error message
784 /// will likely be provided.
785 lldb::ModuleSP GetOrCreateModule(const ModuleSpec &module_spec, bool notify,
786 Status *error_ptr = nullptr,
787 bool invoke_symbol_locators = true);
788
789 // Settings accessors
790
792
793 /// Returns a handle resolved to the mutex to serialize on before
794 /// touching the target through the SB API. The handle isn't locked yet;
795 /// lock()/try_lock() it (typically via std::lock_guard<TargetAPIMutex>/
796 /// std::unique_lock<TargetAPIMutex>) to actually acquire it.
798
800
801 void CleanupProcess();
802
803 /// Dump a description of this object to a Stream.
804 ///
805 /// Dump a description of the contents of this object to the
806 /// supplied stream \a s. The dumped content will be only what has
807 /// been loaded or parsed up to this point at which this function
808 /// is called, so this is a good way to see what has been parsed
809 /// in a target.
810 ///
811 /// \param[in] s
812 /// The stream to which to dump the object description.
813 void Dump(Stream *s, lldb::DescriptionLevel description_level);
814
815 // If listener_sp is null, the listener of the owning Debugger object will be
816 // used.
818 llvm::StringRef plugin_name,
819 const FileSpec *crash_file,
820 bool can_connect);
821
822 const lldb::ProcessSP &GetProcessSP() const;
823
824 bool IsValid() { return m_valid; }
825
826 void Destroy();
827
828 Status Launch(ProcessLaunchInfo &launch_info,
829 Stream *stream); // Optional stream to receive first stop info
830
831 Status Attach(ProcessAttachInfo &attach_info,
832 Stream *stream); // Optional stream to receive first stop info
833
834 /// Add or update a scripted frame provider descriptor for this target.
835 /// All new threads in this target will check if they match any descriptors
836 /// to create their frame providers.
837 ///
838 /// \param[in] descriptor
839 /// The descriptor to add or update.
840 ///
841 /// \return
842 /// The descriptor identifier if the registration succeeded, otherwise an
843 /// llvm::Error.
844 llvm::Expected<uint32_t> AddScriptedFrameProviderDescriptor(
845 const ScriptedFrameProviderDescriptor &descriptor);
846
847 /// Remove a scripted frame provider descriptor by id.
848 ///
849 /// \param[in] id
850 /// The id of the descriptor to remove.
851 ///
852 /// \return
853 /// True if a descriptor was removed, false if no descriptor with that
854 /// id existed.
856
857 /// Clear all scripted frame provider descriptors for this target.
859
860 /// Get all scripted frame provider descriptors for this target.
861 const llvm::MapVector<uint32_t, ScriptedFrameProviderDescriptor> &
863
864protected:
865 /// Invalidate all potentially cached frame providers for all threads
866 /// and trigger a stack changed event for all threads.
868
869public:
870 // This part handles the breakpoints.
871
872 BreakpointList &GetBreakpointList(bool internal = false);
873
874 const BreakpointList &GetBreakpointList(bool internal = false) const;
875
879
881
883
884 // Use this to create a file and line breakpoint to a given module or all
885 // module it is nullptr
886 lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules,
887 const FileSpec &file, uint32_t line_no,
888 uint32_t column, lldb::addr_t offset,
889 LazyBool check_inlines,
890 LazyBool skip_prologue, bool internal,
891 bool request_hardware,
892 LazyBool move_to_nearest_code);
893
894 // Use this to create breakpoint that matches regex against the source lines
895 // in files given in source_file_list: If function_names is non-empty, also
896 // filter by function after the matches are made.
898 const FileSpecList *containingModules,
899 const FileSpecList *source_file_list,
900 const std::unordered_set<std::string> &function_names,
901 RegularExpression source_regex, bool internal, bool request_hardware,
902 LazyBool move_to_nearest_code);
903
904 // Use this to create a breakpoint from a load address
905 lldb::BreakpointSP CreateBreakpoint(lldb::addr_t load_addr, bool internal,
906 bool request_hardware);
907
908 // Use this to create a breakpoint from a file address and a module file spec
910 bool internal,
911 const FileSpec &file_spec,
912 bool request_hardware);
913
914 // Use this to create Address breakpoints:
915 lldb::BreakpointSP CreateBreakpoint(const Address &addr, bool internal,
916 bool request_hardware);
917
918 // Use this to create a function breakpoint by regexp in
919 // containingModule/containingSourceFiles, or all modules if it is nullptr
920 // When "skip_prologue is set to eLazyBoolCalculate, we use the current
921 // target setting, else we use the values passed in
923 const FileSpecList *containingModules,
924 const FileSpecList *containingSourceFiles, RegularExpression func_regexp,
925 lldb::LanguageType requested_language, LazyBool skip_prologue,
926 bool internal, bool request_hardware);
927
928 // Use this to create a function breakpoint by name in containingModule, or
929 // all modules if it is nullptr When "skip_prologue is set to
930 // eLazyBoolCalculate, we use the current target setting, else we use the
931 // values passed in. func_name_type_mask is or'ed values from the
932 // FunctionNameType enum.
934 const FileSpecList *containingModules,
935 const FileSpecList *containingSourceFiles, const char *func_name,
936 lldb::FunctionNameType func_name_type_mask, lldb::LanguageType language,
937 lldb::addr_t offset, bool offset_is_insn_count, LazyBool skip_prologue,
938 bool internal, bool request_hardware);
939
941 CreateExceptionBreakpoint(enum lldb::LanguageType language, bool catch_bp,
942 bool throw_bp, bool internal,
943 Args *additional_args = nullptr,
944 Status *additional_args_error = nullptr);
945
947 const llvm::StringRef class_name, const FileSpecList *containingModules,
948 const FileSpecList *containingSourceFiles, bool internal,
949 bool request_hardware, StructuredData::ObjectSP extra_args_sp,
950 Status *creation_error = nullptr);
951
952 // This is the same as the func_name breakpoint except that you can specify a
953 // vector of names. This is cheaper than a regular expression breakpoint in
954 // the case where you just want to set a breakpoint on a set of names you
955 // already know. func_name_type_mask is or'ed values from the
956 // FunctionNameType enum.
958 const FileSpecList *containingModules,
959 const FileSpecList *containingSourceFiles, const char *func_names[],
960 size_t num_names, lldb::FunctionNameType func_name_type_mask,
961 lldb::LanguageType language, lldb::addr_t offset, LazyBool skip_prologue,
962 bool internal, bool request_hardware);
963
965 CreateBreakpoint(const FileSpecList *containingModules,
966 const FileSpecList *containingSourceFiles,
967 const std::vector<std::string> &func_names,
968 lldb::FunctionNameType func_name_type_mask,
969 lldb::LanguageType language, lldb::addr_t m_offset,
970 LazyBool skip_prologue, bool internal,
971 bool request_hardware);
972
973 // Use this to create a general breakpoint:
975 lldb::BreakpointResolverSP &resolver_sp,
976 bool internal, bool request_hardware,
977 bool resolve_indirect_symbols);
978
979 // Use this to create a watchpoint:
981 const CompilerType *type, uint32_t kind,
982 Status &error);
983
987
989
990 // Manages breakpoint names:
991 void AddNameToBreakpoint(BreakpointID &id, llvm::StringRef name,
992 Status &error);
993
994 void AddNameToBreakpoint(lldb::BreakpointSP &bp_sp, llvm::StringRef name,
995 Status &error);
996
998 llvm::StringRef name);
999
1000 BreakpointName *FindBreakpointName(llvm::StringRef name, bool can_create,
1001 Status &error);
1002
1003 void DeleteBreakpointName(llvm::StringRef name);
1004
1006 const BreakpointOptions &options,
1007 const BreakpointName::Permissions &permissions);
1009
1010 void AddBreakpointName(std::unique_ptr<BreakpointName> bp_name);
1011
1012 void GetBreakpointNames(std::vector<std::string> &names);
1013
1014 // This call removes ALL breakpoints regardless of permission.
1015 void RemoveAllBreakpoints(bool internal_also = false);
1016
1017 // This removes all the breakpoints, but obeys the ePermDelete on them.
1019
1020 void DisableAllBreakpoints(bool internal_also = false);
1021
1023
1024 void EnableAllBreakpoints(bool internal_also = false);
1025
1027
1029
1031
1033
1034 /// Resets the hit count of all breakpoints.
1036
1037 // This callout implements the "Resolver Override". When we have determined
1038 // the Resolver for a given breakpoint, we pass each of the registered
1039 // overrides the "natural" resolver, and then we will use whatever resolver
1040 // we get back from it if it is non-null.
1041 // We keep a list of overrides ordered by ID - and we search through the list
1042 // by ID order, and the first override that returns a non-null Resolver will
1043 // be the one we use. If no overrides return an override resolver, we'll use
1044 // the original one.
1045
1046 /// This is the abstract version of the override. Particular implementations,
1047 /// e.g. the scripted override resolver, instantiate actual versions of the
1048 /// class. The constructor takes the target this resolver is registered in, a
1049 /// description for the override and a mask of the resolver types this
1050 /// overrides, made of elements of the BreakpointResolverType enum.
1051 class BreakpointResolverOverride;
1053 std::unique_ptr<BreakpointResolverOverride>;
1054
1056 public:
1057 BreakpointResolverOverride(Target &target, const std::string &description,
1058 uint64_t type_mask)
1059 : m_target(target), m_desc(description), m_type_mask(type_mask) {}
1060
1062
1066 // Returns an error describing why this override can't be used, for
1067 // example because its script class doesn't exist.
1068 virtual llvm::Error HasErrors() = 0;
1069 const std::string &GetDescription() { return m_desc; }
1070 uint64_t GetTypeMask() { return m_type_mask; }
1071 std::string DescribeTypeMask();
1072
1073 protected:
1075 std::string m_desc;
1076 uint64_t m_type_mask = 0;
1077 };
1078
1079 /// Add a breakpoint override resolver. This version can't fail.
1083 m_breakpoint_overrides.emplace(m_override_id, std::move(override_up));
1084 m_override_id++;
1085 return id_used;
1086 }
1087
1088 /// Add a breakpoint override resolver. Return the ID or an error:
1089 llvm::Expected<lldb::user_id_t>
1090 AddBreakpointResolverOverride(llvm::StringRef class_name, uint64_t type_mask,
1091 StructuredData::DictionarySP args_data_sp,
1092 llvm::StringRef description);
1093
1095 size_t removed = m_breakpoint_overrides.erase(override_id);
1096 return removed == 1;
1097 }
1098
1100
1103
1104 /// Describe the breakpoint overrides. If ixds is empty, list all. Otherwise
1105 /// list the overrides whose ids match the ones given in idxs. The matched
1106 /// elements are removed from the list, so any elements remaining in idxs are
1107 /// indexes that are not breakpoint override indexes.
1109 std::vector<lldb::user_id_t> &idxs,
1110 uint32_t terminal_width, bool use_color);
1111
1112 // The flag 'end_to_end', default to true, signifies that the operation is
1113 // performed end to end, for both the debugger and the debuggee.
1114
1115 bool RemoveAllWatchpoints(bool end_to_end = true);
1116
1117 bool DisableAllWatchpoints(bool end_to_end = true);
1118
1119 bool EnableAllWatchpoints(bool end_to_end = true);
1120
1122
1124
1125 bool IgnoreAllWatchpoints(uint32_t ignore_count);
1126
1128
1130
1132
1133 bool IgnoreWatchpointByID(lldb::watch_id_t watch_id, uint32_t ignore_count);
1134
1136 const BreakpointIDList &bp_ids,
1137 bool append);
1138
1140 BreakpointIDList &new_bps);
1141
1143 std::vector<std::string> &names,
1144 BreakpointIDList &new_bps);
1145
1146 /// Get \a load_addr as a callable code load address for this target
1147 ///
1148 /// Take \a load_addr and potentially add any address bits that are
1149 /// needed to make the address callable. For ARM this can set bit
1150 /// zero (if it already isn't) if \a load_addr is a thumb function.
1151 /// If \a addr_class is set to AddressClass::eInvalid, then the address
1152 /// adjustment will always happen. If it is set to an address class
1153 /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
1154 /// returned.
1156 lldb::addr_t load_addr,
1157 AddressClass addr_class = AddressClass::eInvalid) const;
1158
1159 /// Get \a load_addr as an opcode for this target.
1160 ///
1161 /// Take \a load_addr and potentially strip any address bits that are
1162 /// needed to make the address point to an opcode. For ARM this can
1163 /// clear bit zero (if it already isn't) if \a load_addr is a
1164 /// thumb function and load_addr is in code.
1165 /// If \a addr_class is set to AddressClass::eInvalid, then the address
1166 /// adjustment will always happen. If it is set to an address class
1167 /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
1168 /// returned.
1171 AddressClass addr_class = AddressClass::eInvalid) const;
1172
1173 // Get load_addr as breakable load address for this target. Take a addr and
1174 // check if for any reason there is a better address than this to put a
1175 // breakpoint on. If there is then return that address. For MIPS, if
1176 // instruction at addr is a delay slot instruction then this method will find
1177 // the address of its previous instruction and return that address.
1179
1180 /// This call may preload module symbols, and may do so in parallel depending
1181 /// on the following target settings:
1182 /// - TargetProperties::GetPreloadSymbols()
1183 /// - TargetProperties::GetParallelModuleLoad()
1184 ///
1185 /// Warning: if preloading is active and this is called in parallel with
1186 /// Target::GetOrCreateModule, this may result in a ABBA deadlock situation.
1187 void ModulesDidLoad(ModuleList &module_list);
1188
1189 void ModulesDidUnload(ModuleList &module_list, bool delete_locations);
1190
1191 void SymbolsDidLoad(ModuleList &module_list);
1192
1193 void ClearModules(bool delete_locations);
1194
1195 /// Called as the last function in Process::DidExec().
1196 ///
1197 /// Process::DidExec() will clear a lot of state in the process,
1198 /// then try to reload a dynamic loader plugin to discover what
1199 /// binaries are currently available and then this function should
1200 /// be called to allow the target to do any cleanup after everything
1201 /// has been figured out. It can remove breakpoints that no longer
1202 /// make sense as the exec might have changed the target
1203 /// architecture, and unloaded some modules that might get deleted.
1204 void DidExec();
1205
1206 /// Gets the module for the main executable.
1207 ///
1208 /// Each process has a notion of a main executable that is the file
1209 /// that will be executed or attached to. Executable files can have
1210 /// dependent modules that are discovered from the object files, or
1211 /// discovered at runtime as things are dynamically loaded.
1212 ///
1213 /// \return
1214 /// The first module of type ObjectFile::eTypeExecutable. Failing that,
1215 /// the module set by RebuildModuleListWithExecutable or
1216 /// MarkExecutableModule while the target still holds it, which can be a
1217 /// shared library (an ELF PIE). Otherwise, nullptr.
1218 ///
1219 /// \see DynamicLoader
1220 /// \see ObjectFile::GetDependentModules (FileSpecList&)
1221 /// \see Target::RebuildModuleListWithExecutable(lldb::ModuleSP&)
1223
1225
1226 /// Make \a module_sp the main executable without clearing the other images,
1227 /// unlike RebuildModuleListWithExecutable. Has no effect until the target
1228 /// holds it.
1229 void MarkExecutableModule(const lldb::ModuleSP &module_sp);
1230
1231 /// Clear the module list and rebuild it around a new main executable.
1232 ///
1233 /// Each process has a notion of a main executable that is the file
1234 /// that will be executed or attached to. Executable files can have
1235 /// dependent modules that are discovered from the object files, or
1236 /// discovered at runtime as things are dynamically loaded.
1237 ///
1238 /// Rebuilding causes any of the current dependent
1239 /// image information to be cleared and replaced with the static
1240 /// dependent image information found by calling
1241 /// ObjectFile::GetDependentModules (FileSpecList&) on the main
1242 /// executable and any modules on which it depends. Calling
1243 /// Process::GetImages() will return the newly found images that
1244 /// were obtained from all of the object files.
1245 ///
1246 /// \param[in] module_sp
1247 /// A shared pointer reference to the module that will become
1248 /// the main executable for this process.
1249 ///
1250 /// \param[in] load_dependent_files
1251 /// If \b true then ask the object files to track down any
1252 /// known dependent files.
1253 ///
1254 /// \see ObjectFile::GetDependentModules (FileSpecList&)
1255 /// \see Process::GetImages()
1257 lldb::ModuleSP &module_sp,
1258 LoadDependentFiles load_dependent_files = eLoadDependentsDefault);
1259
1260 bool LoadScriptingResources(std::list<Status> &errors,
1261 bool continue_on_error = true) {
1262 return m_images.LoadScriptingResourcesInTarget(this, errors,
1263 continue_on_error);
1264 }
1265
1266 /// Get accessor for the images for this process.
1267 ///
1268 /// Each process has a notion of a main executable that is the file
1269 /// that will be executed or attached to. Executable files can have
1270 /// dependent modules that are discovered from the object files, or
1271 /// discovered at runtime as things are dynamically loaded. After
1272 /// a main executable has been set, the images will contain a list
1273 /// of all the files that the executable depends upon as far as the
1274 /// object files know. These images will usually contain valid file
1275 /// virtual addresses only. When the process is launched or attached
1276 /// to, the DynamicLoader plug-in will discover where these images
1277 /// were loaded in memory and will resolve the load virtual
1278 /// addresses is each image, and also in images that are loaded by
1279 /// code.
1280 ///
1281 /// \return
1282 /// A list of Module objects in a module list.
1283 const ModuleList &GetImages() const { return m_images; }
1284
1286
1287 /// Return whether this FileSpec corresponds to a module that should be
1288 /// considered for general searches.
1289 ///
1290 /// This API will be consulted by the SearchFilterForUnconstrainedSearches
1291 /// and any module that returns \b true will not be searched. Note the
1292 /// SearchFilterForUnconstrainedSearches is the search filter that
1293 /// gets used in the CreateBreakpoint calls when no modules is provided.
1294 ///
1295 /// The target call at present just consults the Platform's call of the
1296 /// same name.
1297 ///
1298 /// \param[in] module_spec
1299 /// Path to the module.
1300 ///
1301 /// \return \b true if the module should be excluded, \b false otherwise.
1302 bool ModuleIsExcludedForUnconstrainedSearches(const FileSpec &module_spec);
1303
1304 /// Return whether this module should be considered for general searches.
1305 ///
1306 /// This API will be consulted by the SearchFilterForUnconstrainedSearches
1307 /// and any module that returns \b true will not be searched. Note the
1308 /// SearchFilterForUnconstrainedSearches is the search filter that
1309 /// gets used in the CreateBreakpoint calls when no modules is provided.
1310 ///
1311 /// The target call at present just consults the Platform's call of the
1312 /// same name.
1313 ///
1314 /// FIXME: When we get time we should add a way for the user to set modules
1315 /// that they
1316 /// don't want searched, in addition to or instead of the platform ones.
1317 ///
1318 /// \param[in] module_sp
1319 /// A shared pointer reference to the module that checked.
1320 ///
1321 /// \return \b true if the module should be excluded, \b false otherwise.
1322 bool
1324
1325 const ArchSpec &GetArchitecture() const { return m_arch.GetSpec(); }
1326
1327 /// Returns the name of the target's ABI plugin.
1328 llvm::StringRef GetABIName() const;
1329
1330 /// Set the architecture for this target.
1331 ///
1332 /// If the current target has no Images read in, then this just sets the
1333 /// architecture, which will be used to select the architecture of the
1334 /// ExecutableModule when that is set. If the current target has an
1335 /// ExecutableModule, then calling SetArchitecture with a different
1336 /// architecture from the currently selected one will reset the
1337 /// ExecutableModule to that slice of the file backing the ExecutableModule.
1338 /// If the file backing the ExecutableModule does not contain a fork of this
1339 /// architecture, then this code will return false, and the architecture
1340 /// won't be changed. If the input arch_spec is the same as the already set
1341 /// architecture, this is a no-op.
1342 ///
1343 /// \param[in] arch_spec
1344 /// The new architecture.
1345 ///
1346 /// \param[in] set_platform
1347 /// If \b true, then the platform will be adjusted if the currently
1348 /// selected platform is not compatible with the architecture being set.
1349 /// If \b false, then just the architecture will be set even if the
1350 /// currently selected platform isn't compatible (in case it might be
1351 /// manually set following this function call).
1352 ///
1353 /// \param[in] merged
1354 /// If true, arch_spec is merged with the current
1355 /// architecture. Otherwise it's replaced.
1356 ///
1357 /// \return
1358 /// \b true if the architecture was successfully set, \b false otherwise.
1359 bool SetArchitecture(const ArchSpec &arch_spec, bool set_platform = false,
1360 bool merge = true);
1361
1362 bool MergeArchitecture(const ArchSpec &arch_spec);
1363
1364 Architecture *GetArchitecturePlugin() const { return m_arch.GetPlugin(); }
1365
1366 Debugger &GetDebugger() const { return m_debugger; }
1367
1368 size_t ReadMemoryFromFileCache(const Address &addr, void *dst, size_t dst_len,
1369 Status &error);
1370
1371 // Reading memory through the target allows us to skip going to the process
1372 // for reading memory if possible and it allows us to try and read from any
1373 // constant sections in our object files on disk. If you always want live
1374 // program memory, read straight from the process. If you possibly want to
1375 // read from const sections in object files, read from the target. This
1376 // version of ReadMemory will try and read memory from the process if the
1377 // process is alive. The order is:
1378 // 1 - if (force_live_memory == false) and the address falls in a read-only
1379 // section, then read from the file cache
1380 // 2 - if there is a process, then read from memory
1381 // 3 - if there is no process, then read from the file cache
1382 //
1383 // If did_read_live_memory is provided, will indicate if the read was from
1384 // live memory, or from file contents. A caller which needs to treat these two
1385 // sources differently should use this argument to disambiguate where the data
1386 // was read from.
1387 //
1388 // The method is virtual for mocking in the unit tests.
1389 virtual size_t ReadMemory(const Address &addr, void *dst, size_t dst_len,
1390 Status &error, bool force_live_memory = false,
1391 lldb::addr_t *load_addr_ptr = nullptr,
1392 bool *did_read_live_memory = nullptr);
1393
1394 size_t ReadCStringFromMemory(const Address &addr, std::string &out_str,
1395 Status &error, bool force_live_memory = false);
1396
1397 size_t ReadCStringFromMemory(const Address &addr, char *dst,
1398 size_t dst_max_len, Status &result_error,
1399 bool force_live_memory = false);
1400
1401 /// Read a null-terminated string from memory
1402 ///
1403 /// This function will read a cache page at a time until a null terminator
1404 /// is found. It will stop reading if an aligned null terminator of \a
1405 /// type_width bytes is not found before reading \a cstr_max_len bytes. The
1406 /// results are always guaranteed to be null-terminated, and that no more
1407 /// than (max_bytes - type_width) bytes will be read.
1408 ///
1409 /// \param[in] addr
1410 /// The address to start the memory read.
1411 ///
1412 /// \param[in] dst
1413 /// A character buffer containing at least max_bytes.
1414 ///
1415 /// \param[in] max_bytes
1416 /// The maximum number of bytes to read.
1417 ///
1418 /// \param[in] error
1419 /// The error status of the read operation.
1420 ///
1421 /// \param[in] type_width
1422 /// The size of the null terminator (1 to 4 bytes per
1423 /// character). Defaults to 1.
1424 ///
1425 /// \return
1426 /// The error status or the number of bytes prior to the null terminator.
1427 size_t ReadStringFromMemory(const Address &addr, char *dst, size_t max_bytes,
1428 Status &error, size_t type_width,
1429 bool force_live_memory = true);
1430
1431 size_t ReadScalarIntegerFromMemory(const Address &addr, uint32_t byte_size,
1432 bool is_signed, Scalar &scalar,
1433 Status &error,
1434 bool force_live_memory = false);
1435
1436 int64_t ReadSignedIntegerFromMemory(const Address &addr,
1437 size_t integer_byte_size,
1438 int64_t fail_value, Status &error,
1439 bool force_live_memory = false);
1440
1441 uint64_t ReadUnsignedIntegerFromMemory(const Address &addr,
1442 size_t integer_byte_size,
1443 uint64_t fail_value, Status &error,
1444 bool force_live_memory = false);
1445
1446 bool ReadPointerFromMemory(const Address &addr, Status &error,
1447 Address &pointer_addr,
1448 bool force_live_memory = false);
1449
1450 bool HasLoadedSections();
1451
1453
1454 void ClearSectionLoadList();
1455
1456 void DumpSectionLoadList(Stream &s);
1457
1458 static Target *GetTargetFromContexts(const ExecutionContext *exe_ctx_ptr,
1459 const SymbolContext *sc_ptr);
1460
1461 // lldb::ExecutionContextScope pure virtual functions
1463
1465
1467
1469
1470 void CalculateExecutionContext(ExecutionContext &exe_ctx) override;
1471
1473
1474 llvm::Expected<lldb::TypeSystemSP>
1476 bool create_on_demand = true);
1477
1478 std::vector<lldb::TypeSystemSP>
1479 GetScratchTypeSystems(bool create_on_demand = true);
1480
1483
1484 // Creates a UserExpression for the given language, the rest of the
1485 // parameters have the same meaning as for the UserExpression constructor.
1486 // Returns a new-ed object which the caller owns.
1487
1489 GetUserExpressionForLanguage(llvm::StringRef expr, llvm::StringRef prefix,
1490 SourceLanguage language,
1491 Expression::ResultType desired_type,
1492 const EvaluateExpressionOptions &options,
1493 ValueObject *ctx_obj, Status &error);
1494
1495 // Creates a FunctionCaller for the given language, the rest of the
1496 // parameters have the same meaning as for the FunctionCaller constructor.
1497 // Since a FunctionCaller can't be
1498 // IR Interpreted, it makes no sense to call this with an
1499 // ExecutionContextScope that lacks
1500 // a Process.
1501 // Returns a new-ed object which the caller owns.
1502
1504 const CompilerType &return_type,
1505 const Address &function_address,
1506 const ValueList &arg_value_list,
1507 const char *name, Status &error);
1508
1509 /// Creates and installs a UtilityFunction for the given language.
1510 llvm::Expected<std::unique_ptr<UtilityFunction>>
1511 CreateUtilityFunction(std::string expression, std::string name,
1512 lldb::LanguageType language, ExecutionContext &exe_ctx);
1513
1514 // Install any files through the platform that need be to installed prior to
1515 // launching or attaching.
1516 Status Install(ProcessLaunchInfo *launch_info);
1517
1518 bool ResolveFileAddress(lldb::addr_t load_addr, Address &so_addr);
1519
1520 bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr,
1521 uint32_t stop_id = SectionLoadHistory::eStopIDNow,
1522 bool allow_section_end = false);
1523
1524 bool SetSectionLoadAddress(const lldb::SectionSP &section,
1525 lldb::addr_t load_addr,
1526 bool warn_multiple = false);
1527
1528 size_t UnloadModuleSections(const lldb::ModuleSP &module_sp);
1529
1530 size_t UnloadModuleSections(const ModuleList &module_list);
1531
1532 bool SetSectionUnloaded(const lldb::SectionSP &section_sp);
1533
1534 bool SetSectionUnloaded(const lldb::SectionSP &section_sp,
1535 lldb::addr_t load_addr);
1536
1538
1540 lldb_private::TypeSummaryImpl &summary_provider);
1542
1543 /// Set the \a Trace object containing processor trace information of this
1544 /// target.
1545 ///
1546 /// \param[in] trace_sp
1547 /// The trace object.
1548 void SetTrace(const lldb::TraceSP &trace_sp);
1549
1550 /// Get the \a Trace object containing processor trace information of this
1551 /// target.
1552 ///
1553 /// \return
1554 /// The trace object. It might be undefined.
1556
1557 /// Create a \a Trace object for the current target using the using the
1558 /// default supported tracing technology for this process.
1559 ///
1560 /// \return
1561 /// The new \a Trace or an \a llvm::Error if a \a Trace already exists or
1562 /// the trace couldn't be created.
1563 llvm::Expected<lldb::TraceSP> CreateTrace();
1564
1565 /// If a \a Trace object is present, this returns it, otherwise a new Trace is
1566 /// created with \a Trace::CreateTrace.
1567 llvm::Expected<lldb::TraceSP> GetTraceOrCreate();
1568
1569 // Since expressions results can persist beyond the lifetime of a process,
1570 // and the const expression results are available after a process is gone, we
1571 // provide a way for expressions to be evaluated from the Target itself. If
1572 // an expression is going to be run, then it should have a frame filled in in
1573 // the execution context.
1575 llvm::StringRef expression, ExecutionContextScope *exe_scope,
1576 lldb::ValueObjectSP &result_valobj_sp,
1578 std::string *fixed_expression = nullptr, ValueObject *ctx_obj = nullptr);
1579
1581
1583
1584 /// This method will return the address of the starting function for
1585 /// this binary, e.g. main() or its equivalent. This can be used as
1586 /// an address of a function that is not called once a binary has
1587 /// started running - e.g. as a return address for inferior function
1588 /// calls that are unambiguous completion of the function call, not
1589 /// called during the course of the inferior function code running.
1590 ///
1591 /// If no entry point can be found, an invalid address is returned.
1592 ///
1593 /// \param [out] err
1594 /// This object will be set to failure if no entry address could
1595 /// be found, and may contain a helpful error message.
1596 //
1597 /// \return
1598 /// Returns the entry address for this program, or an error
1599 /// if none can be found.
1600 llvm::Expected<lldb_private::Address> GetEntryPointAddress();
1601
1602 CompilerType GetRegisterType(const RegisterInfo &reg_info);
1603
1604 /// Sends a breakpoint notification event.
1606 lldb::BreakpointEventType event_kind);
1607 /// Sends a breakpoint notification event.
1609 const lldb::EventDataSP &breakpoint_data_sp);
1610
1611 llvm::Expected<lldb::DisassemblerSP>
1612 ReadInstructions(const Address &start_addr, uint32_t count,
1613 const char *flavor_string = nullptr);
1614
1615 // Target Stop Hooks
1616 class StopHook : public UserID {
1617 public:
1618 StopHook(const StopHook &rhs);
1619 virtual ~StopHook() = default;
1620
1621 enum class StopHookKind : uint32_t {
1625 };
1632
1634
1635 // Set the specifier. The stop hook will own the specifier, and is
1636 // responsible for deleting it when we're done.
1637 void SetSpecifier(SymbolContextSpecifier *specifier);
1638
1640
1641 bool ExecutionContextPasses(const ExecutionContext &exe_ctx);
1642
1643 // Called on stop, this gets passed the ExecutionContext for each "stop
1644 // with a reason" thread. It should add to the stream whatever text it
1645 // wants to show the user, and return False to indicate it wants the target
1646 // not to stop.
1648 lldb::StreamSP output) = 0;
1649
1650 // Set the Thread Specifier. The stop hook will own the thread specifier,
1651 // and is responsible for deleting it when we're done.
1652 void SetThreadSpecifier(ThreadSpec *specifier);
1653
1655
1656 bool IsActive() { return m_active; }
1657
1658 void SetIsActive(bool is_active) { m_active = is_active; }
1659
1660 void SetAutoContinue(bool auto_continue) {
1661 m_auto_continue = auto_continue;
1662 }
1663
1664 bool GetAutoContinue() const { return m_auto_continue; }
1665
1666 void SetRunAtInitialStop(bool at_initial_stop) {
1667 m_at_initial_stop = at_initial_stop;
1668 }
1669
1671
1672 void SetSuppressOutput(bool suppress_output) {
1673 m_suppress_output = suppress_output;
1674 }
1675
1676 bool GetSuppressOutput() const { return m_suppress_output; }
1677
1678 void GetDescription(Stream &s, lldb::DescriptionLevel level) const;
1680 lldb::DescriptionLevel level) const = 0;
1681
1682 protected:
1685 std::unique_ptr<ThreadSpec> m_thread_spec_up;
1686 bool m_active = true;
1687 bool m_auto_continue = false;
1689 bool m_suppress_output = false;
1690
1691 StopHook(lldb::TargetSP target_sp, lldb::user_id_t uid);
1692 };
1693
1695 public:
1696 ~StopHookCommandLine() override = default;
1697
1699 void SetActionFromString(const std::string &strings);
1700 void SetActionFromStrings(const std::vector<std::string> &strings);
1701
1703 lldb::StreamSP output_sp) override;
1705 lldb::DescriptionLevel level) const override;
1706
1707 private:
1709 // Use CreateStopHook to make a new empty stop hook. Use SetActionFromString
1710 // to fill it with commands, and SetSpecifier to set the specifier shared
1711 // pointer (can be null, that will match anything.)
1713 : StopHook(target_sp, uid) {}
1714 friend class Target;
1715 };
1716
1718 public:
1719 ~StopHookScripted() override = default;
1721 lldb::StreamSP output) override;
1722
1723 Status SetScriptCallback(const ScriptedMetadata &scripted_metadata);
1724
1726 lldb::DescriptionLevel level) const override;
1727
1728 private:
1729 llvm::StringRef GetScriptClassName() const;
1730
1732
1733 /// Use CreateStopHook to make a new empty stop hook. Use SetScriptCallback
1734 /// to set the script to execute, and SetSpecifier to set the specifier
1735 /// shared pointer (can be null, that will match anything.)
1737 : StopHook(target_sp, uid) {}
1738 friend class Target;
1739 };
1740
1741 class StopHookCoded : public StopHook {
1742 public:
1743 ~StopHookCoded() override = default;
1744
1746 lldb::StreamSP output);
1747
1748 void SetCallback(llvm::StringRef name, HandleStopCallback *callback) {
1749 m_name = name;
1750 m_callback = callback;
1751 }
1752
1754 lldb::StreamSP output) override {
1755 return m_callback(exc_ctx, output);
1756 }
1757
1759 lldb::DescriptionLevel level) const override {
1760 s.Indent();
1761 s.Printf("%s (built-in)\n", m_name.c_str());
1762 }
1763
1764 private:
1765 std::string m_name;
1767
1768 /// Use CreateStopHook to make a new empty stop hook. Use SetCallback to set
1769 /// the callback to execute, and SetSpecifier to set the specifier shared
1770 /// pointer (can be null, that will match anything.)
1772 : StopHook(target_sp, uid) {}
1773 friend class Target;
1774 };
1775
1777
1778 typedef std::shared_ptr<StopHook> StopHookSP;
1779
1780 // Target Hooks
1781 //
1782 // Hooks fire on target lifecycle events. There are two flows:
1783 //
1784 // Command-based hooks: the user specifies which triggers the hook responds
1785 // to (--on-load, --on-unload, --on-stop) and provides a list of commands.
1786 // All commands run for every trigger the hook is signed up for.
1787 //
1788 // Python class hooks: the user provides a Python class name and optional
1789 // extra_args that will be passed to the hook init method (-k key -v value).
1790 // The class controls which events it handles by implementing the
1791 // corresponding callback methods (handle_module_loaded,
1792 // handle_module_unloaded, handle_stop). Triggers are set automatically
1793 // based on which methods exist.
1794 class Hook : public UserID {
1795 public:
1796 Hook(const Hook &rhs);
1797 virtual ~Hook() = default;
1798
1799 enum class HookKind : uint32_t { CommandBased = 0, ScriptBased };
1800
1801 HookKind GetHookKind() const { return m_kind; }
1802
1803 /// Individual trigger bits. Combine with bitwise OR to form a trigger mask.
1804 // FIXME: Add kProcessExit, kProcessDetach, etc. as needed.
1805 enum TriggerBit : uint32_t {
1806 kModulesLoaded = (1u << 0),
1807 kModulesUnloaded = (1u << 1),
1808 kProcessStop = (1u << 2),
1809 };
1810
1812
1813 bool IsEnabled() { return m_enabled; }
1814 void SetIsEnabled(bool enabled) { m_enabled = enabled; }
1815
1816 /// Return the bitmask of triggers this hook responds to.
1817 /// Each bit corresponds to a TriggerBit value.
1818 uint32_t GetTriggerMask() const { return m_trigger_mask; }
1819
1820 /// Return true if this hook fires on the given trigger.
1821 bool FiresOn(uint32_t trigger) const { return m_trigger_mask & trigger; }
1822
1823 // Filter fields
1824
1825 /// Set the symbol context specifier. The hook takes ownership.
1826 void SetSCSpecifier(SymbolContextSpecifier *specifier);
1828
1829 /// Check if the execution context passes the specifier and thread spec
1830 /// filters. Always returns true if no filters are set.
1831 bool ExecutionContextPasses(const ExecutionContext &exe_ctx);
1832
1833 /// Set the thread specifier. The hook takes ownership.
1834 void SetThreadSpecifier(ThreadSpec *specifier);
1836
1837 void SetRunAtInitialStop(bool at_initial_stop) {
1838 m_at_initial_stop = at_initial_stop;
1839 }
1841
1842 // Reaction settings
1843
1844 void SetAutoContinue(bool auto_continue) {
1845 m_auto_continue = auto_continue;
1846 }
1847 bool GetAutoContinue() const { return m_auto_continue; }
1848
1849 void SetSuppressOutput(bool suppress_output) {
1850 m_suppress_output = suppress_output;
1851 }
1852 bool GetSuppressOutput() const { return m_suppress_output; }
1853
1854 // Event handler methods (default no-ops)
1855
1856 virtual void HandleModuleLoaded(lldb::StreamSP output) {}
1857 virtual void HandleModuleUnloaded(lldb::StreamSP output) {}
1858
1859 /// Called when the process stops. Returns a StopHookResult indicating
1860 /// whether the process should remain stopped or continue.
1865
1866 virtual void GetDescription(Stream &s, lldb::DescriptionLevel level) const;
1867
1868 protected:
1869 /// Print the filter portion of the description (AutoContinue, Specifier,
1870 /// ThreadSpec). Called by subclass GetDescription after printing the
1871 /// hook-specific content (commands or class).
1875 bool m_enabled = true;
1876 uint32_t m_trigger_mask = 0; // No default, triggers must be explicit.
1877
1878 // Filters
1880 std::unique_ptr<ThreadSpec> m_thread_spec_up;
1882
1883 // Reaction settings
1884 bool m_auto_continue = false;
1885 bool m_suppress_output = false;
1886
1887 Hook(lldb::TargetSP target_sp, lldb::user_id_t uid, HookKind kind);
1888 };
1889
1890 class HookCommandLine : public Hook {
1891 public:
1892 ~HookCommandLine() override = default;
1893
1894 /// Replace the trigger mask. \a mask is a bitwise OR of TriggerBit values.
1895 void SetTriggerMask(uint32_t mask) { m_trigger_mask = mask; }
1896
1897 /// Add a trigger to the mask. \a trigger is a single TriggerBit value.
1898 void AddTrigger(uint32_t trigger) { m_trigger_mask |= trigger; }
1899
1900 /// Remove a trigger from the mask. \a trigger is a single TriggerBit value.
1901 void RemoveTrigger(uint32_t trigger) { m_trigger_mask &= ~trigger; }
1902
1903 /// Return the list of commands that this hook runs.
1905
1906 /// Populate the command list by splitting a single string on newlines.
1907 void SetActionFromString(const std::string &string);
1908
1909 /// Populate the command list from a vector of individual command strings.
1910 void SetActionFromStrings(const std::vector<std::string> &strings);
1911
1912 void GetDescription(Stream &s, lldb::DescriptionLevel level) const override;
1913 void HandleModuleLoaded(lldb::StreamSP output) override;
1914 void HandleModuleUnloaded(lldb::StreamSP output) override;
1916 lldb::StreamSP output) override;
1917
1918 private:
1920
1922 : Hook(target_sp, uid, HookKind::CommandBased) {}
1923 friend class Target;
1924 };
1925
1926 class HookScripted : public Hook {
1927 public:
1928 ~HookScripted() override = default;
1929
1930 void GetDescription(Stream &s, lldb::DescriptionLevel level) const override;
1931
1932 void HandleModuleLoaded(lldb::StreamSP output) override;
1933 void HandleModuleUnloaded(lldb::StreamSP output) override;
1935 lldb::StreamSP output) override;
1936
1937 Status SetScriptCallback(const ScriptedMetadata &scripted_metadata);
1938
1939 private:
1940 llvm::StringRef GetScriptClassName() const;
1941
1943
1945 : Hook(target_sp, uid, HookKind::ScriptBased) {}
1946 friend class Target;
1947 };
1948
1949 typedef std::shared_ptr<Hook> HookSP;
1950
1952
1953 /// Removes the most recently created hook. Used to roll back a
1954 /// hook creation when an error occurs (e.g., invalid script class name
1955 /// or empty interactive input).
1957
1959
1960 void RemoveAllHooks();
1961
1963
1964 bool SetHookEnabledStateByID(lldb::user_id_t uid, bool enabled);
1965
1966 void SetAllHooksEnabledState(bool enabled);
1967
1968 size_t GetNumHooks() const { return m_hooks.size(); }
1969
1970 HookSP GetHookAtIndex(size_t index);
1971
1972 void RunModuleHooks(bool is_load);
1973
1974 /// Add an empty stop hook to the Target's stop hook list, and returns a
1975 /// shared pointer to the new hook.
1976 StopHookSP CreateStopHook(StopHook::StopHookKind kind, bool internal = false);
1977
1978 /// If you tried to create a stop hook, and that failed, call this to
1979 /// remove the stop hook, as it will also reset the stop hook counter.
1981
1982 // Runs the stop hooks that have been registered for this target.
1983 // Returns true if the stop hooks cause the target to resume.
1984 // Pass at_initial_stop if this is the stop where lldb gains
1985 // control over the process for the first time.
1986 bool RunStopHooks(bool at_initial_stop = false);
1987
1988 bool SetSuppresStopHooks(bool suppress) {
1989 bool old_value = m_suppress_stop_hooks;
1990 m_suppress_stop_hooks = suppress;
1991 return old_value;
1992 }
1993
1995
1997
1998 void RemoveAllStopHooks();
1999
2000 StopHookSP GetStopHookByID(lldb::user_id_t uid);
2001
2002 bool SetStopHookActiveStateByID(lldb::user_id_t uid, bool active_state);
2003
2004 void SetAllStopHooksActiveState(bool active_state);
2005
2006 const std::vector<StopHookSP> GetStopHooks(bool internal = false) const;
2007
2009
2010 void SetPlatform(const lldb::PlatformSP &platform_sp) {
2011 m_platform_sp = platform_sp;
2012 }
2013
2015
2016 // Methods.
2018 GetSearchFilterForModule(const FileSpec *containingModule);
2019
2021 GetSearchFilterForModuleList(const FileSpecList *containingModuleList);
2022
2024 GetSearchFilterForModuleAndCUList(const FileSpecList *containingModules,
2025 const FileSpecList *containingSourceFiles);
2026
2028 const char *repl_options, bool can_create);
2029
2030 void SetREPL(lldb::LanguageType language, lldb::REPLSP repl_sp);
2031
2035
2037
2038 /// Get the list of paths that LLDB will consider automatically loading
2039 /// scripting resources from. Currently whether to load scripts
2040 /// unconditionally is controlled via the
2041 /// `target.load-script-from-symbol-file` setting.
2043
2044 /// Add a signal for the target. This will get copied over to the process
2045 /// if the signal exists on that target. Only the values with Yes and No are
2046 /// set, Calculate values will be ignored.
2047protected:
2056 using DummySignalElement = llvm::StringMapEntry<DummySignalValues>;
2057 static bool UpdateSignalFromDummy(lldb::UnixSignalsSP signals_sp,
2058 const DummySignalElement &element);
2059 static bool ResetSignalFromDummy(lldb::UnixSignalsSP signals_sp,
2060 const DummySignalElement &element);
2061
2062public:
2063 /// Add a signal to the Target's list of stored signals/actions. These
2064 /// values will get copied into any processes launched from
2065 /// this target.
2066 void AddDummySignal(llvm::StringRef name, LazyBool pass, LazyBool print,
2067 LazyBool stop);
2068 /// Updates the signals in signals_sp using the stored dummy signals.
2069 /// If warning_stream_sp is not null, if any stored signals are not found in
2070 /// the current process, a warning will be emitted here.
2072 lldb::StreamSP warning_stream_sp);
2073 /// Clear the dummy signals in signal_names from the target, or all signals
2074 /// if signal_names is empty. Also remove the behaviors they set from the
2075 /// process's signals if it exists.
2076 void ClearDummySignals(Args &signal_names);
2077 /// Print all the signals set in this target.
2078 void PrintDummySignals(Stream &strm, Args &signals);
2079
2080 /// Return the target groups this target belongs to.
2081 std::vector<lldb::TargetGroupSP> GetTargetGroups() const;
2082
2083 /// Return the first target group that can be cast to GroupT.
2084 template <typename GroupT>
2085 std::shared_ptr<GroupT> GetFirstTargetGroupOfType() const {
2086 static_assert(std::is_base_of_v<TargetGroup, GroupT>,
2087 "GroupT must derive from TargetGroup");
2088 for (const lldb::TargetGroupSP &group_sp : GetTargetGroups()) {
2089 if (GroupT *group = llvm::dyn_cast<GroupT>(group_sp.get()))
2090 return std::shared_ptr<GroupT>(group_sp, group);
2091 }
2092 return {};
2093 }
2094
2095protected:
2096 friend class TargetGroup;
2097 friend class TargetGroupList;
2098
2099 /// Called only by TargetGroup::AddTarget to record group membership.
2100 void AddTargetGroup(const lldb::TargetGroupSP &group_sp);
2101 /// Called only by TargetGroup::RemoveTarget to remove group membership.
2102 void RemoveTargetGroup(const TargetGroup *group);
2103
2104 /// The mutex the calling thread must serialize on for its current policy, or
2105 /// nullptr when that policy bypasses the API mutex entirely.
2106 std::recursive_mutex *GetAPIMutexForCurrentPolicy();
2107
2108 /// Implementing of ModuleList::Notifier.
2109
2110 void NotifyModuleAdded(const ModuleList &module_list,
2111 const lldb::ModuleSP &module_sp) override;
2112
2113 void NotifyModuleRemoved(const ModuleList &module_list,
2114 const lldb::ModuleSP &module_sp) override;
2115
2116 void NotifyModuleUpdated(const ModuleList &module_list,
2117 const lldb::ModuleSP &old_module_sp,
2118 const lldb::ModuleSP &new_module_sp) override;
2119
2120 void NotifyWillClearList(const ModuleList &module_list) override;
2121
2122 void NotifyModulesRemoved(lldb_private::ModuleList &module_list) override;
2123
2124 class Arch {
2125 public:
2126 explicit Arch(const ArchSpec &spec);
2127 const Arch &operator=(const ArchSpec &spec);
2128
2129 const ArchSpec &GetSpec() const { return m_spec; }
2130 Architecture *GetPlugin() const { return m_plugin_up.get(); }
2131
2132 private:
2134 std::unique_ptr<Architecture> m_plugin_up;
2135 };
2136
2137 // Member variables.
2139 lldb::PlatformSP m_platform_sp; ///< The platform for this target.
2140 std::recursive_mutex m_mutex; ///< An API mutex that is used by the lldb::SB*
2141 /// classes make the SB interface thread safe
2142 /// When the private state thread calls SB API's - usually because it is
2143 /// running OS plugin or Python ThreadPlan code - it should not block on the
2144 /// API mutex that is held by the code that kicked off the sequence of events
2145 /// that led us to run the code. We hand out this mutex instead when we
2146 /// detect that code is running on the private state thread.
2147 std::recursive_mutex m_private_mutex;
2149 std::string m_label;
2150 ModuleList m_images; ///< The list of images for this process (shared
2151 /// libraries and anything dynamically loaded).
2152 /// The marked main executable. Weak, so it can't outlive its image.
2158 using BreakpointNameMap = llvm::StringMap<std::unique_ptr<BreakpointName>>;
2160
2161 std::map<lldb::user_id_t, BreakpointResolverOverrideUP>
2163 /// This is the ID that will be handed out for the next added breakpoint
2164 /// override resolver for this target.
2166
2170 // We want to tightly control the process destruction process so we can
2171 // correctly tear down everything that we need to, so the only class that
2172 // knows about the process lifespan is this target class.
2177
2178 /// Map of scripted frame provider descriptors for this target.
2179 /// Keys are the provider descriptor IDs, values are the descriptors.
2180 /// Insertion order is preserved so that equal-priority providers chain
2181 /// in registration order.
2182 llvm::MapVector<uint32_t, ScriptedFrameProviderDescriptor>
2184 mutable std::recursive_mutex m_frame_provider_descriptors_mutex;
2186
2187 typedef std::map<lldb::LanguageType, lldb::REPLSP> REPLMap;
2189
2191
2192 typedef std::map<lldb::user_id_t, StopHookSP> StopHookCollection;
2195 std::vector<StopHookSP> m_internal_stop_hooks;
2196 uint32_t m_latest_stop_hook_id; /// This records the last natural stop at
2197 /// which we ran a stop-hook.
2199 bool m_suppress_stop_hooks; /// Used to not run stop hooks for expressions
2201
2202 typedef std::map<lldb::user_id_t, HookSP> HookCollection;
2207 LLDB_INVALID_GLOBALLY_UNIQUE_TARGET_ID; ///< The globally unique ID
2208 /// assigned to this target
2209 std::string m_target_session_name; ///< The target session name for this
2210 /// target, used to name debugging
2211 /// sessions in DAP.
2212 /// An optional \a lldb_private::Trace object containing processor trace
2213 /// information of this target.
2215 /// Stores the frame recognizers of this target.
2217 /// These are used to set the signal state when you don't have a process and
2218 /// more usefully in the Dummy target where you can't know exactly what
2219 /// signals you will have.
2220 llvm::StringMap<DummySignalValues> m_dummy_signals;
2221
2222 /// Every target group this target belongs to.
2224
2226
2227 static void ImageSearchPathsChanged(const PathMappingList &path_list,
2228 void *baton);
2229
2230 // Utilities for `statistics` command.
2231private:
2232 // Target metrics storage.
2234
2235public:
2236 /// Get metrics associated with this target in JSON format.
2237 ///
2238 /// Target metrics help measure timings and information that is contained in
2239 /// a target. These are designed to help measure performance of a debug
2240 /// session as well as represent the current state of the target, like
2241 /// information on the currently modules, currently set breakpoints and more.
2242 ///
2243 /// \return
2244 /// Returns a JSON value that contains all target metrics.
2245 llvm::json::Value
2247
2248 void ResetStatistics();
2249
2251
2252protected:
2253 /// Construct with optional file and arch.
2254 ///
2255 /// This member is private. Clients must use
2256 /// TargetList::CreateTarget(const FileSpec*, const ArchSpec*)
2257 /// so all targets can be tracked from the central target list.
2258 ///
2259 /// \see TargetList::CreateTarget(const FileSpec*, const ArchSpec*)
2260 Target(Debugger &debugger, const ArchSpec &target_arch,
2261 const lldb::PlatformSP &platform_sp, bool is_dummy_target);
2262
2263 // Helper function.
2264 bool ProcessIsValid();
2265
2266 // Copy breakpoints, stop hooks and so forth from the dummy target:
2267 void PrimeFromDummyTarget(Target &target);
2268
2269 void AddBreakpoint(lldb::BreakpointSP breakpoint_sp, bool internal);
2270
2272
2273 /// Return a recommended size for memory reads at \a addr, optimizing for
2274 /// cache usage.
2276
2277 Target(const Target &) = delete;
2278 const Target &operator=(const Target &) = delete;
2279
2281 return m_section_load_history.GetCurrentSectionLoadList();
2282 }
2283};
2284
2285} // namespace lldb_private
2286
2287#endif // LLDB_TARGET_TARGET_H
static llvm::raw_ostream & error(Stream &strm)
A section + offset based address class.
Definition Address.h:62
An architecture specification class.
Definition ArchSpec.h:32
A command line argument class.
Definition Args.h:33
General Outline: Allows adding and removing breakpoints and find by ID and index.
"lldb/Breakpoint/BreakpointOptions.h" Class that manages the options on a breakpoint or breakpoint lo...
General Outline: A breakpoint has four main parts, a filter, a resolver, the list of breakpoint locat...
Definition Breakpoint.h:83
Broadcaster(lldb::BroadcasterManagerSP manager_sp, std::string name)
Construct with a broadcaster with a name.
Generic representation of a type in a programming language.
A uniqued constant string class.
Definition ConstString.h:40
A class to manage flag bits.
Definition Debugger.h:103
void SetPreferredSymbolContexts(SymbolContextList contexts)
Definition Target.h:378
void SetOneThreadTimeout(const Timeout< std::micro > &timeout)
Definition Target.h:437
void SetUnwindOnError(bool unwind=false)
Definition Target.h:410
SourceLanguage GetLanguage() const
Definition Target.h:372
const char * GetPoundLineFilePath() const
Definition Target.h:500
lldb::DynamicValueType m_use_dynamic
Definition Target.h:576
void SetExecutionPolicy(ExecutionPolicy policy=eExecutionPolicyAlways)
Definition Target.h:368
Timeout< std::micro > m_one_thread_timeout
Definition Target.h:578
bool InvokeCancelCallback(lldb::ExpressionEvaluationPhase phase) const
Definition Target.h:482
lldb::DynamicValueType GetUseDynamic() const
Definition Target.h:422
void SetKeepInMemory(bool keep=true)
Definition Target.h:420
bool m_try_DIL_first
If enabled, Data Inspection Language (DIL) should attempt to evaluate the expression first.
Definition Target.h:574
void SetCoerceToId(bool coerce=true)
Definition Target.h:406
void SetLanguage(lldb::LanguageType language_type)
Definition Target.h:374
ExecutionPolicy GetExecutionPolicy() const
Definition Target.h:366
Timeout< std::micro > m_timeout
Definition Target.h:577
void SetCppIgnoreContextQualifiers(bool value)
Definition Target.cpp:6249
const StructuredData::Dictionary & GetLanguageOptions() const
Definition Target.cpp:6227
llvm::Expected< bool > GetBooleanLanguageOption(llvm::StringRef option_name) const
Get the language-plugin specific boolean option called option_name.
Definition Target.cpp:6211
void SetPrefix(const char *prefix)
Definition Target.h:399
void SetTryAllThreads(bool try_others=true)
Definition Target.h:443
static constexpr std::chrono::milliseconds default_timeout
Definition Target.h:358
void SetPoundLine(const char *path, uint32_t line) const
Definition Target.h:490
void SetRetriesWithFixIts(uint64_t number_of_retries)
Definition Target.h:516
SymbolContextList m_preferred_lookup_contexts
During expression evaluation, any SymbolContext in this list will be used for symbol/function lookup ...
Definition Target.h:594
void SetTimeout(const Timeout< std::micro > &timeout)
Definition Target.h:431
static constexpr ExecutionPolicy default_execution_policy
Definition Target.h:363
void SetStopOthers(bool stop_others=true)
Definition Target.h:447
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:570
llvm::Error SetBooleanLanguageOption(llvm::StringRef option_name, bool value)
Set language-plugin specific option called option_name to the specified boolean value.
Definition Target.cpp:6194
StructuredData::DictionarySP m_language_options_sp
Dictionary mapping names of language-plugin specific options to values.
Definition Target.h:589
void SetCancelCallback(lldb::ExpressionCancelCallback callback, void *baton)
Definition Target.h:477
const Timeout< std::micro > & GetTimeout() const
Definition Target.h:429
const SymbolContextList & GetPreferredSymbolContexts() const
Definition Target.h:382
void SetIgnoreBreakpoints(bool ignore=false)
Definition Target.h:414
void SetLanguage(uint16_t name, uint32_t version)
Set the language using a pair of language code and version as defined by the DWARF 6 specification.
Definition Target.h:389
void SetUseDynamic(lldb::DynamicValueType dynamic=lldb::eDynamicCanRunTarget)
Definition Target.h:425
lldb::ExpressionCancelCallback m_cancel_callback
Definition Target.h:579
const Timeout< std::micro > & GetOneThreadTimeout() const
Definition Target.h:433
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A file collection class.
A file utility class.
Definition FileSpec.h:56
Encapsulates a function that can be called.
A collection class for Module objects.
Definition ModuleList.h:128
A class that describes an executable image and its associated object and symbol files.
Definition Module.h:91
Class that provides a registry of known stack frame recognizers.
An error handling class.
Definition Status.h:118
A stream class that can stream formatted output to a file.
Definition Stream.h:28
size_t Indent(llvm::StringRef s="")
Indent the current line in the stream.
Definition Stream.cpp:157
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition Stream.cpp:134
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
A class that wraps a std::map of SummaryStatistics objects behind a mutex.
Definition Statistics.h:281
Defines a list of symbol context objects.
Defines a symbol context baton that can be handed other debug core functions.
A Lockable handle over a Target's API mutex, returned by Target::GetAPIMutex() and backing the public...
bool GetUseDILForCreatingValues() const
Definition Target.cpp:5288
uint32_t GetMaximumSizeOfStringSummary() const
Definition Target.cpp:5715
FileSpecList GetDebugFileSearchPaths()
Definition Target.cpp:5590
llvm::StringRef GetLaunchWorkingDirectory() const
Definition Target.cpp:5396
bool GetDisplayRecognizedArguments() const
Definition Target.cpp:5886
ImportStdModule GetImportStdModule() const
Definition Target.cpp:5606
void AppendExecutableSearchPaths(const FileSpec &)
Definition Target.cpp:5577
bool GetEnableSyntheticValue() const
Definition Target.cpp:5682
void SetStandardInputPath(const char *path)=delete
ProcessLaunchInfo m_launch_info
Definition Target.h:341
bool GetCheckValueObjectOwnership() const
Definition Target.cpp:6014
uint64_t GetExprAllocAlign() const
Definition Target.cpp:5794
MemoryModuleLoadLevel GetMemoryModuleLoadLevel() const
Definition Target.cpp:5858
llvm::StringRef GetArg0() const
Definition Target.cpp:5449
uint32_t GetMaximumMemReadSize() const
Definition Target.cpp:5721
void SetRunArguments(const Args &args)
Definition Target.cpp:5466
FileSpec GetStandardErrorPath() const
Definition Target.cpp:5747
void SetLoadScriptFromSymbolFile(LoadScriptFromSymFile load_style)
Set the target-wide target.load-script-from-symbol-file setting.
Definition Target.cpp:5838
bool GetEnableNotifyAboutFixIts() const
Definition Target.cpp:5632
bool SetPreferDynamicValue(lldb::DynamicValueType d)
Definition Target.cpp:5333
void SetDisplayRecognizedArguments(bool b)
Definition Target.cpp:5892
void SetUseDILForCreatingValues(bool b)
Definition Target.cpp:5301
std::optional< bool > GetExperimentalPropertyValue(size_t prop_idx, ExecutionContext *exe_ctx=nullptr) const
Definition Target.cpp:5250
const ProcessLaunchInfo & GetProcessLaunchInfo() const
Definition Target.cpp:5897
Environment ComputeEnvironment() const
Definition Target.cpp:5472
void SetStandardOutputPath(const char *path)=delete
bool GetUserSpecifiedTrapHandlerNames(Args &args) const
Definition Target.cpp:5865
uint64_t GetExprErrorLimit() const
Definition Target.cpp:5776
bool GetEnableAutoImportClangModules() const
Definition Target.cpp:5600
bool GetDebugUtilityExpression() const
Definition Target.cpp:6003
JITEngine GetJITEngine() const
Definition Target.cpp:5643
DynamicClassInfoHelper GetDynamicClassInfoHelper() const
Definition Target.cpp:5613
FileSpec GetStandardOutputPath() const
Definition Target.cpp:5737
void SetDisplayRuntimeSupportValues(bool b)
Definition Target.cpp:5881
uint32_t GetMaximumNumberOfChildrenToDisplay() const
Definition Target.cpp:5700
void SetRequireHardwareBreakpoints(bool b)
Definition Target.cpp:5935
lldb::BreakpointConditionMode GetBreakpointsConditionMode() const
Definition Target.cpp:5806
bool GetAutoInstallMainExecutable() const
Definition Target.cpp:5940
const char * GetDisassemblyFeatures() const
Definition Target.cpp:5428
void SetAutoLoadScriptsForModule(llvm::StringRef module_name, LoadScriptFromSymFile load_style)
Set the LoadScriptFromSymFile for a module called module_name (excluding file extension).
Definition Target.cpp:6040
RealpathPrefixes GetSourceRealpathPrefixes() const
Definition Target.cpp:5444
void SetCheckValueObjectOwnership(bool check)
Definition Target.cpp:6020
uint64_t GetNumberOfRetriesWithFixits() const
Definition Target.cpp:5626
uint64_t GetExprAllocSize() const
Definition Target.cpp:5788
std::optional< LoadScriptFromSymFile > GetAutoLoadScriptsForModule(llvm::StringRef module_name) const
Definition Target.cpp:6026
llvm::StringRef GetExpressionPrefixContents()
Definition Target.cpp:5762
PathMappingList & GetObjectPathMap() const
Definition Target.cpp:5563
const char * GetDisassemblyFlavor() const
Definition Target.cpp:5408
FileSpec GetStandardInputPath() const
Definition Target.cpp:5727
lldb::DynamicValueType GetPreferDynamicValue() const
Definition Target.cpp:5326
InlineStrategy GetInlineStrategy() const
Definition Target.cpp:5435
Environment GetTargetEnvironment() const
Definition Target.cpp:5532
bool GetDisplayRuntimeSupportValues() const
Definition Target.cpp:5875
void SetUserSpecifiedTrapHandlerNames(const Args &args)
Definition Target.cpp:5870
uint32_t GetMaxZeroPaddingInFloatFormat() const
Definition Target.cpp:5694
uint64_t GetExprAllocAddress() const
Definition Target.cpp:5782
LoadCWDlldbinitFile GetLoadCWDlldbinitFile() const
Definition Target.cpp:5844
Environment GetInheritedEnvironment() const
Definition Target.cpp:5504
void SetArg0(llvm::StringRef arg)
Definition Target.cpp:5455
bool GetInjectLocalVariables(ExecutionContext *exe_ctx) const
Definition Target.cpp:5261
void SetStandardErrorPath(const char *path)=delete
bool ShowHexVariableValuesWithLeadingZeroes() const
Definition Target.cpp:5688
SourceLanguage GetLanguage() const
Definition Target.cpp:5757
Environment GetEnvironment() const
Definition Target.cpp:5500
void SetProcessLaunchInfo(const ProcessLaunchInfo &launch_info)
Definition Target.cpp:5901
FileSpec GetSaveJITObjectsDir() const
Definition Target.cpp:5638
void SetEnvironment(Environment env)
Definition Target.cpp:5543
LoadScriptFromSymFile GetLoadScriptFromSymbolFile() const
Definition Target.cpp:5831
const char * GetDisassemblyCPU() const
Definition Target.cpp:5421
void SetStandardErrorPath(llvm::StringRef path)
Definition Target.cpp:5752
bool GetRunArguments(Args &args) const
Definition Target.cpp:5461
FileSpecList GetExecutableSearchPaths()
Definition Target.cpp:5585
ArchSpec GetDefaultArchitecture() const
Definition Target.cpp:5310
Disassembler::HexImmediateStyle GetHexImmediateStyle() const
Definition Target.cpp:5851
void SetUseDIL(ExecutionContext *exe_ctx, bool b)
Definition Target.cpp:5279
std::unique_ptr< TargetExperimentalProperties > m_experimental_properties_up
Definition Target.h:342
FileSpecList GetClangModuleSearchPaths()
Definition Target.cpp:5595
void SetStandardOutputPath(llvm::StringRef path)
Definition Target.cpp:5742
bool GetRequireHardwareBreakpoints() const
Definition Target.cpp:5929
PathMappingList & GetSourcePathMap() const
Definition Target.cpp:5555
bool GetAutoSourceMapRelative() const
Definition Target.cpp:5571
bool GetUseDIL(ExecutionContext *exe_ctx) const
Definition Target.cpp:5267
void SetDefaultArchitecture(const ArchSpec &arch)
Definition Target.cpp:5315
void SetStandardInputPath(llvm::StringRef path)
Definition Target.cpp:5732
TargetProperties(Target *target)
Definition Target.cpp:5174
bool GetDisplayExpressionsInCrashlogs() const
Definition Target.cpp:5825
bool GetEnableAutoApplyFixIts() const
Definition Target.cpp:5620
void SetDebugUtilityExpression(bool debug)
Definition Target.cpp:6009
std::pair< uint32_t, bool > GetMaximumDepthOfChildrenToDisplay() const
Get the max depth value, augmented with a bool to indicate whether the depth is the default.
Definition Target.cpp:5707
A class that represents statistics for a since lldb_private::Target.
Definition Statistics.h:309
std::unique_ptr< Architecture > m_plugin_up
Definition Target.h:2134
const ArchSpec & GetSpec() const
Definition Target.h:2129
const Arch & operator=(const ArchSpec &spec)
Definition Target.cpp:171
Arch(const ArchSpec &spec)
Definition Target.cpp:167
Architecture * GetPlugin() const
Definition Target.h:2130
virtual BreakpointResolverOverrideUP CopyIntoNewTarget(Target &target)=0
BreakpointResolverOverride(Target &target, const std::string &description, uint64_t type_mask)
Definition Target.h:1057
virtual lldb::BreakpointResolverSP CheckForOverride(Target &target, lldb::BreakpointResolverSP initial_sp)=0
void AddTrigger(uint32_t trigger)
Add a trigger to the mask. trigger is a single TriggerBit value.
Definition Target.h:1898
void RemoveTrigger(uint32_t trigger)
Remove a trigger from the mask. trigger is a single TriggerBit value.
Definition Target.h:1901
void GetDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.cpp:4578
HookCommandLine(lldb::TargetSP target_sp, lldb::user_id_t uid)
Definition Target.h:1921
void SetTriggerMask(uint32_t mask)
Replace the trigger mask. mask is a bitwise OR of TriggerBit values.
Definition Target.h:1895
void SetActionFromString(const std::string &string)
Populate the command list by splitting a single string on newlines.
Definition Target.cpp:4605
void SetActionFromStrings(const std::vector< std::string > &strings)
Populate the command list from a vector of individual command strings.
Definition Target.cpp:4609
void HandleModuleLoaded(lldb::StreamSP output) override
Definition Target.cpp:4615
StringList & GetCommands()
Return the list of commands that this hook runs.
Definition Target.h:1904
StopHook::StopHookResult HandleStop(ExecutionContext &exe_ctx, lldb::StreamSP output) override
Called when the process stops.
Definition Target.cpp:4655
void HandleModuleUnloaded(lldb::StreamSP output) override
Definition Target.cpp:4649
llvm::StringRef GetScriptClassName() const
Definition Target.cpp:4787
Status SetScriptCallback(const ScriptedMetadata &scripted_metadata)
Definition Target.cpp:4690
void HandleModuleLoaded(lldb::StreamSP output) override
Definition Target.cpp:4732
StopHook::StopHookResult HandleStop(ExecutionContext &exe_ctx, lldb::StreamSP output) override
Called when the process stops.
Definition Target.cpp:4765
HookScripted(lldb::TargetSP target_sp, lldb::user_id_t uid)
Definition Target.h:1944
void GetDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.cpp:4793
lldb::ScriptedHookInterfaceSP m_interface_sp
Definition Target.h:1942
void HandleModuleUnloaded(lldb::StreamSP output) override
Definition Target.cpp:4748
virtual ~Hook()=default
void SetSuppressOutput(bool suppress_output)
Definition Target.h:1849
bool GetRunAtInitialStop() const
Definition Target.h:1840
ThreadSpec * GetThreadSpecifier()
Definition Target.h:1835
TriggerBit
Individual trigger bits. Combine with bitwise OR to form a trigger mask.
Definition Target.h:1805
bool GetSuppressOutput() const
Definition Target.h:1852
void SetRunAtInitialStop(bool at_initial_stop)
Definition Target.h:1837
lldb::SymbolContextSpecifierSP m_sc_specifier_sp
Definition Target.h:1879
void SetIsEnabled(bool enabled)
Definition Target.h:1814
bool ExecutionContextPasses(const ExecutionContext &exe_ctx)
Check if the execution context passes the specifier and thread spec filters.
Definition Target.cpp:4501
HookKind GetHookKind() const
Definition Target.h:1801
Hook(const Hook &rhs)
Definition Target.cpp:4482
virtual StopHook::StopHookResult HandleStop(ExecutionContext &exe_ctx, lldb::StreamSP output)
Called when the process stops.
Definition Target.h:1861
void GetFilterDescription(Stream &s, lldb::DescriptionLevel level) const
Print the filter portion of the description (AutoContinue, Specifier, ThreadSpec).
Definition Target.cpp:4550
void SetAutoContinue(bool auto_continue)
Definition Target.h:1844
bool GetAutoContinue() const
Definition Target.h:1847
virtual void HandleModuleUnloaded(lldb::StreamSP output)
Definition Target.h:1857
uint32_t GetTriggerMask() const
Return the bitmask of triggers this hook responds to.
Definition Target.h:1818
lldb::TargetSP & GetTarget()
Definition Target.h:1811
SymbolContextSpecifier * GetSCSpecifier()
Definition Target.h:1827
lldb::TargetSP m_target_sp
Definition Target.h:1873
virtual void GetDescription(Stream &s, lldb::DescriptionLevel level) const
Definition Target.cpp:4517
void SetSCSpecifier(SymbolContextSpecifier *specifier)
Set the symbol context specifier. The hook takes ownership.
Definition Target.cpp:4493
void SetThreadSpecifier(ThreadSpec *specifier)
Set the thread specifier. The hook takes ownership.
Definition Target.cpp:4497
virtual void HandleModuleLoaded(lldb::StreamSP output)
Definition Target.h:1856
bool FiresOn(uint32_t trigger) const
Return true if this hook fires on the given trigger.
Definition Target.h:1821
std::unique_ptr< ThreadSpec > m_thread_spec_up
Definition Target.h:1880
void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.h:1758
HandleStopCallback * m_callback
Definition Target.h:1766
StopHookResult HandleStop(ExecutionContext &exc_ctx, lldb::StreamSP output) override
Definition Target.h:1753
StopHookCoded(lldb::TargetSP target_sp, lldb::user_id_t uid)
Use CreateStopHook to make a new empty stop hook.
Definition Target.h:1771
void SetCallback(llvm::StringRef name, HandleStopCallback *callback)
Definition Target.h:1748
StopHookResult(ExecutionContext &exc_ctx, lldb::StreamSP output) HandleStopCallback
Definition Target.h:1745
void SetActionFromString(const std::string &strings)
Definition Target.cpp:4315
StopHookCommandLine(lldb::TargetSP target_sp, lldb::user_id_t uid)
Definition Target.h:1712
void SetActionFromStrings(const std::vector< std::string > &strings)
Definition Target.cpp:4319
StopHookResult HandleStop(ExecutionContext &exc_ctx, lldb::StreamSP output_sp) override
Definition Target.cpp:4326
void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.cpp:4297
lldb::ScriptedHookInterfaceSP m_interface_sp
Definition Target.h:1731
StopHookResult HandleStop(ExecutionContext &exc_ctx, lldb::StreamSP output) override
Definition Target.cpp:4411
Status SetScriptCallback(const ScriptedMetadata &scripted_metadata)
Definition Target.cpp:4361
StopHookScripted(lldb::TargetSP target_sp, lldb::user_id_t uid)
Use CreateStopHook to make a new empty stop hook.
Definition Target.h:1736
void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.cpp:4440
llvm::StringRef GetScriptClassName() const
Definition Target.cpp:4434
bool GetRunAtInitialStop() const
Definition Target.h:1670
SymbolContextSpecifier * GetSpecifier()
Definition Target.h:1639
void SetSpecifier(SymbolContextSpecifier *specifier)
Definition Target.cpp:4235
virtual StopHookResult HandleStop(ExecutionContext &exe_ctx, lldb::StreamSP output)=0
std::unique_ptr< ThreadSpec > m_thread_spec_up
Definition Target.h:1685
void SetIsActive(bool is_active)
Definition Target.h:1658
void SetSuppressOutput(bool suppress_output)
Definition Target.h:1672
void SetThreadSpecifier(ThreadSpec *specifier)
Definition Target.cpp:4239
ThreadSpec * GetThreadSpecifier()
Definition Target.h:1654
StopHook(const StopHook &rhs)
Definition Target.cpp:4227
bool ExecutionContextPasses(const ExecutionContext &exe_ctx)
Definition Target.cpp:4243
lldb::TargetSP & GetTarget()
Definition Target.h:1633
void SetRunAtInitialStop(bool at_initial_stop)
Definition Target.h:1666
lldb::SymbolContextSpecifierSP m_specifier_sp
Definition Target.h:1684
virtual void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const =0
void GetDescription(Stream &s, lldb::DescriptionLevel level) const
Definition Target.cpp:4259
void SetAutoContinue(bool auto_continue)
Definition Target.h:1660
const ModuleList & GetModuleList() const
Definition Target.h:669
void Dump(Stream *s) const override
Definition Target.cpp:6072
static llvm::StringRef GetFlavorString()
Definition Target.cpp:6068
static lldb::TargetSP GetCreatedTargetFromEvent(const Event *event_ptr)
Definition Target.cpp:6101
static ModuleList GetModuleListFromEvent(const Event *event_ptr)
Definition Target.cpp:6110
static const TargetEventData * GetEventDataFromEvent(const Event *event_ptr)
Definition Target.cpp:6082
llvm::StringRef GetFlavor() const override
Definition Target.h:647
const lldb::TargetSP & GetTarget() const
Definition Target.h:663
TargetEventData(const lldb::TargetSP &target_sp)
Definition Target.cpp:6054
TargetEventData(const TargetEventData &)=delete
const lldb::TargetSP & GetCreatedTarget() const
Definition Target.h:665
const TargetEventData & operator=(const TargetEventData &)=delete
static lldb::TargetSP GetTargetFromEvent(const Event *event_ptr)
Definition Target.cpp:6092
void ModulesDidLoad(ModuleList &module_list)
This call may preload module symbols, and may do so in parallel depending on the following target set...
Definition Target.cpp:1979
lldb::ThreadSP CalculateThread() override
Definition Target.cpp:2733
llvm::Expected< uint32_t > AddScriptedFrameProviderDescriptor(const ScriptedFrameProviderDescriptor &descriptor)
Add or update a scripted frame provider descriptor for this target.
Definition Target.cpp:3925
StopHookCollection m_stop_hooks
Definition Target.h:2193
Module * GetExecutableModulePointer()
Definition Target.cpp:1668
void Dump(Stream *s, lldb::DescriptionLevel description_level)
Dump a description of this object to a Stream.
Definition Target.cpp:265
void DisableAllBreakpoints(bool internal_also=false)
Definition Target.cpp:1196
lldb::ModuleWP m_executable_module_wp
The marked main executable. Weak, so it can't outlive its image.
Definition Target.h:2153
friend class TargetGroupList
Definition Target.h:2097
bool RemoveHookByID(lldb::user_id_t uid)
Definition Target.cpp:4855
lldb::WatchpointSP CreateWatchpoint(lldb::addr_t addr, size_t size, const CompilerType *type, uint32_t kind, Status &error)
Definition Target.cpp:1078
void ApplyNameToBreakpoints(BreakpointName &bp_name)
Definition Target.cpp:955
lldb::user_id_t m_hook_next_id
Definition Target.h:2204
std::recursive_mutex * GetAPIMutexForCurrentPolicy()
The mutex the calling thread must serialize on for its current policy, or nullptr when that policy by...
Definition Target.cpp:6122
lldb::TraceSP GetTrace()
Get the Trace object containing processor trace information of this target.
Definition Target.cpp:3800
PathMappingList & GetImageSearchPathList()
Definition Target.cpp:2742
void FinalizeFileActions(ProcessLaunchInfo &info)
Definition Target.cpp:4007
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:3132
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:3140
ModuleList & GetImages()
Definition Target.h:1285
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:800
static Target * GetTargetFromContexts(const ExecutionContext *exe_ctx_ptr, const SymbolContext *sc_ptr)
Definition Target.cpp:2977
lldb::addr_t GetBreakableLoadAddress(lldb::addr_t addr)
Definition Target.cpp:3147
llvm::StringMap< std::unique_ptr< BreakpointName > > BreakpointNameMap
Definition Target.h:2158
void ClearDummySignals(Args &signal_names)
Clear the dummy signals in signal_names from the target, or all signals if signal_names is empty.
Definition Target.cpp:4167
bool SetSuppresStopHooks(bool suppress)
Definition Target.h:1988
static void ImageSearchPathsChanged(const PathMappingList &path_list, void *baton)
Definition Target.cpp:2746
llvm::Expected< lldb_private::Address > GetEntryPointAddress()
This method will return the address of the starting function for this binary, e.g.
Definition Target.cpp:3098
bool IgnoreWatchpointByID(lldb::watch_id_t watch_id, uint32_t ignore_count)
Definition Target.cpp:1632
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:766
size_t GetNumHooks() const
Definition Target.h:1968
lldb::BreakpointSP GetBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:457
std::shared_ptr< StopHook > StopHookSP
Definition Target.h:1778
llvm::StringRef GetBroadcasterClass() const override
This needs to be filled in if you are going to register the broadcaster with the broadcaster manager ...
Definition Target.h:623
void SymbolsDidLoad(ModuleList &module_list)
Definition Target.cpp:2007
bool ClearAllWatchpointHistoricValues()
Definition Target.cpp:1546
void MarkExecutableModule(const lldb::ModuleSP &module_sp)
Make module_sp the main executable without clearing the other images, unlike RebuildModuleListWithExe...
Definition Target.cpp:1672
const std::vector< StopHookSP > GetStopHooks(bool internal=false) const
Definition Target.cpp:3263
void RemoveTargetGroup(const TargetGroup *group)
Called only by TargetGroup::RemoveTarget to remove group membership.
Definition Target.cpp:428
void SetTrace(const lldb::TraceSP &trace_sp)
Set the Trace object containing processor trace information of this target.
Definition Target.cpp:3798
BreakpointList & GetBreakpointList(bool internal=false)
Definition Target.cpp:443
uint32_t m_next_frame_provider_id
Definition Target.h:2185
lldb_private::SummaryStatisticsCache & GetSummaryStatisticsCache()
Definition Target.cpp:3615
const llvm::MapVector< uint32_t, ScriptedFrameProviderDescriptor > & GetScriptedFrameProviderDescriptors() const
Get all scripted frame provider descriptors for this target.
Definition Target.cpp:3986
lldb::addr_t GetSectionLoadAddress(const lldb::SectionSP &section_sp)
Definition Target.cpp:6139
llvm::StringRef GetABIName() const
Returns the name of the target's ABI plugin.
Definition Target.cpp:432
SourceManager & GetSourceManager()
Definition Target.cpp:3187
lldb::SearchFilterSP GetSearchFilterForModuleList(const FileSpecList *containingModuleList)
Definition Target.cpp:729
StopHookSP GetStopHookByID(lldb::user_id_t uid)
Definition Target.cpp:3229
llvm::StringMap< DummySignalValues > m_dummy_signals
These are used to set the signal state when you don't have a process and more usefully in the Dummy t...
Definition Target.h:2220
lldb::user_id_t AddBreakpointResolverOverride(BreakpointResolverOverrideUP override_up)
Add a breakpoint override resolver. This version can't fail.
Definition Target.h:1081
lldb::ProcessSP m_process_sp
Definition Target.h:2173
Debugger & GetDebugger() const
Definition Target.h:1366
lldb::SearchFilterSP m_search_filter_sp
Definition Target.h:2174
PersistentExpressionState * GetPersistentExpressionStateForLanguage(lldb::LanguageType language)
Definition Target.cpp:2827
void UpdateSignalsFromDummy(lldb::UnixSignalsSP signals_sp, lldb::StreamSP warning_stream_sp)
Updates the signals in signals_sp using the stored dummy signals.
Definition Target.cpp:4155
bool m_is_dummy_target
Used to not run stop hooks for expressions.
Definition Target.h:2200
static bool UpdateSignalFromDummy(lldb::UnixSignalsSP signals_sp, const DummySignalElement &element)
Definition Target.cpp:4113
PathMappingList m_image_search_paths
Definition Target.h:2175
bool ModuleIsExcludedForUnconstrainedSearches(const FileSpec &module_spec)
Return whether this FileSpec corresponds to a module that should be considered for general searches.
Definition Target.cpp:2065
lldb::StackFrameSP CalculateStackFrame() override
Definition Target.cpp:2735
SectionLoadList & GetSectionLoadList()
Definition Target.h:2280
lldb::addr_t GetPersistentSymbol(ConstString name)
Definition Target.cpp:3078
TargetAPIMutex GetAPIMutex()
Returns a handle resolved to the mutex to serialize on before touching the target through the SB API.
Definition Target.cpp:6118
void PrimeFromDummyTarget(Target &target)
Definition Target.cpp:228
bool RemoveScriptedFrameProviderDescriptor(uint32_t id)
Remove a scripted frame provider descriptor by id.
Definition Target.cpp:3961
lldb::RegisterTypeBuilderSP m_register_type_builder_sp
Definition Target.h:2225
friend class TargetGroup
Definition Target.h:2096
static void SettingsTerminate()
Definition Target.cpp:2939
bool EnableWatchpointByID(lldb::watch_id_t watch_id)
Definition Target.cpp:1597
void DeleteBreakpointName(llvm::StringRef name)
Definition Target.cpp:932
HookSP CreateHook(Hook::HookKind kind)
Definition Target.cpp:4833
bool ResolveFileAddress(lldb::addr_t load_addr, Address &so_addr)
Definition Target.cpp:3531
bool ClearAllWatchpointHitCounts()
Definition Target.cpp:1532
CompilerType GetRegisterType(const RegisterInfo &reg_info)
Definition Target.cpp:2782
size_t ReadMemoryFromFileCache(const Address &addr, void *dst, size_t dst_len, Status &error)
Definition Target.cpp:2097
void ClearAllLoadedSections()
Definition Target.cpp:3607
std::vector< lldb::TypeSystemSP > GetScratchTypeSystems(bool create_on_demand=true)
Definition Target.cpp:2790
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:2405
void AddNameToBreakpoint(BreakpointID &id, llvm::StringRef name, Status &error)
Definition Target.cpp:877
void DumpSectionLoadList(Stream &s)
Definition Target.cpp:6145
void DeleteCurrentProcess()
Definition Target.cpp:301
BreakpointList m_internal_breakpoint_list
Definition Target.h:2157
int64_t ReadSignedIntegerFromMemory(const Address &addr, size_t integer_byte_size, int64_t fail_value, Status &error, bool force_live_memory=false)
Definition Target.cpp:2436
friend class TargetAPIMutex
Definition Target.h:606
void DisableAllowedBreakpoints()
Definition Target.cpp:1206
bool SetHookEnabledStateByID(lldb::user_id_t uid, bool enabled)
Definition Target.cpp:4877
bool LoadScriptingResources(std::list< Status > &errors, bool continue_on_error=true)
Definition Target.h:1260
bool SetSectionUnloaded(const lldb::SectionSP &section_sp)
Definition Target.cpp:3585
lldb::TargetSP CalculateTarget() override
Definition Target.cpp:2729
const lldb::ProcessSP & GetProcessSP() const
Definition Target.cpp:335
void ClearModules(bool delete_locations)
Definition Target.cpp:1677
void RemoveNameFromBreakpoint(lldb::BreakpointSP &bp_sp, llvm::StringRef name)
Definition Target.cpp:942
BreakpointNameMap m_breakpoint_names
Definition Target.h:2159
bool RemoveBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:1230
llvm::MapVector< uint32_t, ScriptedFrameProviderDescriptor > m_frame_provider_descriptors
Map of scripted frame provider descriptors for this target.
Definition Target.h:2183
static bool ResetSignalFromDummy(lldb::UnixSignalsSP signals_sp, const DummySignalElement &element)
Definition Target.cpp:4140
Architecture * GetArchitecturePlugin() const
Definition Target.h:1364
lldb::ModuleSP GetOrCreateModule(const ModuleSpec &module_spec, bool notify, Status *error_ptr=nullptr, bool invoke_symbol_locators=true)
Find a binary on the system and return its Module, or return an existing Module that is already in th...
Definition Target.cpp:2488
llvm::json::Value ReportStatistics(const lldb_private::StatisticsOptions &options)
Get metrics associated with this target in JSON format.
Definition Target.cpp:6131
friend class TargetList
Definition Target.h:604
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:2880
TargetStats & GetStatistics()
Definition Target.h:2250
void EnableAllBreakpoints(bool internal_also=false)
Definition Target.cpp:1213
Status Launch(ProcessLaunchInfo &launch_info, Stream *stream)
Definition Target.cpp:3630
bool DisableBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:1250
lldb::BreakpointSP CreateBreakpointAtUserEntry(Status &error)
Definition Target.cpp:469
std::map< lldb::user_id_t, StopHookSP > StopHookCollection
Definition Target.h:2192
llvm::Expected< lldb::TraceSP > CreateTrace()
Create a Trace object for the current target using the using the default supported tracing technology...
Definition Target.cpp:3802
lldb::TraceSP m_trace_sp
An optional lldb_private::Trace object containing processor trace information of this target.
Definition Target.h:2214
lldb::user_id_t GetGloballyUniqueID() const
Get the globally unique ID for this target.
Definition Target.h:705
bool RemoveAllWatchpoints(bool end_to_end=true)
Definition Target.cpp:1450
bool ReadPointerFromMemory(const Address &addr, Status &error, Address &pointer_addr, bool force_live_memory=false)
Definition Target.cpp:2458
TargetGroupList m_target_groups
Every target group this target belongs to.
Definition Target.h:2223
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:3215
WatchpointList m_watchpoint_list
Definition Target.h:2168
BreakpointList m_breakpoint_list
Definition Target.h:2156
void DescribeBreakpointOverrides(Stream &stream, std::vector< lldb::user_id_t > &idxs, uint32_t terminal_width, bool use_color)
Describe the breakpoint overrides.
Definition Target.cpp:1009
lldb::SourceManagerUP m_source_manager_up
Definition Target.h:2190
lldb::user_id_t m_override_id
This is the ID that will be handed out for the next added breakpoint override resolver for this targe...
Definition Target.h:2165
bool RemoveWatchpointByID(lldb::watch_id_t watch_id)
Definition Target.cpp:1616
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, uint32_t stop_id=SectionLoadHistory::eStopIDNow, bool allow_section_end=false)
Definition Target.cpp:3525
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:2356
HookSP GetHookByID(lldb::user_id_t uid)
Definition Target.cpp:4862
void NotifyWillClearList(const ModuleList &module_list) override
Definition Target.cpp:1941
bool SetArchitecture(const ArchSpec &arch_spec, bool set_platform=false, bool merge=true)
Set the architecture for this target.
Definition Target.cpp:1825
void ClearBreakpointResolverOverrides()
Definition Target.h:1099
bool RemoveBreakpointResolverOverride(lldb::user_id_t override_id)
Definition Target.h:1094
void NotifyModuleAdded(const ModuleList &module_list, const lldb::ModuleSP &module_sp) override
Implementing of ModuleList::Notifier.
Definition Target.cpp:1943
llvm::Expected< lldb::TypeSystemSP > GetScratchTypeSystemForLanguage(lldb::LanguageType language, bool create_on_demand=true)
Definition Target.cpp:2755
void ConfigureBreakpointName(BreakpointName &bp_name, const BreakpointOptions &options, const BreakpointName::Permissions &permissions)
Definition Target.cpp:947
lldb_private::SummaryStatisticsSP GetSummaryStatisticsSPForProviderName(lldb_private::TypeSummaryImpl &summary_provider)
Definition Target.cpp:3609
lldb::SearchFilterSP GetSearchFilterForModuleAndCUList(const FileSpecList *containingModules, const FileSpecList *containingSourceFiles)
Definition Target.cpp:746
lldb::ModuleSP GetExecutableModule()
Gets the module for the main executable.
Definition Target.cpp:1648
bool SetStopHookActiveStateByID(lldb::user_id_t uid, bool active_state)
Definition Target.cpp:3239
const lldb::ProcessSP & CreateProcess(lldb::ListenerSP listener_sp, llvm::StringRef plugin_name, const FileSpec *crash_file, bool can_connect)
Definition Target.cpp:323
void SetAllStopHooksActiveState(bool active_state)
Definition Target.cpp:3250
std::vector< StopHookSP > m_internal_stop_hooks
Definition Target.h:2195
lldb::ExpressionVariableSP GetPersistentVariable(ConstString name)
Definition Target.cpp:3059
void NotifyModulesRemoved(lldb_private::ModuleList &module_list) override
Definition Target.cpp:1975
StopHookSP CreateStopHook(StopHook::StopHookKind kind, bool internal=false)
Add an empty stop hook to the Target's stop hook list, and returns a shared pointer to the new hook.
Definition Target.cpp:3193
size_t ReadCStringFromMemory(const Address &addr, std::string &out_str, Status &error, bool force_live_memory=false)
Definition Target.cpp:2266
void SetAllHooksEnabledState(bool enabled)
Definition Target.cpp:4885
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:2140
std::recursive_mutex m_frame_provider_descriptors_mutex
Definition Target.h:2184
lldb::user_id_t m_target_unique_id
The globally unique ID assigned to this target.
Definition Target.h:2206
void ModulesDidUnload(ModuleList &module_list, bool delete_locations)
Definition Target.cpp:2023
void CalculateExecutionContext(ExecutionContext &exe_ctx) override
Reconstruct the object's execution context into sc.
Definition Target.cpp:2737
llvm::Expected< lldb::DisassemblerSP > ReadInstructions(const Address &start_addr, uint32_t count, const char *flavor_string=nullptr)
Definition Target.cpp:3153
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:3827
void NotifyModuleUpdated(const ModuleList &module_list, const lldb::ModuleSP &old_module_sp, const lldb::ModuleSP &new_module_sp) override
Definition Target.cpp:1963
void AddTargetGroup(const lldb::TargetGroupSP &group_sp)
Called only by TargetGroup::AddTarget to record group membership.
Definition Target.cpp:424
SummaryStatisticsCache m_summary_statistics_cache
Definition Target.h:2154
Target(const Target &)=delete
void RegisterInternalStopHooks()
Status SerializeBreakpointsToFile(const FileSpec &file, const BreakpointIDList &bp_ids, bool append)
Definition Target.cpp:1291
void DidExec()
Called as the last function in Process::DidExec().
Definition Target.cpp:1685
void SaveScriptedLaunchInfo(lldb_private::ProcessInfo &process_info)
Definition Target.cpp:3619
bool GetSuppressStopHooks()
Definition Target.h:1994
std::string m_label
Definition Target.h:2149
lldb::user_id_t m_stop_hook_next_id
Definition Target.h:2194
static FileSpecList GetDefaultExecutableSearchPaths()
Definition Target.cpp:2941
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:783
void NotifyBreakpointChanged(Breakpoint &bp, lldb::BreakpointEventType event_kind)
Sends a breakpoint notification event.
Definition Target.cpp:6149
lldb::SearchFilterSP GetSearchFilterForModule(const FileSpec *containingModule)
Definition Target.cpp:711
llvm::StringMapEntry< DummySignalValues > DummySignalElement
Definition Target.h:2056
static llvm::StringRef GetStaticBroadcasterClass()
Definition Target.cpp:177
static FileSpecList GetDefaultDebugFileSearchPaths()
Definition Target.cpp:2945
void EnableAllowedBreakpoints()
Definition Target.cpp:1223
virtual 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, bool *did_read_live_memory=nullptr)
Definition Target.cpp:2130
llvm::Error SetLabel(llvm::StringRef label)
Set a label for a target.
Definition Target.cpp:2960
uint32_t m_latest_stop_hook_id
Definition Target.h:2196
void RunModuleHooks(bool is_load)
Definition Target.cpp:4890
std::map< lldb::user_id_t, BreakpointResolverOverrideUP > m_breakpoint_overrides
Definition Target.h:2162
StackFrameRecognizerManager & GetFrameRecognizerManager()
Definition Target.h:2032
void RemoveAllowedBreakpoints()
Definition Target.cpp:1175
bool DisableAllWatchpoints(bool end_to_end=true)
Definition Target.cpp:1479
bool RunStopHooks(bool at_initial_stop=false)
Definition Target.cpp:3274
void ClearSectionLoadList()
Definition Target.cpp:6143
const Target & operator=(const Target &)=delete
lldb::addr_t GetReasonableReadSize(const Address &addr)
Return a recommended size for memory reads at addr, optimizing for cache usage.
Definition Target.cpp:2343
lldb::PlatformSP m_platform_sp
The platform for this target.
Definition Target.h:2139
void UndoCreateHook(lldb::user_id_t uid)
Removes the most recently created hook.
Definition Target.cpp:4848
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:2910
FileSpecList GetSafeAutoLoadPaths() const
Get the list of paths that LLDB will consider automatically loading scripting resources from.
Definition Target.cpp:6165
static TargetProperties & GetGlobalProperties()
Definition Target.cpp:3489
Status Install(ProcessLaunchInfo *launch_info)
Definition Target.cpp:3497
HookSP GetHookAtIndex(size_t index)
Definition Target.cpp:4869
lldb::PlatformSP GetPlatform()
Definition Target.h:2008
void NotifyModuleRemoved(const ModuleList &module_list, const lldb::ModuleSP &module_sp) override
Definition Target.cpp:1953
lldb::BreakpointSP CreateAddressInModuleBreakpoint(lldb::addr_t file_addr, bool internal, const FileSpec &file_spec, bool request_hardware)
Definition Target.cpp:617
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:528
void RemoveAllBreakpoints(bool internal_also=false)
Definition Target.cpp:1184
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:511
lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules, const FileSpecList *containingSourceFiles, const char *func_name, lldb::FunctionNameType func_name_type_mask, lldb::LanguageType language, lldb::addr_t offset, bool offset_is_insn_count, LazyBool skip_prologue, bool internal, bool request_hardware)
static ArchSpec GetDefaultArchitecture()
Definition Target.cpp:2949
void ResetBreakpointHitCounts()
Resets the hit count of all breakpoints.
Definition Target.cpp:1287
std::unique_ptr< BreakpointResolverOverride > BreakpointResolverOverrideUP
Definition Target.h:1052
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition Target.h:1283
const ArchSpec & GetArchitecture() const
Definition Target.h:1325
WatchpointList & GetWatchpointList()
Definition Target.h:988
@ eBroadcastBitWatchpointChanged
Definition Target.h:613
@ eBroadcastBitBreakpointChanged
Definition Target.h:610
@ eBroadcastBitNewTargetCreated
Definition Target.h:616
unsigned m_next_persistent_variable_index
Definition Target.h:2205
bool EnableBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:1268
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:2447
void InvalidateThreadFrameProviders()
Invalidate all potentially cached frame providers for all threads and trigger a stack changed event f...
Definition Target.cpp:3992
TargetStats m_stats
Definition Target.h:2233
bool IgnoreAllWatchpoints(uint32_t ignore_count)
Definition Target.cpp:1561
void AddBreakpoint(lldb::BreakpointSP breakpoint_sp, bool internal)
Definition Target.cpp:854
std::string m_target_session_name
The target session name for this target, used to name debugging sessions in DAP.
Definition Target.h:2209
TypeSystemMap m_scratch_type_system_map
Definition Target.h:2176
void AddBreakpointName(std::unique_ptr< BreakpointName > bp_name)
Definition Target.cpp:904
void SetTargetSessionName(llvm::StringRef target_session_name)
Set the target session name for this target.
Definition Target.h:738
SectionLoadHistory m_section_load_history
Definition Target.h:2155
lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules, const FileSpecList *containingSourceFiles, const std::vector< std::string > &func_names, lldb::FunctionNameType func_name_type_mask, lldb::LanguageType language, lldb::addr_t m_offset, LazyBool skip_prologue, bool internal, bool request_hardware)
lldb::BreakpointResolverSP CheckBreakpointOverrides(lldb::BreakpointResolverSP original_sp)
Definition Target.cpp:1047
std::shared_ptr< GroupT > GetFirstTargetGroupOfType() const
Return the first target group that can be cast to GroupT.
Definition Target.h:2085
void GetBreakpointNames(std::vector< std::string > &names)
Definition Target.cpp:969
bool IsDummyTarget() const
Definition Target.h:694
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:182
size_t UnloadModuleSections(const lldb::ModuleSP &module_sp)
Definition Target.cpp:3566
llvm::StringRef GetTargetSessionName()
Get the target session name for this target.
Definition Target.h:726
const std::string & GetLabel() const
Definition Target.h:707
std::map< lldb::user_id_t, HookSP > HookCollection
Definition Target.h:2202
bool m_valid
This records the last natural stop at which we ran a stop-hook.
Definition Target.h:2198
bool DisableWatchpointByID(lldb::watch_id_t watch_id)
Definition Target.cpp:1578
void AddDummySignal(llvm::StringRef name, LazyBool pass, LazyBool print, LazyBool stop)
Add a signal to the Target's list of stored signals/actions.
Definition Target.cpp:4098
void ClearScriptedFrameProviderDescriptors()
Clear all scripted frame provider descriptors for this target.
Definition Target.cpp:3974
void RebuildModuleListWithExecutable(lldb::ModuleSP &module_sp, LoadDependentFiles load_dependent_files=eLoadDependentsDefault)
Clear the module list and rebuild it around a new main executable.
Definition Target.cpp:1691
lldb::WatchpointSP m_last_created_watchpoint
Definition Target.h:2169
Status CreateBreakpointsFromFile(const FileSpec &file, BreakpointIDList &new_bps)
Definition Target.cpp:1383
Debugger & m_debugger
Definition Target.h:2138
void SetREPL(lldb::LanguageType language, lldb::REPLSP repl_sp)
Definition Target.cpp:388
lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules, const FileSpecList *containingSourceFiles, const char *func_names[], size_t num_names, lldb::FunctionNameType func_name_type_mask, lldb::LanguageType language, lldb::addr_t offset, LazyBool skip_prologue, bool internal, bool request_hardware)
lldb::StackFrameRecognizerManagerUP m_frame_recognizer_manager_up
Stores the frame recognizers of this target.
Definition Target.h:2216
HookCollection m_hooks
Definition Target.h:2203
lldb::REPLSP GetREPL(Status &err, lldb::LanguageType language, const char *repl_options, bool can_create)
Definition Target.cpp:337
std::shared_ptr< Hook > HookSP
Definition Target.h:1949
UserExpression * GetUserExpressionForLanguage(llvm::StringRef expr, llvm::StringRef prefix, SourceLanguage language, Expression::ResultType desired_type, const EvaluateExpressionOptions &options, ValueObject *ctx_obj, Status &error)
Definition Target.cpp:2847
ModuleList m_images
The list of images for this process (shared libraries and anything dynamically loaded).
Definition Target.h:2150
lldb::ProcessSP CalculateProcess() override
Definition Target.cpp:2731
void PrintDummySignals(Stream &strm, Args &signals)
Print all the signals set in this target.
Definition Target.cpp:4192
std::vector< lldb::TargetGroupSP > GetTargetGroups() const
Return the target groups this target belongs to.
Definition Target.cpp:420
void SetPlatform(const lldb::PlatformSP &platform_sp)
Definition Target.h:2010
bool SetSectionLoadAddress(const lldb::SectionSP &section, lldb::addr_t load_addr, bool warn_multiple=false)
Definition Target.cpp:3536
BreakpointName * FindBreakpointName(llvm::StringRef name, bool can_create, Status &error)
Definition Target.cpp:909
Status Attach(ProcessAttachInfo &attach_info, Stream *stream)
Definition Target.cpp:3833
std::map< lldb::LanguageType, lldb::REPLSP > REPLMap
Definition Target.h:2187
static void SetDefaultArchitecture(const ArchSpec &arch)
Definition Target.cpp:2953
lldb::BreakpointSP m_last_created_breakpoint
Definition Target.h:2167
lldb::WatchpointSP GetLastCreatedWatchpoint()
Definition Target.h:984
bool RemoveStopHookByID(lldb::user_id_t uid)
Definition Target.cpp:3222
friend class Debugger
Definition Target.h:605
lldb::BreakpointSP GetLastCreatedBreakpoint()
Definition Target.h:876
static void SettingsInitialize()
Definition Target.cpp:2937
~Target() override
Definition Target.cpp:222
bool EnableAllWatchpoints(bool end_to_end=true)
Definition Target.cpp:1506
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:2147
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:2991
bool MergeArchitecture(const ArchSpec &arch_spec)
Definition Target.cpp:1916
Encapsulates a one-time expression for use in lldb.
This class is used by Watchpoint to manage a list of watchpoints,.
#define LLDB_INVALID_GLOBALLY_UNIQUE_TARGET_ID
A class that represents a running process on the host machine.
std::shared_ptr< SummaryStatistics > SummaryStatisticsSP
Definition Statistics.h:33
LoadScriptFromSymFile
Definition Target.h:64
@ eLoadScriptFromSymFileTrue
Definition Target.h:65
@ eLoadScriptFromSymFileTrusted
Definition Target.h:68
@ eLoadScriptFromSymFileFalse
Definition Target.h:66
@ eLoadScriptFromSymFileWarn
Definition Target.h:67
@ eJITEngineMCJIT
Definition Target.h:90
@ eJITEngineORC
Definition Target.h:90
ExecutionPolicy
Expression execution policies.
DynamicClassInfoHelper
Definition Target.h:83
@ eDynamicClassInfoHelperCopyRealizedClassList
Definition Target.h:86
@ eDynamicClassInfoHelperGetRealizedClassList
Definition Target.h:87
@ eDynamicClassInfoHelperAuto
Definition Target.h:84
@ eDynamicClassInfoHelperRealizedClassesStruct
Definition Target.h:85
OptionEnumValues GetDynamicValueTypes()
Definition Target.cpp:4938
@ eImportStdModuleFalse
Definition Target.h:78
@ eImportStdModuleFallback
Definition Target.h:79
@ eImportStdModuleTrue
Definition Target.h:80
LoadCWDlldbinitFile
Definition Target.h:71
@ eLoadCWDlldbinitTrue
Definition Target.h:72
@ eLoadCWDlldbinitFalse
Definition Target.h:73
@ eLoadCWDlldbinitWarn
Definition Target.h:74
llvm::ArrayRef< OptionEnumValueElement > OptionEnumValues
@ eInlineBreakpointsNever
Definition Target.h:59
@ eInlineBreakpointsAlways
Definition Target.h:61
@ eInlineBreakpointsHeaders
Definition Target.h:60
BreakpointConditionMode
Modes for evaluating breakpoint conditions.
ExpressionEvaluationPhase
Expression Evaluation Stages.
std::shared_ptr< lldb_private::Trace > TraceSP
std::shared_ptr< lldb_private::ScriptedHookInterface > ScriptedHookInterfaceSP
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::SearchFilter > SearchFilterSP
std::shared_ptr< lldb_private::BreakpointResolver > BreakpointResolverSP
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
std::unique_ptr< lldb_private::StackFrameRecognizerManager > StackFrameRecognizerManagerUP
std::weak_ptr< lldb_private::Module > ModuleWP
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::TargetGroup > TargetGroupSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::ExpressionVariable > ExpressionVariableSP
std::shared_ptr< lldb_private::UnixSignals > UnixSignalsSP
std::shared_ptr< lldb_private::Platform > PlatformSP
std::shared_ptr< lldb_private::RegisterTypeBuilder > RegisterTypeBuilderSP
LanguageType
Programming language type.
std::shared_ptr< lldb_private::Stream > StreamSP
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
ExpressionResults
The results of expression evaluation.
int32_t break_id_t
Definition lldb-types.h:88
std::unique_ptr< lldb_private::SourceManager > SourceManagerUP
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::SymbolContextSpecifier > SymbolContextSpecifierSP
std::shared_ptr< lldb_private::Watchpoint > WatchpointSP
std::shared_ptr< lldb_private::Listener > ListenerSP
int32_t watch_id_t
Definition lldb-types.h:89
uint64_t user_id_t
Definition lldb-types.h:83
std::shared_ptr< lldb_private::Section > SectionSP
uint64_t addr_t
Definition lldb-types.h:80
std::shared_ptr< lldb_private::Target > TargetSP
@ eDynamicCanRunTarget
bool(* ExpressionCancelCallback)(lldb::ExpressionEvaluationPhase phase, void *baton)
Definition lldb-types.h:75
std::shared_ptr< lldb_private::Module > ModuleSP
std::shared_ptr< lldb_private::EventData > EventDataSP
std::shared_ptr< lldb_private::REPL > REPLSP
Every register is described in detail including its name, alternate name (optional),...
This struct contains the metadata needed to instantiate a frame provider and optional filters to cont...
A type-erased pair of llvm::dwarf::SourceLanguageName and version.
DummySignalValues(LazyBool pass, LazyBool notify, LazyBool stop)
Definition Target.h:2052
UserID(lldb::user_id_t uid=LLDB_INVALID_UID)
Construct with optional user ID.
Definition UserID.h:33