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 <vector>
18
22#include "lldb/Core/Address.h"
44#include "lldb/Utility/Stream.h"
47#include "lldb/lldb-public.h"
48#include "llvm/ADT/MapVector.h"
49#include "llvm/ADT/StringRef.h"
50
51namespace lldb_private {
52
54
60
67
73
79
86
88
93
95public:
96 TargetProperties(Target *target);
97
99
101
102 void SetDefaultArchitecture(const ArchSpec &arch);
103
104 bool GetMoveToNearestCode() const;
105
107
109
110 bool GetPreloadSymbols() const;
111
112 void SetPreloadSymbols(bool b);
113
114 bool GetDisableASLR() const;
115
116 void SetDisableASLR(bool b);
117
118 bool GetInheritTCC() const;
119
120 void SetInheritTCC(bool b);
121
122 bool GetDetachOnError() const;
123
124 void SetDetachOnError(bool b);
125
126 bool GetDisableSTDIO() const;
127
128 void SetDisableSTDIO(bool b);
129
130 llvm::StringRef GetLaunchWorkingDirectory() const;
131
132 bool GetParallelModuleLoad() const;
133
134 const char *GetDisassemblyFlavor() const;
135
136 const char *GetDisassemblyCPU() const;
137
138 const char *GetDisassemblyFeatures() const;
139
141
143
144 llvm::StringRef GetArg0() const;
145
146 void SetArg0(llvm::StringRef arg);
147
148 bool GetRunArguments(Args &args) const;
149
150 void SetRunArguments(const Args &args);
151
152 // Get the whole environment including the platform inherited environment and
153 // the target specific environment, excluding the unset environment variables.
155 // Get the platform inherited environment, excluding the unset environment
156 // variables.
158 // Get the target specific environment only, without the platform inherited
159 // environment.
161 // Set the target specific environment.
162 void SetEnvironment(Environment env);
163
164 bool GetSkipPrologue() const;
165
167
169
170 bool GetAutoSourceMapRelative() const;
171
173
175
177
179
181
183
185
186 bool GetEnableAutoApplyFixIts() const;
187
188 uint64_t GetNumberOfRetriesWithFixits() const;
189
190 bool GetEnableNotifyAboutFixIts() const;
191
193
194 JITEngine GetJITEngine() const;
195
196 bool GetEnableSyntheticValue() const;
197
199
200 uint32_t GetMaxZeroPaddingInFloatFormat() const;
201
203
204 /// Get the max depth value, augmented with a bool to indicate whether the
205 /// depth is the default.
206 ///
207 /// When the user has customized the max depth, the bool will be false.
208 ///
209 /// \returns the max depth, and true if the max depth is the system default,
210 /// otherwise false.
211 std::pair<uint32_t, bool> GetMaximumDepthOfChildrenToDisplay() const;
212
213 uint32_t GetMaximumSizeOfStringSummary() const;
214
215 uint32_t GetMaximumMemReadSize() const;
216
220
221 void SetStandardInputPath(llvm::StringRef path);
222 void SetStandardOutputPath(llvm::StringRef path);
223 void SetStandardErrorPath(llvm::StringRef path);
224
225 void SetStandardInputPath(const char *path) = delete;
226 void SetStandardOutputPath(const char *path) = delete;
227 void SetStandardErrorPath(const char *path) = delete;
228
230
232
233 llvm::StringRef GetExpressionPrefixContents();
234
235 uint64_t GetExprErrorLimit() const;
236
237 uint64_t GetExprAllocAddress() const;
238
239 uint64_t GetExprAllocSize() const;
240
241 uint64_t GetExprAllocAlign() const;
242
243 bool GetUseHexImmediates() const;
244
245 bool GetUseFastStepping() const;
246
248
250
251 /// Set the target-wide target.load-script-from-symbol-file setting.
252 /// See \c SetAutoLoadScriptsForModule for overriding this setting
253 /// per-module.
255
257
259
261
262 bool GetUserSpecifiedTrapHandlerNames(Args &args) const;
263
264 void SetUserSpecifiedTrapHandlerNames(const Args &args);
265
267
269
271
273
275
276 void SetProcessLaunchInfo(const ProcessLaunchInfo &launch_info);
277
278 bool GetInjectLocalVariables(ExecutionContext *exe_ctx) const;
279
280 bool GetUseDIL(ExecutionContext *exe_ctx) const;
281
282 void SetUseDIL(ExecutionContext *exe_ctx, bool b);
283
285
287
288 bool GetAutoInstallMainExecutable() const;
289
291
292 void SetDebugUtilityExpression(bool debug);
293
294 bool GetDebugUtilityExpression() const;
295
296 void SetCheckValueObjectOwnership(bool check);
297
298 bool GetCheckValueObjectOwnership() const;
299
300 std::optional<LoadScriptFromSymFile>
301 GetAutoLoadScriptsForModule(llvm::StringRef module_name) const;
302
303 /// Set the \c LoadScriptFromSymFile for a module called \c module_name
304 /// (excluding file extension). LLDB will prefer this over the target-wide
305 /// target.load-script-from-symbol-file setting
306 /// (see \c SetLoadScriptFromSymbolFile).
307 void SetAutoLoadScriptsForModule(llvm::StringRef module_name,
308 LoadScriptFromSymFile load_style);
309
310private:
311 std::optional<bool>
312 GetExperimentalPropertyValue(size_t prop_idx,
313 ExecutionContext *exe_ctx = nullptr) const;
314
315 // Callbacks for m_launch_info.
326
327 // Settings checker for target.jit-save-objects-dir:
328 void CheckJITObjectsDir();
329
331
332 // Member variables.
334 std::unique_ptr<TargetExperimentalProperties> m_experimental_properties_up;
336};
337
339public:
341
342// MSVC has a bug here that reports C4268: 'const' static/global data
343// initialized with compiler generated default constructor fills the object
344// with zeros. Confirmed that MSVC is *not* zero-initializing, it's just a
345// bogus warning.
346#if defined(_MSC_VER)
347#pragma warning(push)
348#pragma warning(disable : 4268)
349#endif
350 static constexpr std::chrono::milliseconds default_timeout{500};
351#if defined(_MSC_VER)
352#pragma warning(pop)
353#endif
354
357
359
363
365
366 void SetLanguage(lldb::LanguageType language_type) {
367 m_language = SourceLanguage(language_type);
368 }
369
371 m_preferred_lookup_contexts = std::move(contexts);
372 }
373
377
378 /// Set the language using a pair of language code and version as
379 /// defined by the DWARF 6 specification.
380 /// WARNING: These codes may change until DWARF 6 is finalized.
381 void SetLanguage(uint16_t name, uint32_t version) {
382 m_language = SourceLanguage(name, version);
383 }
384
385 bool DoesCoerceToId() const { return m_coerce_to_id; }
386
387 const char *GetPrefix() const {
388 return (m_prefix.empty() ? nullptr : m_prefix.c_str());
389 }
390
391 void SetPrefix(const char *prefix) {
392 if (prefix && prefix[0])
393 m_prefix = prefix;
394 else
395 m_prefix.clear();
396 }
397
398 void SetCoerceToId(bool coerce = true) { m_coerce_to_id = coerce; }
399
400 bool DoesUnwindOnError() const { return m_unwind_on_error; }
401
402 void SetUnwindOnError(bool unwind = false) { m_unwind_on_error = unwind; }
403
405
406 void SetIgnoreBreakpoints(bool ignore = false) {
407 m_ignore_breakpoints = ignore;
408 }
409
410 bool DoesKeepInMemory() const { return m_keep_in_memory; }
411
412 void SetKeepInMemory(bool keep = true) { m_keep_in_memory = keep; }
413
415
416 void
420
421 const Timeout<std::micro> &GetTimeout() const { return m_timeout; }
422
423 void SetTimeout(const Timeout<std::micro> &timeout) { m_timeout = timeout; }
424
428
430 m_one_thread_timeout = timeout;
431 }
432
433 bool GetTryAllThreads() const { return m_try_others; }
434
435 void SetTryAllThreads(bool try_others = true) { m_try_others = try_others; }
436
437 bool GetStopOthers() const { return m_stop_others; }
438
439 void SetStopOthers(bool stop_others = true) { m_stop_others = stop_others; }
440
441 bool GetDebug() const { return m_debug; }
442
443 void SetDebug(bool b) {
444 m_debug = b;
445 if (m_debug)
447 }
448
450
452
453 bool GetColorizeErrors() const { return m_ansi_color_errors; }
454
456
457 bool GetTrapExceptions() const { return m_trap_exceptions; }
458
460
461 bool GetStopOnFork() const { return m_stop_on_fork; }
462
463 void SetStopOnFork(bool b) { m_stop_on_fork = b; }
464
465 bool GetREPLEnabled() const { return m_repl; }
466
467 void SetREPLEnabled(bool b) { m_repl = b; }
468
471 m_cancel_callback = callback;
472 }
473
475 return ((m_cancel_callback != nullptr)
477 : false);
478 }
479
480 // Allows the expression contents to be remapped to point to the specified
481 // file and line using #line directives.
482 void SetPoundLine(const char *path, uint32_t line) const {
483 if (path && path[0]) {
484 m_pound_line_file = path;
485 m_pound_line_line = line;
486 } else {
487 m_pound_line_file.clear();
489 }
490 }
491
492 const char *GetPoundLineFilePath() const {
493 return (m_pound_line_file.empty() ? nullptr : m_pound_line_file.c_str());
494 }
495
496 uint32_t GetPoundLineLine() const { return m_pound_line_line; }
497
499
503
505
507
508 void SetRetriesWithFixIts(uint64_t number_of_retries) {
509 m_retries_with_fixits = number_of_retries;
510 }
511
512 uint64_t GetRetriesWithFixIts() const { return m_retries_with_fixits; }
513
515
517
518 /// Set language-plugin specific option called \c option_name to
519 /// the specified boolean \c value.
520 llvm::Error SetBooleanLanguageOption(llvm::StringRef option_name, bool value);
521
522 /// Get the language-plugin specific boolean option called \c option_name.
523 ///
524 /// If the option doesn't exist or is not a boolean option, returns false.
525 /// Otherwise returns the boolean value of the option.
526 llvm::Expected<bool>
527 GetBooleanLanguageOption(llvm::StringRef option_name) const;
528
529 void SetCppIgnoreContextQualifiers(bool value);
530
532
533private:
535
537
540 std::string m_prefix;
541 bool m_coerce_to_id = false;
542 bool m_unwind_on_error = true;
544 bool m_keep_in_memory = false;
545 bool m_try_others = true;
546 bool m_stop_others = true;
547 bool m_debug = false;
548 bool m_trap_exceptions = true;
549 bool m_stop_on_fork = false;
550 bool m_repl = false;
556 /// True if the executed code should be treated as utility code that is only
557 /// used by LLDB internally.
559
564 void *m_cancel_callback_baton = nullptr;
565 // If m_pound_line_file is not empty and m_pound_line_line is non-zero, use
566 // #line %u "%s" before the expression content to remap where the source
567 // originates
568 mutable std::string m_pound_line_file;
569 mutable uint32_t m_pound_line_line = 0;
570
571 /// Dictionary mapping names of language-plugin specific options
572 /// to values.
574
575 /// During expression evaluation, any SymbolContext in this list will be
576 /// used for symbol/function lookup before any other context (except for
577 /// the module corresponding to the current frame).
579};
580
581// Target
582class Target : public std::enable_shared_from_this<Target>,
583 public TargetProperties,
584 public Broadcaster,
586 public ModuleList::Notifier {
587public:
588 friend class TargetList;
589 friend class Debugger;
590 friend class TargetAPIMutex;
591
592 /// Broadcaster event bits definitions.
593 enum {
601 };
602
603 // These two functions fill out the Broadcaster interface:
604
605 static llvm::StringRef GetStaticBroadcasterClass();
606
607 llvm::StringRef GetBroadcasterClass() const override {
609 }
610
611 // This event data class is for use by the TargetList to broadcast new target
612 // notifications.
613 class TargetEventData : public EventData {
614 public:
615 TargetEventData(const lldb::TargetSP &target_sp);
616
617 TargetEventData(const lldb::TargetSP &target_sp,
618 const ModuleList &module_list);
619
620 // Constructor for eBroadcastBitNewTargetCreated events. For this event
621 // type:
622 // - target_sp is the parent target (the subject/broadcaster of the event)
623 // - created_target_sp is the newly created target
624 TargetEventData(const lldb::TargetSP &target_sp,
625 const lldb::TargetSP &created_target_sp);
626
628
629 static llvm::StringRef GetFlavorString();
630
631 llvm::StringRef GetFlavor() const override {
633 }
634
635 void Dump(Stream *s) const override;
636
637 static const TargetEventData *GetEventDataFromEvent(const Event *event_ptr);
638
639 static lldb::TargetSP GetTargetFromEvent(const Event *event_ptr);
640
641 // For eBroadcastBitNewTargetCreated events, returns the newly created
642 // target. For other event types, returns an invalid target.
643 static lldb::TargetSP GetCreatedTargetFromEvent(const Event *event_ptr);
644
645 static ModuleList GetModuleListFromEvent(const Event *event_ptr);
646
647 const lldb::TargetSP &GetTarget() const { return m_target_sp; }
648
650 return m_created_target_sp;
651 }
652
653 const ModuleList &GetModuleList() const { return m_module_list; }
654
655 private:
659
661 const TargetEventData &operator=(const TargetEventData &) = delete;
662 };
663
664 ~Target() override;
665
666 static void SettingsInitialize();
667
668 static void SettingsTerminate();
669
671
673
675
676 static void SetDefaultArchitecture(const ArchSpec &arch);
677
678 bool IsDummyTarget() const { return m_is_dummy_target; }
679
680 /// Get the globally unique ID for this target.
681 ///
682 /// This ID is unique across all debugger instances and all targets,
683 /// within the same lldb process. The ID is assigned
684 /// during target construction and remains constant for the target's lifetime.
685 /// The first target created (typically the dummy target) gets ID 1.
686 ///
687 /// \return
688 /// The globally unique ID for this target.
690
691 const std::string &GetLabel() const { return m_label; }
692
693 /// Set a label for a target.
694 ///
695 /// The label cannot be used by another target or be only integral.
696 ///
697 /// \return
698 /// The label for this target or an error if the label didn't match the
699 /// requirements.
700 llvm::Error SetLabel(llvm::StringRef label);
701
702 /// Get the target session name for this target.
703 ///
704 /// Provides a meaningful name for IDEs or tools to display for dynamically
705 /// created targets. Defaults to "Session {ID}" based on the globally unique
706 /// ID.
707 ///
708 /// \return
709 /// The target session name for this target.
710 llvm::StringRef GetTargetSessionName() { return m_target_session_name; }
711
712 /// Set the target session name for this target.
713 ///
714 /// This should typically be set along with the event
715 /// eBroadcastBitNewTargetCreated. Useful for scripts or triggers that
716 /// automatically create targets and want to provide meaningful names that
717 /// IDEs or other tools can display to help users identify the origin and
718 /// purpose of each target.
719 ///
720 /// \param[in] target_session_name
721 /// The target session name to set for this target.
722 void SetTargetSessionName(llvm::StringRef target_session_name) {
723 m_target_session_name = target_session_name.str();
724 }
725
726 /// Find a binary on the system and return its Module,
727 /// or return an existing Module that is already in the Target.
728 ///
729 /// Given a ModuleSpec, find a binary satisifying that specification,
730 /// or identify a matching Module already present in the Target,
731 /// and return a shared pointer to it.
732 ///
733 /// Note that this function previously also preloaded the module's symbols
734 /// depending on a setting. This function no longer does any module
735 /// preloading because that can potentially cause deadlocks when called in
736 /// parallel with this function.
737 ///
738 /// \param[in] module_spec
739 /// The criteria that must be matched for the binary being loaded.
740 /// e.g. UUID, architecture, file path.
741 ///
742 /// \param[in] notify
743 /// If notify is true, and the Module is new to this Target,
744 /// Target::ModulesDidLoad will be called. See note in
745 /// Target::ModulesDidLoad about thread-safety with
746 /// Target::GetOrCreateModule.
747 /// If notify is false, it is assumed that the caller is adding
748 /// multiple Modules and will call ModulesDidLoad with the
749 /// full list at the end.
750 /// ModulesDidLoad must be called when a Module/Modules have
751 /// been added to the target, one way or the other.
752 ///
753 /// \param[out] error_ptr
754 /// Optional argument, pointing to a Status object to fill in
755 /// with any results / messages while attempting to find/load
756 /// this binary. Many callers will be internal functions that
757 /// will handle / summarize the failures in a custom way and
758 /// don't use these messages.
759 ///
760 /// \return
761 /// An empty ModuleSP will be returned if no matching file
762 /// was found. If error_ptr was non-nullptr, an error message
763 /// will likely be provided.
764 lldb::ModuleSP GetOrCreateModule(const ModuleSpec &module_spec, bool notify,
765 Status *error_ptr = nullptr);
766
767 // Settings accessors
768
770
771 /// Returns a handle resolved to the mutex to serialize on before
772 /// touching the target through the SB API. The handle isn't locked yet;
773 /// lock()/try_lock() it (typically via std::lock_guard<TargetAPIMutex>/
774 /// std::unique_lock<TargetAPIMutex>) to actually acquire it.
776
778
779 void CleanupProcess();
780
781 /// Dump a description of this object to a Stream.
782 ///
783 /// Dump a description of the contents of this object to the
784 /// supplied stream \a s. The dumped content will be only what has
785 /// been loaded or parsed up to this point at which this function
786 /// is called, so this is a good way to see what has been parsed
787 /// in a target.
788 ///
789 /// \param[in] s
790 /// The stream to which to dump the object description.
791 void Dump(Stream *s, lldb::DescriptionLevel description_level);
792
793 // If listener_sp is null, the listener of the owning Debugger object will be
794 // used.
796 llvm::StringRef plugin_name,
797 const FileSpec *crash_file,
798 bool can_connect);
799
800 const lldb::ProcessSP &GetProcessSP() const;
801
802 bool IsValid() { return m_valid; }
803
804 void Destroy();
805
806 Status Launch(ProcessLaunchInfo &launch_info,
807 Stream *stream); // Optional stream to receive first stop info
808
809 Status Attach(ProcessAttachInfo &attach_info,
810 Stream *stream); // Optional stream to receive first stop info
811
812 /// Add or update a scripted frame provider descriptor for this target.
813 /// All new threads in this target will check if they match any descriptors
814 /// to create their frame providers.
815 ///
816 /// \param[in] descriptor
817 /// The descriptor to add or update.
818 ///
819 /// \return
820 /// The descriptor identifier if the registration succeeded, otherwise an
821 /// llvm::Error.
822 llvm::Expected<uint32_t> AddScriptedFrameProviderDescriptor(
823 const ScriptedFrameProviderDescriptor &descriptor);
824
825 /// Remove a scripted frame provider descriptor by id.
826 ///
827 /// \param[in] id
828 /// The id of the descriptor to remove.
829 ///
830 /// \return
831 /// True if a descriptor was removed, false if no descriptor with that
832 /// id existed.
834
835 /// Clear all scripted frame provider descriptors for this target.
837
838 /// Get all scripted frame provider descriptors for this target.
839 const llvm::MapVector<uint32_t, ScriptedFrameProviderDescriptor> &
841
842protected:
843 /// Invalidate all potentially cached frame providers for all threads
844 /// and trigger a stack changed event for all threads.
846
847public:
848 // This part handles the breakpoints.
849
850 BreakpointList &GetBreakpointList(bool internal = false);
851
852 const BreakpointList &GetBreakpointList(bool internal = false) const;
853
857
859
861
862 // Use this to create a file and line breakpoint to a given module or all
863 // module it is nullptr
864 lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules,
865 const FileSpec &file, uint32_t line_no,
866 uint32_t column, lldb::addr_t offset,
867 LazyBool check_inlines,
868 LazyBool skip_prologue, bool internal,
869 bool request_hardware,
870 LazyBool move_to_nearest_code);
871
872 // Use this to create breakpoint that matches regex against the source lines
873 // in files given in source_file_list: If function_names is non-empty, also
874 // filter by function after the matches are made.
876 const FileSpecList *containingModules,
877 const FileSpecList *source_file_list,
878 const std::unordered_set<std::string> &function_names,
879 RegularExpression source_regex, bool internal, bool request_hardware,
880 LazyBool move_to_nearest_code);
881
882 // Use this to create a breakpoint from a load address
883 lldb::BreakpointSP CreateBreakpoint(lldb::addr_t load_addr, bool internal,
884 bool request_hardware);
885
886 // Use this to create a breakpoint from a file address and a module file spec
888 bool internal,
889 const FileSpec &file_spec,
890 bool request_hardware);
891
892 // Use this to create Address breakpoints:
893 lldb::BreakpointSP CreateBreakpoint(const Address &addr, bool internal,
894 bool request_hardware);
895
896 // Use this to create a function breakpoint by regexp in
897 // containingModule/containingSourceFiles, or all modules if it is nullptr
898 // When "skip_prologue is set to eLazyBoolCalculate, we use the current
899 // target setting, else we use the values passed in
901 const FileSpecList *containingModules,
902 const FileSpecList *containingSourceFiles, RegularExpression func_regexp,
903 lldb::LanguageType requested_language, LazyBool skip_prologue,
904 bool internal, bool request_hardware);
905
906 // Use this to create a function breakpoint by name in containingModule, or
907 // all modules if it is nullptr When "skip_prologue is set to
908 // eLazyBoolCalculate, we use the current target setting, else we use the
909 // values passed in. func_name_type_mask is or'ed values from the
910 // FunctionNameType enum.
912 const FileSpecList *containingModules,
913 const FileSpecList *containingSourceFiles, const char *func_name,
914 lldb::FunctionNameType func_name_type_mask, lldb::LanguageType language,
915 lldb::addr_t offset, bool offset_is_insn_count, LazyBool skip_prologue,
916 bool internal, bool request_hardware);
917
919 CreateExceptionBreakpoint(enum lldb::LanguageType language, bool catch_bp,
920 bool throw_bp, bool internal,
921 Args *additional_args = nullptr,
922 Status *additional_args_error = nullptr);
923
925 const llvm::StringRef class_name, const FileSpecList *containingModules,
926 const FileSpecList *containingSourceFiles, bool internal,
927 bool request_hardware, StructuredData::ObjectSP extra_args_sp,
928 Status *creation_error = nullptr);
929
930 // This is the same as the func_name breakpoint except that you can specify a
931 // vector of names. This is cheaper than a regular expression breakpoint in
932 // the case where you just want to set a breakpoint on a set of names you
933 // already know. func_name_type_mask is or'ed values from the
934 // FunctionNameType enum.
936 const FileSpecList *containingModules,
937 const FileSpecList *containingSourceFiles, const char *func_names[],
938 size_t num_names, lldb::FunctionNameType func_name_type_mask,
939 lldb::LanguageType language, lldb::addr_t offset, LazyBool skip_prologue,
940 bool internal, bool request_hardware);
941
943 CreateBreakpoint(const FileSpecList *containingModules,
944 const FileSpecList *containingSourceFiles,
945 const std::vector<std::string> &func_names,
946 lldb::FunctionNameType func_name_type_mask,
947 lldb::LanguageType language, lldb::addr_t m_offset,
948 LazyBool skip_prologue, bool internal,
949 bool request_hardware);
950
951 // Use this to create a general breakpoint:
953 lldb::BreakpointResolverSP &resolver_sp,
954 bool internal, bool request_hardware,
955 bool resolve_indirect_symbols);
956
957 // Use this to create a watchpoint:
959 const CompilerType *type, uint32_t kind,
960 Status &error);
961
965
967
968 // Manages breakpoint names:
969 void AddNameToBreakpoint(BreakpointID &id, llvm::StringRef name,
970 Status &error);
971
972 void AddNameToBreakpoint(lldb::BreakpointSP &bp_sp, llvm::StringRef name,
973 Status &error);
974
976 llvm::StringRef name);
977
978 BreakpointName *FindBreakpointName(llvm::StringRef name, bool can_create,
979 Status &error);
980
981 void DeleteBreakpointName(llvm::StringRef name);
982
984 const BreakpointOptions &options,
985 const BreakpointName::Permissions &permissions);
987
988 void AddBreakpointName(std::unique_ptr<BreakpointName> bp_name);
989
990 void GetBreakpointNames(std::vector<std::string> &names);
991
992 // This call removes ALL breakpoints regardless of permission.
993 void RemoveAllBreakpoints(bool internal_also = false);
994
995 // This removes all the breakpoints, but obeys the ePermDelete on them.
997
998 void DisableAllBreakpoints(bool internal_also = false);
999
1001
1002 void EnableAllBreakpoints(bool internal_also = false);
1003
1005
1007
1009
1011
1012 /// Resets the hit count of all breakpoints.
1014
1015 // This callout implements the "Resolver Override". When we have determined
1016 // the Resolver for a given breakpoint, we pass each of the registered
1017 // overrides the "natural" resolver, and then we will use whatever resolver
1018 // we get back from it if it is non-null.
1019 // We keep a list of overrides ordered by ID - and we search through the list
1020 // by ID order, and the first override that returns a non-null Resolver will
1021 // be the one we use. If no overrides return an override resolver, we'll use
1022 // the original one.
1023
1024 /// This is the abstract version of the override. Particular implementations,
1025 /// e.g. the scripted override resolver, instantiate actual versions of the
1026 /// class. The constructor takes the target this resolver is registered in, a
1027 /// description for the override and a mask of the resolver types this
1028 /// overrides, made of elements of the BreakpointResolverType enum.
1029 class BreakpointResolverOverride;
1031 std::unique_ptr<BreakpointResolverOverride>;
1032
1034 public:
1035 BreakpointResolverOverride(Target &target, const std::string &description,
1036 uint64_t type_mask)
1037 : m_target(target), m_desc(description), m_type_mask(type_mask) {}
1038
1040
1044 // Return whether constructing this resolver was successful.
1045 virtual llvm::Error Validate() = 0;
1046 const std::string &GetDescription() { return m_desc; }
1047 uint64_t GetTypeMask() { return m_type_mask; }
1048 std::string DescribeTypeMask();
1049
1050 protected:
1052 std::string m_desc;
1053 uint64_t m_type_mask = 0;
1054 };
1055
1056 /// Add a breakpoint override resolver. This version can't fail.
1060 m_breakpoint_overrides.emplace(m_override_id, std::move(override_up));
1061 m_override_id++;
1062 return id_used;
1063 }
1064
1065 /// Add a breakpoint override resolver. Return the ID or an error:
1066 llvm::Expected<lldb::user_id_t>
1067 AddBreakpointResolverOverride(llvm::StringRef class_name, uint64_t type_mask,
1068 StructuredData::DictionarySP args_data_sp,
1069 llvm::StringRef description);
1070
1072 size_t removed = m_breakpoint_overrides.erase(override_id);
1073 return removed == 1;
1074 }
1075
1077
1080
1081 /// Describe the breakpoint overrides. If ixds is empty, list all. Otherwise
1082 /// list the overrides whose ids match the ones given in idxs. The matched
1083 /// elements are removed from the list, so any elements remaining in idxs are
1084 /// indexes that are not breakpoint override indexes.
1086 std::vector<lldb::user_id_t> &idxs,
1087 uint32_t terminal_width, bool use_color);
1088
1089 // The flag 'end_to_end', default to true, signifies that the operation is
1090 // performed end to end, for both the debugger and the debuggee.
1091
1092 bool RemoveAllWatchpoints(bool end_to_end = true);
1093
1094 bool DisableAllWatchpoints(bool end_to_end = true);
1095
1096 bool EnableAllWatchpoints(bool end_to_end = true);
1097
1099
1101
1102 bool IgnoreAllWatchpoints(uint32_t ignore_count);
1103
1105
1107
1109
1110 bool IgnoreWatchpointByID(lldb::watch_id_t watch_id, uint32_t ignore_count);
1111
1113 const BreakpointIDList &bp_ids,
1114 bool append);
1115
1117 BreakpointIDList &new_bps);
1118
1120 std::vector<std::string> &names,
1121 BreakpointIDList &new_bps);
1122
1123 /// Get \a load_addr as a callable code load address for this target
1124 ///
1125 /// Take \a load_addr and potentially add any address bits that are
1126 /// needed to make the address callable. For ARM this can set bit
1127 /// zero (if it already isn't) if \a load_addr is a thumb function.
1128 /// If \a addr_class is set to AddressClass::eInvalid, then the address
1129 /// adjustment will always happen. If it is set to an address class
1130 /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
1131 /// returned.
1133 lldb::addr_t load_addr,
1134 AddressClass addr_class = AddressClass::eInvalid) const;
1135
1136 /// Get \a load_addr as an opcode for this target.
1137 ///
1138 /// Take \a load_addr and potentially strip any address bits that are
1139 /// needed to make the address point to an opcode. For ARM this can
1140 /// clear bit zero (if it already isn't) if \a load_addr is a
1141 /// thumb function and load_addr is in code.
1142 /// If \a addr_class is set to AddressClass::eInvalid, then the address
1143 /// adjustment will always happen. If it is set to an address class
1144 /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
1145 /// returned.
1148 AddressClass addr_class = AddressClass::eInvalid) const;
1149
1150 // Get load_addr as breakable load address for this target. Take a addr and
1151 // check if for any reason there is a better address than this to put a
1152 // breakpoint on. If there is then return that address. For MIPS, if
1153 // instruction at addr is a delay slot instruction then this method will find
1154 // the address of its previous instruction and return that address.
1156
1157 /// This call may preload module symbols, and may do so in parallel depending
1158 /// on the following target settings:
1159 /// - TargetProperties::GetPreloadSymbols()
1160 /// - TargetProperties::GetParallelModuleLoad()
1161 ///
1162 /// Warning: if preloading is active and this is called in parallel with
1163 /// Target::GetOrCreateModule, this may result in a ABBA deadlock situation.
1164 void ModulesDidLoad(ModuleList &module_list);
1165
1166 void ModulesDidUnload(ModuleList &module_list, bool delete_locations);
1167
1168 void SymbolsDidLoad(ModuleList &module_list);
1169
1170 void ClearModules(bool delete_locations);
1171
1172 /// Called as the last function in Process::DidExec().
1173 ///
1174 /// Process::DidExec() will clear a lot of state in the process,
1175 /// then try to reload a dynamic loader plugin to discover what
1176 /// binaries are currently available and then this function should
1177 /// be called to allow the target to do any cleanup after everything
1178 /// has been figured out. It can remove breakpoints that no longer
1179 /// make sense as the exec might have changed the target
1180 /// architecture, and unloaded some modules that might get deleted.
1181 void DidExec();
1182
1183 /// Gets the module for the main executable.
1184 ///
1185 /// Each process has a notion of a main executable that is the file
1186 /// that will be executed or attached to. Executable files can have
1187 /// dependent modules that are discovered from the object files, or
1188 /// discovered at runtime as things are dynamically loaded.
1189 ///
1190 /// \return
1191 /// The shared pointer to the executable module which can
1192 /// contains a nullptr Module object if no executable has been
1193 /// set.
1194 ///
1195 /// \see DynamicLoader
1196 /// \see ObjectFile::GetDependentModules (FileSpecList&)
1197 /// \see Process::SetExecutableModule(lldb::ModuleSP&)
1199
1201
1202 /// Set the main executable module.
1203 ///
1204 /// Each process has a notion of a main executable that is the file
1205 /// that will be executed or attached to. Executable files can have
1206 /// dependent modules that are discovered from the object files, or
1207 /// discovered at runtime as things are dynamically loaded.
1208 ///
1209 /// Setting the executable causes any of the current dependent
1210 /// image information to be cleared and replaced with the static
1211 /// dependent image information found by calling
1212 /// ObjectFile::GetDependentModules (FileSpecList&) on the main
1213 /// executable and any modules on which it depends. Calling
1214 /// Process::GetImages() will return the newly found images that
1215 /// were obtained from all of the object files.
1216 ///
1217 /// \param[in] module_sp
1218 /// A shared pointer reference to the module that will become
1219 /// the main executable for this process.
1220 ///
1221 /// \param[in] load_dependent_files
1222 /// If \b true then ask the object files to track down any
1223 /// known dependent files.
1224 ///
1225 /// \see ObjectFile::GetDependentModules (FileSpecList&)
1226 /// \see Process::GetImages()
1228 lldb::ModuleSP &module_sp,
1229 LoadDependentFiles load_dependent_files = eLoadDependentsDefault);
1230
1231 bool LoadScriptingResources(std::list<Status> &errors,
1232 bool continue_on_error = true) {
1233 return m_images.LoadScriptingResourcesInTarget(this, errors,
1234 continue_on_error);
1235 }
1236
1237 /// Get accessor for the images for this process.
1238 ///
1239 /// Each process has a notion of a main executable that is the file
1240 /// that will be executed or attached to. Executable files can have
1241 /// dependent modules that are discovered from the object files, or
1242 /// discovered at runtime as things are dynamically loaded. After
1243 /// a main executable has been set, the images will contain a list
1244 /// of all the files that the executable depends upon as far as the
1245 /// object files know. These images will usually contain valid file
1246 /// virtual addresses only. When the process is launched or attached
1247 /// to, the DynamicLoader plug-in will discover where these images
1248 /// were loaded in memory and will resolve the load virtual
1249 /// addresses is each image, and also in images that are loaded by
1250 /// code.
1251 ///
1252 /// \return
1253 /// A list of Module objects in a module list.
1254 const ModuleList &GetImages() const { return m_images; }
1255
1257
1258 /// Return whether this FileSpec corresponds to a module that should be
1259 /// considered for general searches.
1260 ///
1261 /// This API will be consulted by the SearchFilterForUnconstrainedSearches
1262 /// and any module that returns \b true will not be searched. Note the
1263 /// SearchFilterForUnconstrainedSearches is the search filter that
1264 /// gets used in the CreateBreakpoint calls when no modules is provided.
1265 ///
1266 /// The target call at present just consults the Platform's call of the
1267 /// same name.
1268 ///
1269 /// \param[in] module_spec
1270 /// Path to the module.
1271 ///
1272 /// \return \b true if the module should be excluded, \b false otherwise.
1273 bool ModuleIsExcludedForUnconstrainedSearches(const FileSpec &module_spec);
1274
1275 /// Return whether this module should be considered for general searches.
1276 ///
1277 /// This API will be consulted by the SearchFilterForUnconstrainedSearches
1278 /// and any module that returns \b true will not be searched. Note the
1279 /// SearchFilterForUnconstrainedSearches is the search filter that
1280 /// gets used in the CreateBreakpoint calls when no modules is provided.
1281 ///
1282 /// The target call at present just consults the Platform's call of the
1283 /// same name.
1284 ///
1285 /// FIXME: When we get time we should add a way for the user to set modules
1286 /// that they
1287 /// don't want searched, in addition to or instead of the platform ones.
1288 ///
1289 /// \param[in] module_sp
1290 /// A shared pointer reference to the module that checked.
1291 ///
1292 /// \return \b true if the module should be excluded, \b false otherwise.
1293 bool
1295
1296 const ArchSpec &GetArchitecture() const { return m_arch.GetSpec(); }
1297
1298 /// Returns the name of the target's ABI plugin.
1299 llvm::StringRef GetABIName() const;
1300
1301 /// Set the architecture for this target.
1302 ///
1303 /// If the current target has no Images read in, then this just sets the
1304 /// architecture, which will be used to select the architecture of the
1305 /// ExecutableModule when that is set. If the current target has an
1306 /// ExecutableModule, then calling SetArchitecture with a different
1307 /// architecture from the currently selected one will reset the
1308 /// ExecutableModule to that slice of the file backing the ExecutableModule.
1309 /// If the file backing the ExecutableModule does not contain a fork of this
1310 /// architecture, then this code will return false, and the architecture
1311 /// won't be changed. If the input arch_spec is the same as the already set
1312 /// architecture, this is a no-op.
1313 ///
1314 /// \param[in] arch_spec
1315 /// The new architecture.
1316 ///
1317 /// \param[in] set_platform
1318 /// If \b true, then the platform will be adjusted if the currently
1319 /// selected platform is not compatible with the architecture being set.
1320 /// If \b false, then just the architecture will be set even if the
1321 /// currently selected platform isn't compatible (in case it might be
1322 /// manually set following this function call).
1323 ///
1324 /// \param[in] merged
1325 /// If true, arch_spec is merged with the current
1326 /// architecture. Otherwise it's replaced.
1327 ///
1328 /// \return
1329 /// \b true if the architecture was successfully set, \b false otherwise.
1330 bool SetArchitecture(const ArchSpec &arch_spec, bool set_platform = false,
1331 bool merge = true);
1332
1333 bool MergeArchitecture(const ArchSpec &arch_spec);
1334
1335 Architecture *GetArchitecturePlugin() const { return m_arch.GetPlugin(); }
1336
1337 Debugger &GetDebugger() const { return m_debugger; }
1338
1339 size_t ReadMemoryFromFileCache(const Address &addr, void *dst, size_t dst_len,
1340 Status &error);
1341
1342 // Reading memory through the target allows us to skip going to the process
1343 // for reading memory if possible and it allows us to try and read from any
1344 // constant sections in our object files on disk. If you always want live
1345 // program memory, read straight from the process. If you possibly want to
1346 // read from const sections in object files, read from the target. This
1347 // version of ReadMemory will try and read memory from the process if the
1348 // process is alive. The order is:
1349 // 1 - if (force_live_memory == false) and the address falls in a read-only
1350 // section, then read from the file cache
1351 // 2 - if there is a process, then read from memory
1352 // 3 - if there is no process, then read from the file cache
1353 //
1354 // If did_read_live_memory is provided, will indicate if the read was from
1355 // live memory, or from file contents. A caller which needs to treat these two
1356 // sources differently should use this argument to disambiguate where the data
1357 // was read from.
1358 //
1359 // The method is virtual for mocking in the unit tests.
1360 virtual size_t ReadMemory(const Address &addr, void *dst, size_t dst_len,
1361 Status &error, bool force_live_memory = false,
1362 lldb::addr_t *load_addr_ptr = nullptr,
1363 bool *did_read_live_memory = nullptr);
1364
1365 size_t ReadCStringFromMemory(const Address &addr, std::string &out_str,
1366 Status &error, bool force_live_memory = false);
1367
1368 size_t ReadCStringFromMemory(const Address &addr, char *dst,
1369 size_t dst_max_len, Status &result_error,
1370 bool force_live_memory = false);
1371
1372 /// Read a NULL terminated string from memory
1373 ///
1374 /// This function will read a cache page at a time until a NULL string
1375 /// terminator is found. It will stop reading if an aligned sequence of NULL
1376 /// termination \a type_width bytes is not found before reading \a
1377 /// cstr_max_len bytes. The results are always guaranteed to be NULL
1378 /// terminated, and that no more than (max_bytes - type_width) bytes will be
1379 /// read.
1380 ///
1381 /// \param[in] addr
1382 /// The address to start the memory read.
1383 ///
1384 /// \param[in] dst
1385 /// A character buffer containing at least max_bytes.
1386 ///
1387 /// \param[in] max_bytes
1388 /// The maximum number of bytes to read.
1389 ///
1390 /// \param[in] error
1391 /// The error status of the read operation.
1392 ///
1393 /// \param[in] type_width
1394 /// The size of the null terminator (1 to 4 bytes per
1395 /// character). Defaults to 1.
1396 ///
1397 /// \return
1398 /// The error status or the number of bytes prior to the null terminator.
1399 size_t ReadStringFromMemory(const Address &addr, char *dst, size_t max_bytes,
1400 Status &error, size_t type_width,
1401 bool force_live_memory = true);
1402
1403 size_t ReadScalarIntegerFromMemory(const Address &addr, uint32_t byte_size,
1404 bool is_signed, Scalar &scalar,
1405 Status &error,
1406 bool force_live_memory = false);
1407
1408 int64_t ReadSignedIntegerFromMemory(const Address &addr,
1409 size_t integer_byte_size,
1410 int64_t fail_value, Status &error,
1411 bool force_live_memory = false);
1412
1413 uint64_t ReadUnsignedIntegerFromMemory(const Address &addr,
1414 size_t integer_byte_size,
1415 uint64_t fail_value, Status &error,
1416 bool force_live_memory = false);
1417
1418 bool ReadPointerFromMemory(const Address &addr, Status &error,
1419 Address &pointer_addr,
1420 bool force_live_memory = false);
1421
1422 bool HasLoadedSections();
1423
1425
1426 void ClearSectionLoadList();
1427
1428 void DumpSectionLoadList(Stream &s);
1429
1430 static Target *GetTargetFromContexts(const ExecutionContext *exe_ctx_ptr,
1431 const SymbolContext *sc_ptr);
1432
1433 // lldb::ExecutionContextScope pure virtual functions
1435
1437
1439
1441
1442 void CalculateExecutionContext(ExecutionContext &exe_ctx) override;
1443
1445
1446 llvm::Expected<lldb::TypeSystemSP>
1448 bool create_on_demand = true);
1449
1450 std::vector<lldb::TypeSystemSP>
1451 GetScratchTypeSystems(bool create_on_demand = true);
1452
1455
1456 // Creates a UserExpression for the given language, the rest of the
1457 // parameters have the same meaning as for the UserExpression constructor.
1458 // Returns a new-ed object which the caller owns.
1459
1461 GetUserExpressionForLanguage(llvm::StringRef expr, llvm::StringRef prefix,
1462 SourceLanguage language,
1463 Expression::ResultType desired_type,
1464 const EvaluateExpressionOptions &options,
1465 ValueObject *ctx_obj, Status &error);
1466
1467 // Creates a FunctionCaller for the given language, the rest of the
1468 // parameters have the same meaning as for the FunctionCaller constructor.
1469 // Since a FunctionCaller can't be
1470 // IR Interpreted, it makes no sense to call this with an
1471 // ExecutionContextScope that lacks
1472 // a Process.
1473 // Returns a new-ed object which the caller owns.
1474
1476 const CompilerType &return_type,
1477 const Address &function_address,
1478 const ValueList &arg_value_list,
1479 const char *name, Status &error);
1480
1481 /// Creates and installs a UtilityFunction for the given language.
1482 llvm::Expected<std::unique_ptr<UtilityFunction>>
1483 CreateUtilityFunction(std::string expression, std::string name,
1484 lldb::LanguageType language, ExecutionContext &exe_ctx);
1485
1486 // Install any files through the platform that need be to installed prior to
1487 // launching or attaching.
1488 Status Install(ProcessLaunchInfo *launch_info);
1489
1490 bool ResolveFileAddress(lldb::addr_t load_addr, Address &so_addr);
1491
1492 bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr,
1493 uint32_t stop_id = SectionLoadHistory::eStopIDNow,
1494 bool allow_section_end = false);
1495
1496 bool SetSectionLoadAddress(const lldb::SectionSP &section,
1497 lldb::addr_t load_addr,
1498 bool warn_multiple = false);
1499
1500 size_t UnloadModuleSections(const lldb::ModuleSP &module_sp);
1501
1502 size_t UnloadModuleSections(const ModuleList &module_list);
1503
1504 bool SetSectionUnloaded(const lldb::SectionSP &section_sp);
1505
1506 bool SetSectionUnloaded(const lldb::SectionSP &section_sp,
1507 lldb::addr_t load_addr);
1508
1510
1512 lldb_private::TypeSummaryImpl &summary_provider);
1514
1515 /// Set the \a Trace object containing processor trace information of this
1516 /// target.
1517 ///
1518 /// \param[in] trace_sp
1519 /// The trace object.
1520 void SetTrace(const lldb::TraceSP &trace_sp);
1521
1522 /// Get the \a Trace object containing processor trace information of this
1523 /// target.
1524 ///
1525 /// \return
1526 /// The trace object. It might be undefined.
1528
1529 /// Create a \a Trace object for the current target using the using the
1530 /// default supported tracing technology for this process.
1531 ///
1532 /// \return
1533 /// The new \a Trace or an \a llvm::Error if a \a Trace already exists or
1534 /// the trace couldn't be created.
1535 llvm::Expected<lldb::TraceSP> CreateTrace();
1536
1537 /// If a \a Trace object is present, this returns it, otherwise a new Trace is
1538 /// created with \a Trace::CreateTrace.
1539 llvm::Expected<lldb::TraceSP> GetTraceOrCreate();
1540
1541 // Since expressions results can persist beyond the lifetime of a process,
1542 // and the const expression results are available after a process is gone, we
1543 // provide a way for expressions to be evaluated from the Target itself. If
1544 // an expression is going to be run, then it should have a frame filled in in
1545 // the execution context.
1547 llvm::StringRef expression, ExecutionContextScope *exe_scope,
1548 lldb::ValueObjectSP &result_valobj_sp,
1550 std::string *fixed_expression = nullptr, ValueObject *ctx_obj = nullptr);
1551
1553
1555
1556 /// This method will return the address of the starting function for
1557 /// this binary, e.g. main() or its equivalent. This can be used as
1558 /// an address of a function that is not called once a binary has
1559 /// started running - e.g. as a return address for inferior function
1560 /// calls that are unambiguous completion of the function call, not
1561 /// called during the course of the inferior function code running.
1562 ///
1563 /// If no entry point can be found, an invalid address is returned.
1564 ///
1565 /// \param [out] err
1566 /// This object will be set to failure if no entry address could
1567 /// be found, and may contain a helpful error message.
1568 //
1569 /// \return
1570 /// Returns the entry address for this program, or an error
1571 /// if none can be found.
1572 llvm::Expected<lldb_private::Address> GetEntryPointAddress();
1573
1574 CompilerType GetRegisterType(const RegisterInfo &reg_info);
1575
1576 /// Sends a breakpoint notification event.
1578 lldb::BreakpointEventType event_kind);
1579 /// Sends a breakpoint notification event.
1581 const lldb::EventDataSP &breakpoint_data_sp);
1582
1583 llvm::Expected<lldb::DisassemblerSP>
1584 ReadInstructions(const Address &start_addr, uint32_t count,
1585 const char *flavor_string = nullptr);
1586
1587 // Target Stop Hooks
1588 class StopHook : public UserID {
1589 public:
1590 StopHook(const StopHook &rhs);
1591 virtual ~StopHook() = default;
1592
1593 enum class StopHookKind : uint32_t {
1597 };
1604
1606
1607 // Set the specifier. The stop hook will own the specifier, and is
1608 // responsible for deleting it when we're done.
1609 void SetSpecifier(SymbolContextSpecifier *specifier);
1610
1612
1613 bool ExecutionContextPasses(const ExecutionContext &exe_ctx);
1614
1615 // Called on stop, this gets passed the ExecutionContext for each "stop
1616 // with a reason" thread. It should add to the stream whatever text it
1617 // wants to show the user, and return False to indicate it wants the target
1618 // not to stop.
1620 lldb::StreamSP output) = 0;
1621
1622 // Set the Thread Specifier. The stop hook will own the thread specifier,
1623 // and is responsible for deleting it when we're done.
1624 void SetThreadSpecifier(ThreadSpec *specifier);
1625
1627
1628 bool IsActive() { return m_active; }
1629
1630 void SetIsActive(bool is_active) { m_active = is_active; }
1631
1632 void SetAutoContinue(bool auto_continue) {
1633 m_auto_continue = auto_continue;
1634 }
1635
1636 bool GetAutoContinue() const { return m_auto_continue; }
1637
1638 void SetRunAtInitialStop(bool at_initial_stop) {
1639 m_at_initial_stop = at_initial_stop;
1640 }
1641
1643
1644 void SetSuppressOutput(bool suppress_output) {
1645 m_suppress_output = suppress_output;
1646 }
1647
1648 bool GetSuppressOutput() const { return m_suppress_output; }
1649
1650 void GetDescription(Stream &s, lldb::DescriptionLevel level) const;
1652 lldb::DescriptionLevel level) const = 0;
1653
1654 protected:
1657 std::unique_ptr<ThreadSpec> m_thread_spec_up;
1658 bool m_active = true;
1659 bool m_auto_continue = false;
1661 bool m_suppress_output = false;
1662
1663 StopHook(lldb::TargetSP target_sp, lldb::user_id_t uid);
1664 };
1665
1667 public:
1668 ~StopHookCommandLine() override = default;
1669
1671 void SetActionFromString(const std::string &strings);
1672 void SetActionFromStrings(const std::vector<std::string> &strings);
1673
1675 lldb::StreamSP output_sp) override;
1677 lldb::DescriptionLevel level) const override;
1678
1679 private:
1681 // Use CreateStopHook to make a new empty stop hook. Use SetActionFromString
1682 // to fill it with commands, and SetSpecifier to set the specifier shared
1683 // pointer (can be null, that will match anything.)
1685 : StopHook(target_sp, uid) {}
1686 friend class Target;
1687 };
1688
1690 public:
1691 ~StopHookScripted() override = default;
1693 lldb::StreamSP output) override;
1694
1695 Status SetScriptCallback(const ScriptedMetadata &scripted_metadata);
1696
1698 lldb::DescriptionLevel level) const override;
1699
1700 private:
1701 llvm::StringRef GetScriptClassName() const;
1702
1704
1705 /// Use CreateStopHook to make a new empty stop hook. Use SetScriptCallback
1706 /// to set the script to execute, and SetSpecifier to set the specifier
1707 /// shared pointer (can be null, that will match anything.)
1709 : StopHook(target_sp, uid) {}
1710 friend class Target;
1711 };
1712
1713 class StopHookCoded : public StopHook {
1714 public:
1715 ~StopHookCoded() override = default;
1716
1718 lldb::StreamSP output);
1719
1720 void SetCallback(llvm::StringRef name, HandleStopCallback *callback) {
1721 m_name = name;
1722 m_callback = callback;
1723 }
1724
1726 lldb::StreamSP output) override {
1727 return m_callback(exc_ctx, output);
1728 }
1729
1731 lldb::DescriptionLevel level) const override {
1732 s.Indent();
1733 s.Printf("%s (built-in)\n", m_name.c_str());
1734 }
1735
1736 private:
1737 std::string m_name;
1739
1740 /// Use CreateStopHook to make a new empty stop hook. Use SetCallback to set
1741 /// the callback to execute, and SetSpecifier to set the specifier shared
1742 /// pointer (can be null, that will match anything.)
1744 : StopHook(target_sp, uid) {}
1745 friend class Target;
1746 };
1747
1749
1750 typedef std::shared_ptr<StopHook> StopHookSP;
1751
1752 // Target Hooks
1753 //
1754 // Hooks fire on target lifecycle events. There are two flows:
1755 //
1756 // Command-based hooks: the user specifies which triggers the hook responds
1757 // to (--on-load, --on-unload, --on-stop) and provides a list of commands.
1758 // All commands run for every trigger the hook is signed up for.
1759 //
1760 // Python class hooks: the user provides a Python class name and optional
1761 // extra_args that will be passed to the hook init method (-k key -v value).
1762 // The class controls which events it handles by implementing the
1763 // corresponding callback methods (handle_module_loaded,
1764 // handle_module_unloaded, handle_stop). Triggers are set automatically
1765 // based on which methods exist.
1766 class Hook : public UserID {
1767 public:
1768 Hook(const Hook &rhs);
1769 virtual ~Hook() = default;
1770
1771 enum class HookKind : uint32_t { CommandBased = 0, ScriptBased };
1772
1773 HookKind GetHookKind() const { return m_kind; }
1774
1775 /// Individual trigger bits. Combine with bitwise OR to form a trigger mask.
1776 // FIXME: Add kProcessExit, kProcessDetach, etc. as needed.
1777 enum TriggerBit : uint32_t {
1778 kModulesLoaded = (1u << 0),
1779 kModulesUnloaded = (1u << 1),
1780 kProcessStop = (1u << 2),
1781 };
1782
1784
1785 bool IsEnabled() { return m_enabled; }
1786 void SetIsEnabled(bool enabled) { m_enabled = enabled; }
1787
1788 /// Return the bitmask of triggers this hook responds to.
1789 /// Each bit corresponds to a TriggerBit value.
1790 uint32_t GetTriggerMask() const { return m_trigger_mask; }
1791
1792 /// Return true if this hook fires on the given trigger.
1793 bool FiresOn(uint32_t trigger) const { return m_trigger_mask & trigger; }
1794
1795 // Filter fields
1796
1797 /// Set the symbol context specifier. The hook takes ownership.
1798 void SetSCSpecifier(SymbolContextSpecifier *specifier);
1800
1801 /// Check if the execution context passes the specifier and thread spec
1802 /// filters. Always returns true if no filters are set.
1803 bool ExecutionContextPasses(const ExecutionContext &exe_ctx);
1804
1805 /// Set the thread specifier. The hook takes ownership.
1806 void SetThreadSpecifier(ThreadSpec *specifier);
1808
1809 void SetRunAtInitialStop(bool at_initial_stop) {
1810 m_at_initial_stop = at_initial_stop;
1811 }
1813
1814 // Reaction settings
1815
1816 void SetAutoContinue(bool auto_continue) {
1817 m_auto_continue = auto_continue;
1818 }
1819 bool GetAutoContinue() const { return m_auto_continue; }
1820
1821 void SetSuppressOutput(bool suppress_output) {
1822 m_suppress_output = suppress_output;
1823 }
1824 bool GetSuppressOutput() const { return m_suppress_output; }
1825
1826 // Event handler methods (default no-ops)
1827
1828 virtual void HandleModuleLoaded(lldb::StreamSP output) {}
1829 virtual void HandleModuleUnloaded(lldb::StreamSP output) {}
1830
1831 /// Called when the process stops. Returns a StopHookResult indicating
1832 /// whether the process should remain stopped or continue.
1837
1838 virtual void GetDescription(Stream &s, lldb::DescriptionLevel level) const;
1839
1840 protected:
1841 /// Print the filter portion of the description (AutoContinue, Specifier,
1842 /// ThreadSpec). Called by subclass GetDescription after printing the
1843 /// hook-specific content (commands or class).
1847 bool m_enabled = true;
1848 uint32_t m_trigger_mask = 0; // No default, triggers must be explicit.
1849
1850 // Filters
1852 std::unique_ptr<ThreadSpec> m_thread_spec_up;
1854
1855 // Reaction settings
1856 bool m_auto_continue = false;
1857 bool m_suppress_output = false;
1858
1859 Hook(lldb::TargetSP target_sp, lldb::user_id_t uid, HookKind kind);
1860 };
1861
1862 class HookCommandLine : public Hook {
1863 public:
1864 ~HookCommandLine() override = default;
1865
1866 /// Replace the trigger mask. \a mask is a bitwise OR of TriggerBit values.
1867 void SetTriggerMask(uint32_t mask) { m_trigger_mask = mask; }
1868
1869 /// Add a trigger to the mask. \a trigger is a single TriggerBit value.
1870 void AddTrigger(uint32_t trigger) { m_trigger_mask |= trigger; }
1871
1872 /// Remove a trigger from the mask. \a trigger is a single TriggerBit value.
1873 void RemoveTrigger(uint32_t trigger) { m_trigger_mask &= ~trigger; }
1874
1875 /// Return the list of commands that this hook runs.
1877
1878 /// Populate the command list by splitting a single string on newlines.
1879 void SetActionFromString(const std::string &string);
1880
1881 /// Populate the command list from a vector of individual command strings.
1882 void SetActionFromStrings(const std::vector<std::string> &strings);
1883
1884 void GetDescription(Stream &s, lldb::DescriptionLevel level) const override;
1885 void HandleModuleLoaded(lldb::StreamSP output) override;
1886 void HandleModuleUnloaded(lldb::StreamSP output) override;
1888 lldb::StreamSP output) override;
1889
1890 private:
1892
1894 : Hook(target_sp, uid, HookKind::CommandBased) {}
1895 friend class Target;
1896 };
1897
1898 class HookScripted : public Hook {
1899 public:
1900 ~HookScripted() override = default;
1901
1902 void GetDescription(Stream &s, lldb::DescriptionLevel level) const override;
1903
1904 void HandleModuleLoaded(lldb::StreamSP output) override;
1905 void HandleModuleUnloaded(lldb::StreamSP output) override;
1907 lldb::StreamSP output) override;
1908
1909 Status SetScriptCallback(const ScriptedMetadata &scripted_metadata);
1910
1911 private:
1912 llvm::StringRef GetScriptClassName() const;
1913
1915
1917 : Hook(target_sp, uid, HookKind::ScriptBased) {}
1918 friend class Target;
1919 };
1920
1921 typedef std::shared_ptr<Hook> HookSP;
1922
1924
1925 /// Removes the most recently created hook. Used to roll back a
1926 /// hook creation when an error occurs (e.g., invalid script class name
1927 /// or empty interactive input).
1929
1931
1932 void RemoveAllHooks();
1933
1935
1936 bool SetHookEnabledStateByID(lldb::user_id_t uid, bool enabled);
1937
1938 void SetAllHooksEnabledState(bool enabled);
1939
1940 size_t GetNumHooks() const { return m_hooks.size(); }
1941
1942 HookSP GetHookAtIndex(size_t index);
1943
1944 void RunModuleHooks(bool is_load);
1945
1946 /// Add an empty stop hook to the Target's stop hook list, and returns a
1947 /// shared pointer to the new hook.
1948 StopHookSP CreateStopHook(StopHook::StopHookKind kind, bool internal = false);
1949
1950 /// If you tried to create a stop hook, and that failed, call this to
1951 /// remove the stop hook, as it will also reset the stop hook counter.
1953
1954 // Runs the stop hooks that have been registered for this target.
1955 // Returns true if the stop hooks cause the target to resume.
1956 // Pass at_initial_stop if this is the stop where lldb gains
1957 // control over the process for the first time.
1958 bool RunStopHooks(bool at_initial_stop = false);
1959
1960 bool SetSuppresStopHooks(bool suppress) {
1961 bool old_value = m_suppress_stop_hooks;
1962 m_suppress_stop_hooks = suppress;
1963 return old_value;
1964 }
1965
1967
1969
1970 void RemoveAllStopHooks();
1971
1972 StopHookSP GetStopHookByID(lldb::user_id_t uid);
1973
1974 bool SetStopHookActiveStateByID(lldb::user_id_t uid, bool active_state);
1975
1976 void SetAllStopHooksActiveState(bool active_state);
1977
1978 const std::vector<StopHookSP> GetStopHooks(bool internal = false) const;
1979
1981
1982 void SetPlatform(const lldb::PlatformSP &platform_sp) {
1983 m_platform_sp = platform_sp;
1984 }
1985
1987
1988 // Methods.
1990 GetSearchFilterForModule(const FileSpec *containingModule);
1991
1993 GetSearchFilterForModuleList(const FileSpecList *containingModuleList);
1994
1996 GetSearchFilterForModuleAndCUList(const FileSpecList *containingModules,
1997 const FileSpecList *containingSourceFiles);
1998
2000 const char *repl_options, bool can_create);
2001
2002 void SetREPL(lldb::LanguageType language, lldb::REPLSP repl_sp);
2003
2007
2009
2010 /// Get the list of paths that LLDB will consider automatically loading
2011 /// scripting resources from. Currently whether to load scripts
2012 /// unconditionally is controlled via the
2013 /// `target.load-script-from-symbol-file` setting.
2015
2016 /// Add a signal for the target. This will get copied over to the process
2017 /// if the signal exists on that target. Only the values with Yes and No are
2018 /// set, Calculate values will be ignored.
2019protected:
2028 using DummySignalElement = llvm::StringMapEntry<DummySignalValues>;
2029 static bool UpdateSignalFromDummy(lldb::UnixSignalsSP signals_sp,
2030 const DummySignalElement &element);
2031 static bool ResetSignalFromDummy(lldb::UnixSignalsSP signals_sp,
2032 const DummySignalElement &element);
2033
2034public:
2035 /// Add a signal to the Target's list of stored signals/actions. These
2036 /// values will get copied into any processes launched from
2037 /// this target.
2038 void AddDummySignal(llvm::StringRef name, LazyBool pass, LazyBool print,
2039 LazyBool stop);
2040 /// Updates the signals in signals_sp using the stored dummy signals.
2041 /// If warning_stream_sp is not null, if any stored signals are not found in
2042 /// the current process, a warning will be emitted here.
2044 lldb::StreamSP warning_stream_sp);
2045 /// Clear the dummy signals in signal_names from the target, or all signals
2046 /// if signal_names is empty. Also remove the behaviors they set from the
2047 /// process's signals if it exists.
2048 void ClearDummySignals(Args &signal_names);
2049 /// Print all the signals set in this target.
2050 void PrintDummySignals(Stream &strm, Args &signals);
2051
2052protected:
2053 /// The mutex the calling thread must serialize on for its current policy, or
2054 /// nullptr when that policy bypasses the API mutex entirely.
2055 std::recursive_mutex *GetAPIMutexForCurrentPolicy();
2056
2057 /// Implementing of ModuleList::Notifier.
2058
2059 void NotifyModuleAdded(const ModuleList &module_list,
2060 const lldb::ModuleSP &module_sp) override;
2061
2062 void NotifyModuleRemoved(const ModuleList &module_list,
2063 const lldb::ModuleSP &module_sp) override;
2064
2065 void NotifyModuleUpdated(const ModuleList &module_list,
2066 const lldb::ModuleSP &old_module_sp,
2067 const lldb::ModuleSP &new_module_sp) override;
2068
2069 void NotifyWillClearList(const ModuleList &module_list) override;
2070
2071 void NotifyModulesRemoved(lldb_private::ModuleList &module_list) override;
2072
2073 class Arch {
2074 public:
2075 explicit Arch(const ArchSpec &spec);
2076 const Arch &operator=(const ArchSpec &spec);
2077
2078 const ArchSpec &GetSpec() const { return m_spec; }
2079 Architecture *GetPlugin() const { return m_plugin_up.get(); }
2080
2081 private:
2083 std::unique_ptr<Architecture> m_plugin_up;
2084 };
2085
2086 // Member variables.
2088 lldb::PlatformSP m_platform_sp; ///< The platform for this target.
2089 std::recursive_mutex m_mutex; ///< An API mutex that is used by the lldb::SB*
2090 /// classes make the SB interface thread safe
2091 /// When the private state thread calls SB API's - usually because it is
2092 /// running OS plugin or Python ThreadPlan code - it should not block on the
2093 /// API mutex that is held by the code that kicked off the sequence of events
2094 /// that led us to run the code. We hand out this mutex instead when we
2095 /// detect that code is running on the private state thread.
2096 std::recursive_mutex m_private_mutex;
2098 std::string m_label;
2099 ModuleList m_images; ///< The list of images for this process (shared
2100 /// libraries and anything dynamically loaded).
2105 using BreakpointNameMap = llvm::StringMap<std::unique_ptr<BreakpointName>>;
2107
2108 std::map<lldb::user_id_t, BreakpointResolverOverrideUP>
2110 /// This is the ID that will be handed out for the next added breakpoint
2111 /// override resolver for this target.
2113
2117 // We want to tightly control the process destruction process so we can
2118 // correctly tear down everything that we need to, so the only class that
2119 // knows about the process lifespan is this target class.
2124
2125 /// Map of scripted frame provider descriptors for this target.
2126 /// Keys are the provider descriptor IDs, values are the descriptors.
2127 /// Insertion order is preserved so that equal-priority providers chain
2128 /// in registration order.
2129 llvm::MapVector<uint32_t, ScriptedFrameProviderDescriptor>
2131 mutable std::recursive_mutex m_frame_provider_descriptors_mutex;
2133
2134 typedef std::map<lldb::LanguageType, lldb::REPLSP> REPLMap;
2136
2138
2139 typedef std::map<lldb::user_id_t, StopHookSP> StopHookCollection;
2142 std::vector<StopHookSP> m_internal_stop_hooks;
2143 uint32_t m_latest_stop_hook_id; /// This records the last natural stop at
2144 /// which we ran a stop-hook.
2146 bool m_suppress_stop_hooks; /// Used to not run stop hooks for expressions
2148
2149 typedef std::map<lldb::user_id_t, HookSP> HookCollection;
2154 LLDB_INVALID_GLOBALLY_UNIQUE_TARGET_ID; ///< The globally unique ID
2155 /// assigned to this target
2156 std::string m_target_session_name; ///< The target session name for this
2157 /// target, used to name debugging
2158 /// sessions in DAP.
2159 /// An optional \a lldb_private::Trace object containing processor trace
2160 /// information of this target.
2162 /// Stores the frame recognizers of this target.
2164 /// These are used to set the signal state when you don't have a process and
2165 /// more usefully in the Dummy target where you can't know exactly what
2166 /// signals you will have.
2167 llvm::StringMap<DummySignalValues> m_dummy_signals;
2168
2170
2171 static void ImageSearchPathsChanged(const PathMappingList &path_list,
2172 void *baton);
2173
2174 // Utilities for `statistics` command.
2175private:
2176 // Target metrics storage.
2178
2179public:
2180 /// Get metrics associated with this target in JSON format.
2181 ///
2182 /// Target metrics help measure timings and information that is contained in
2183 /// a target. These are designed to help measure performance of a debug
2184 /// session as well as represent the current state of the target, like
2185 /// information on the currently modules, currently set breakpoints and more.
2186 ///
2187 /// \return
2188 /// Returns a JSON value that contains all target metrics.
2189 llvm::json::Value
2191
2192 void ResetStatistics();
2193
2195
2196protected:
2197 /// Construct with optional file and arch.
2198 ///
2199 /// This member is private. Clients must use
2200 /// TargetList::CreateTarget(const FileSpec*, const ArchSpec*)
2201 /// so all targets can be tracked from the central target list.
2202 ///
2203 /// \see TargetList::CreateTarget(const FileSpec*, const ArchSpec*)
2204 Target(Debugger &debugger, const ArchSpec &target_arch,
2205 const lldb::PlatformSP &platform_sp, bool is_dummy_target);
2206
2207 // Helper function.
2208 bool ProcessIsValid();
2209
2210 // Copy breakpoints, stop hooks and so forth from the dummy target:
2211 void PrimeFromDummyTarget(Target &target);
2212
2213 void AddBreakpoint(lldb::BreakpointSP breakpoint_sp, bool internal);
2214
2216
2217 /// Return a recommended size for memory reads at \a addr, optimizing for
2218 /// cache usage.
2220
2221 Target(const Target &) = delete;
2222 const Target &operator=(const Target &) = delete;
2223
2225 return m_section_load_history.GetCurrentSectionLoadList();
2226 }
2227};
2228
2229} // namespace lldb_private
2230
2231#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:100
void SetPreferredSymbolContexts(SymbolContextList contexts)
Definition Target.h:370
void SetOneThreadTimeout(const Timeout< std::micro > &timeout)
Definition Target.h:429
void SetUnwindOnError(bool unwind=false)
Definition Target.h:402
SourceLanguage GetLanguage() const
Definition Target.h:364
const char * GetPoundLineFilePath() const
Definition Target.h:492
lldb::DynamicValueType m_use_dynamic
Definition Target.h:560
void SetExecutionPolicy(ExecutionPolicy policy=eExecutionPolicyAlways)
Definition Target.h:360
Timeout< std::micro > m_one_thread_timeout
Definition Target.h:562
bool InvokeCancelCallback(lldb::ExpressionEvaluationPhase phase) const
Definition Target.h:474
lldb::DynamicValueType GetUseDynamic() const
Definition Target.h:414
void SetKeepInMemory(bool keep=true)
Definition Target.h:412
void SetCoerceToId(bool coerce=true)
Definition Target.h:398
void SetLanguage(lldb::LanguageType language_type)
Definition Target.h:366
ExecutionPolicy GetExecutionPolicy() const
Definition Target.h:358
Timeout< std::micro > m_timeout
Definition Target.h:561
void SetCppIgnoreContextQualifiers(bool value)
Definition Target.cpp:6158
const StructuredData::Dictionary & GetLanguageOptions() const
Definition Target.cpp:6136
llvm::Expected< bool > GetBooleanLanguageOption(llvm::StringRef option_name) const
Get the language-plugin specific boolean option called option_name.
Definition Target.cpp:6120
void SetPrefix(const char *prefix)
Definition Target.h:391
void SetTryAllThreads(bool try_others=true)
Definition Target.h:435
static constexpr std::chrono::milliseconds default_timeout
Definition Target.h:350
void SetPoundLine(const char *path, uint32_t line) const
Definition Target.h:482
void SetRetriesWithFixIts(uint64_t number_of_retries)
Definition Target.h:508
SymbolContextList m_preferred_lookup_contexts
During expression evaluation, any SymbolContext in this list will be used for symbol/function lookup ...
Definition Target.h:578
void SetTimeout(const Timeout< std::micro > &timeout)
Definition Target.h:423
static constexpr ExecutionPolicy default_execution_policy
Definition Target.h:355
void SetStopOthers(bool stop_others=true)
Definition Target.h:439
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:558
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:6103
StructuredData::DictionarySP m_language_options_sp
Dictionary mapping names of language-plugin specific options to values.
Definition Target.h:573
void SetCancelCallback(lldb::ExpressionCancelCallback callback, void *baton)
Definition Target.h:469
const Timeout< std::micro > & GetTimeout() const
Definition Target.h:421
const SymbolContextList & GetPreferredSymbolContexts() const
Definition Target.h:374
void SetIgnoreBreakpoints(bool ignore=false)
Definition Target.h:406
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:381
void SetUseDynamic(lldb::DynamicValueType dynamic=lldb::eDynamicCanRunTarget)
Definition Target.h:417
lldb::ExpressionCancelCallback m_cancel_callback
Definition Target.h:563
const Timeout< std::micro > & GetOneThreadTimeout() const
Definition Target.h:425
"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:125
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...
uint32_t GetMaximumSizeOfStringSummary() const
Definition Target.cpp:5631
FileSpecList GetDebugFileSearchPaths()
Definition Target.cpp:5506
llvm::StringRef GetLaunchWorkingDirectory() const
Definition Target.cpp:5312
bool GetDisplayRecognizedArguments() const
Definition Target.cpp:5795
ImportStdModule GetImportStdModule() const
Definition Target.cpp:5522
void AppendExecutableSearchPaths(const FileSpec &)
Definition Target.cpp:5493
bool GetEnableSyntheticValue() const
Definition Target.cpp:5598
void SetStandardInputPath(const char *path)=delete
ProcessLaunchInfo m_launch_info
Definition Target.h:333
bool GetCheckValueObjectOwnership() const
Definition Target.cpp:5923
uint64_t GetExprAllocAlign() const
Definition Target.cpp:5710
MemoryModuleLoadLevel GetMemoryModuleLoadLevel() const
Definition Target.cpp:5767
llvm::StringRef GetArg0() const
Definition Target.cpp:5365
uint32_t GetMaximumMemReadSize() const
Definition Target.cpp:5637
void SetRunArguments(const Args &args)
Definition Target.cpp:5382
FileSpec GetStandardErrorPath() const
Definition Target.cpp:5663
void SetLoadScriptFromSymbolFile(LoadScriptFromSymFile load_style)
Set the target-wide target.load-script-from-symbol-file setting.
Definition Target.cpp:5747
bool GetEnableNotifyAboutFixIts() const
Definition Target.cpp:5548
bool SetPreferDynamicValue(lldb::DynamicValueType d)
Definition Target.cpp:5249
void SetDisplayRecognizedArguments(bool b)
Definition Target.cpp:5801
std::optional< bool > GetExperimentalPropertyValue(size_t prop_idx, ExecutionContext *exe_ctx=nullptr) const
Definition Target.cpp:5188
const ProcessLaunchInfo & GetProcessLaunchInfo() const
Definition Target.cpp:5806
Environment ComputeEnvironment() const
Definition Target.cpp:5388
void SetStandardOutputPath(const char *path)=delete
bool GetUserSpecifiedTrapHandlerNames(Args &args) const
Definition Target.cpp:5774
uint64_t GetExprErrorLimit() const
Definition Target.cpp:5692
bool GetEnableAutoImportClangModules() const
Definition Target.cpp:5516
bool GetDebugUtilityExpression() const
Definition Target.cpp:5912
JITEngine GetJITEngine() const
Definition Target.cpp:5559
DynamicClassInfoHelper GetDynamicClassInfoHelper() const
Definition Target.cpp:5529
FileSpec GetStandardOutputPath() const
Definition Target.cpp:5653
void SetDisplayRuntimeSupportValues(bool b)
Definition Target.cpp:5790
uint32_t GetMaximumNumberOfChildrenToDisplay() const
Definition Target.cpp:5616
void SetRequireHardwareBreakpoints(bool b)
Definition Target.cpp:5844
bool GetAutoInstallMainExecutable() const
Definition Target.cpp:5849
const char * GetDisassemblyFeatures() const
Definition Target.cpp:5344
void SetAutoLoadScriptsForModule(llvm::StringRef module_name, LoadScriptFromSymFile load_style)
Set the LoadScriptFromSymFile for a module called module_name (excluding file extension).
Definition Target.cpp:5949
RealpathPrefixes GetSourceRealpathPrefixes() const
Definition Target.cpp:5360
void SetCheckValueObjectOwnership(bool check)
Definition Target.cpp:5929
uint64_t GetNumberOfRetriesWithFixits() const
Definition Target.cpp:5542
uint64_t GetExprAllocSize() const
Definition Target.cpp:5704
std::optional< LoadScriptFromSymFile > GetAutoLoadScriptsForModule(llvm::StringRef module_name) const
Definition Target.cpp:5935
llvm::StringRef GetExpressionPrefixContents()
Definition Target.cpp:5678
PathMappingList & GetObjectPathMap() const
Definition Target.cpp:5479
const char * GetDisassemblyFlavor() const
Definition Target.cpp:5324
FileSpec GetStandardInputPath() const
Definition Target.cpp:5643
lldb::DynamicValueType GetPreferDynamicValue() const
Definition Target.cpp:5242
InlineStrategy GetInlineStrategy() const
Definition Target.cpp:5351
Environment GetTargetEnvironment() const
Definition Target.cpp:5448
bool GetDisplayRuntimeSupportValues() const
Definition Target.cpp:5784
void SetUserSpecifiedTrapHandlerNames(const Args &args)
Definition Target.cpp:5779
uint32_t GetMaxZeroPaddingInFloatFormat() const
Definition Target.cpp:5610
uint64_t GetExprAllocAddress() const
Definition Target.cpp:5698
LoadCWDlldbinitFile GetLoadCWDlldbinitFile() const
Definition Target.cpp:5753
Environment GetInheritedEnvironment() const
Definition Target.cpp:5420
void SetArg0(llvm::StringRef arg)
Definition Target.cpp:5371
bool GetInjectLocalVariables(ExecutionContext *exe_ctx) const
Definition Target.cpp:5199
void SetStandardErrorPath(const char *path)=delete
bool ShowHexVariableValuesWithLeadingZeroes() const
Definition Target.cpp:5604
SourceLanguage GetLanguage() const
Definition Target.cpp:5673
Environment GetEnvironment() const
Definition Target.cpp:5416
void SetProcessLaunchInfo(const ProcessLaunchInfo &launch_info)
Definition Target.cpp:5810
FileSpec GetSaveJITObjectsDir() const
Definition Target.cpp:5554
void SetEnvironment(Environment env)
Definition Target.cpp:5459
LoadScriptFromSymFile GetLoadScriptFromSymbolFile() const
Definition Target.cpp:5740
const char * GetDisassemblyCPU() const
Definition Target.cpp:5337
void SetStandardErrorPath(llvm::StringRef path)
Definition Target.cpp:5668
bool GetRunArguments(Args &args) const
Definition Target.cpp:5377
FileSpecList GetExecutableSearchPaths()
Definition Target.cpp:5501
ArchSpec GetDefaultArchitecture() const
Definition Target.cpp:5226
Disassembler::HexImmediateStyle GetHexImmediateStyle() const
Definition Target.cpp:5760
void SetUseDIL(ExecutionContext *exe_ctx, bool b)
Definition Target.cpp:5217
std::unique_ptr< TargetExperimentalProperties > m_experimental_properties_up
Definition Target.h:334
FileSpecList GetClangModuleSearchPaths()
Definition Target.cpp:5511
void SetStandardOutputPath(llvm::StringRef path)
Definition Target.cpp:5658
bool GetRequireHardwareBreakpoints() const
Definition Target.cpp:5838
PathMappingList & GetSourcePathMap() const
Definition Target.cpp:5471
bool GetAutoSourceMapRelative() const
Definition Target.cpp:5487
bool GetUseDIL(ExecutionContext *exe_ctx) const
Definition Target.cpp:5205
void SetDefaultArchitecture(const ArchSpec &arch)
Definition Target.cpp:5231
void SetStandardInputPath(llvm::StringRef path)
Definition Target.cpp:5648
TargetProperties(Target *target)
Definition Target.cpp:5112
bool GetDisplayExpressionsInCrashlogs() const
Definition Target.cpp:5734
bool GetEnableAutoApplyFixIts() const
Definition Target.cpp:5536
void SetDebugUtilityExpression(bool debug)
Definition Target.cpp:5918
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:5623
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:2083
const ArchSpec & GetSpec() const
Definition Target.h:2078
const Arch & operator=(const ArchSpec &spec)
Definition Target.cpp:170
Arch(const ArchSpec &spec)
Definition Target.cpp:166
Architecture * GetPlugin() const
Definition Target.h:2079
virtual BreakpointResolverOverrideUP CopyIntoNewTarget(Target &target)=0
BreakpointResolverOverride(Target &target, const std::string &description, uint64_t type_mask)
Definition Target.h:1035
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:1870
void RemoveTrigger(uint32_t trigger)
Remove a trigger from the mask. trigger is a single TriggerBit value.
Definition Target.h:1873
void GetDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.cpp:4534
HookCommandLine(lldb::TargetSP target_sp, lldb::user_id_t uid)
Definition Target.h:1893
void SetTriggerMask(uint32_t mask)
Replace the trigger mask. mask is a bitwise OR of TriggerBit values.
Definition Target.h:1867
void SetActionFromString(const std::string &string)
Populate the command list by splitting a single string on newlines.
Definition Target.cpp:4561
void SetActionFromStrings(const std::vector< std::string > &strings)
Populate the command list from a vector of individual command strings.
Definition Target.cpp:4565
void HandleModuleLoaded(lldb::StreamSP output) override
Definition Target.cpp:4571
StringList & GetCommands()
Return the list of commands that this hook runs.
Definition Target.h:1876
StopHook::StopHookResult HandleStop(ExecutionContext &exe_ctx, lldb::StreamSP output) override
Called when the process stops.
Definition Target.cpp:4611
void HandleModuleUnloaded(lldb::StreamSP output) override
Definition Target.cpp:4605
llvm::StringRef GetScriptClassName() const
Definition Target.cpp:4725
Status SetScriptCallback(const ScriptedMetadata &scripted_metadata)
Definition Target.cpp:4646
void HandleModuleLoaded(lldb::StreamSP output) override
Definition Target.cpp:4688
StopHook::StopHookResult HandleStop(ExecutionContext &exe_ctx, lldb::StreamSP output) override
Called when the process stops.
Definition Target.cpp:4707
HookScripted(lldb::TargetSP target_sp, lldb::user_id_t uid)
Definition Target.h:1916
void GetDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.cpp:4731
lldb::ScriptedHookInterfaceSP m_interface_sp
Definition Target.h:1914
void HandleModuleUnloaded(lldb::StreamSP output) override
Definition Target.cpp:4697
virtual ~Hook()=default
void SetSuppressOutput(bool suppress_output)
Definition Target.h:1821
bool GetRunAtInitialStop() const
Definition Target.h:1812
ThreadSpec * GetThreadSpecifier()
Definition Target.h:1807
TriggerBit
Individual trigger bits. Combine with bitwise OR to form a trigger mask.
Definition Target.h:1777
bool GetSuppressOutput() const
Definition Target.h:1824
void SetRunAtInitialStop(bool at_initial_stop)
Definition Target.h:1809
lldb::SymbolContextSpecifierSP m_sc_specifier_sp
Definition Target.h:1851
void SetIsEnabled(bool enabled)
Definition Target.h:1786
bool ExecutionContextPasses(const ExecutionContext &exe_ctx)
Check if the execution context passes the specifier and thread spec filters.
Definition Target.cpp:4457
HookKind GetHookKind() const
Definition Target.h:1773
Hook(const Hook &rhs)
Definition Target.cpp:4438
virtual StopHook::StopHookResult HandleStop(ExecutionContext &exe_ctx, lldb::StreamSP output)
Called when the process stops.
Definition Target.h:1833
void GetFilterDescription(Stream &s, lldb::DescriptionLevel level) const
Print the filter portion of the description (AutoContinue, Specifier, ThreadSpec).
Definition Target.cpp:4506
void SetAutoContinue(bool auto_continue)
Definition Target.h:1816
bool GetAutoContinue() const
Definition Target.h:1819
virtual void HandleModuleUnloaded(lldb::StreamSP output)
Definition Target.h:1829
uint32_t GetTriggerMask() const
Return the bitmask of triggers this hook responds to.
Definition Target.h:1790
lldb::TargetSP & GetTarget()
Definition Target.h:1783
SymbolContextSpecifier * GetSCSpecifier()
Definition Target.h:1799
lldb::TargetSP m_target_sp
Definition Target.h:1845
virtual void GetDescription(Stream &s, lldb::DescriptionLevel level) const
Definition Target.cpp:4473
void SetSCSpecifier(SymbolContextSpecifier *specifier)
Set the symbol context specifier. The hook takes ownership.
Definition Target.cpp:4449
void SetThreadSpecifier(ThreadSpec *specifier)
Set the thread specifier. The hook takes ownership.
Definition Target.cpp:4453
virtual void HandleModuleLoaded(lldb::StreamSP output)
Definition Target.h:1828
bool FiresOn(uint32_t trigger) const
Return true if this hook fires on the given trigger.
Definition Target.h:1793
std::unique_ptr< ThreadSpec > m_thread_spec_up
Definition Target.h:1852
void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.h:1730
HandleStopCallback * m_callback
Definition Target.h:1738
StopHookResult HandleStop(ExecutionContext &exc_ctx, lldb::StreamSP output) override
Definition Target.h:1725
StopHookCoded(lldb::TargetSP target_sp, lldb::user_id_t uid)
Use CreateStopHook to make a new empty stop hook.
Definition Target.h:1743
void SetCallback(llvm::StringRef name, HandleStopCallback *callback)
Definition Target.h:1720
StopHookResult(ExecutionContext &exc_ctx, lldb::StreamSP output) HandleStopCallback
Definition Target.h:1717
void SetActionFromString(const std::string &strings)
Definition Target.cpp:4285
StopHookCommandLine(lldb::TargetSP target_sp, lldb::user_id_t uid)
Definition Target.h:1684
void SetActionFromStrings(const std::vector< std::string > &strings)
Definition Target.cpp:4289
StopHookResult HandleStop(ExecutionContext &exc_ctx, lldb::StreamSP output_sp) override
Definition Target.cpp:4296
void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.cpp:4267
lldb::ScriptedHookInterfaceSP m_interface_sp
Definition Target.h:1703
StopHookResult HandleStop(ExecutionContext &exc_ctx, lldb::StreamSP output) override
Definition Target.cpp:4368
Status SetScriptCallback(const ScriptedMetadata &scripted_metadata)
Definition Target.cpp:4331
StopHookScripted(lldb::TargetSP target_sp, lldb::user_id_t uid)
Use CreateStopHook to make a new empty stop hook.
Definition Target.h:1708
void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.cpp:4396
llvm::StringRef GetScriptClassName() const
Definition Target.cpp:4390
bool GetRunAtInitialStop() const
Definition Target.h:1642
SymbolContextSpecifier * GetSpecifier()
Definition Target.h:1611
void SetSpecifier(SymbolContextSpecifier *specifier)
Definition Target.cpp:4205
virtual StopHookResult HandleStop(ExecutionContext &exe_ctx, lldb::StreamSP output)=0
std::unique_ptr< ThreadSpec > m_thread_spec_up
Definition Target.h:1657
void SetIsActive(bool is_active)
Definition Target.h:1630
void SetSuppressOutput(bool suppress_output)
Definition Target.h:1644
void SetThreadSpecifier(ThreadSpec *specifier)
Definition Target.cpp:4209
ThreadSpec * GetThreadSpecifier()
Definition Target.h:1626
StopHook(const StopHook &rhs)
Definition Target.cpp:4197
bool ExecutionContextPasses(const ExecutionContext &exe_ctx)
Definition Target.cpp:4213
lldb::TargetSP & GetTarget()
Definition Target.h:1605
void SetRunAtInitialStop(bool at_initial_stop)
Definition Target.h:1638
lldb::SymbolContextSpecifierSP m_specifier_sp
Definition Target.h:1656
virtual void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const =0
void GetDescription(Stream &s, lldb::DescriptionLevel level) const
Definition Target.cpp:4229
void SetAutoContinue(bool auto_continue)
Definition Target.h:1632
const ModuleList & GetModuleList() const
Definition Target.h:653
void Dump(Stream *s) const override
Definition Target.cpp:5981
static llvm::StringRef GetFlavorString()
Definition Target.cpp:5977
static lldb::TargetSP GetCreatedTargetFromEvent(const Event *event_ptr)
Definition Target.cpp:6010
static ModuleList GetModuleListFromEvent(const Event *event_ptr)
Definition Target.cpp:6019
static const TargetEventData * GetEventDataFromEvent(const Event *event_ptr)
Definition Target.cpp:5991
llvm::StringRef GetFlavor() const override
Definition Target.h:631
const lldb::TargetSP & GetTarget() const
Definition Target.h:647
TargetEventData(const lldb::TargetSP &target_sp)
Definition Target.cpp:5963
TargetEventData(const TargetEventData &)=delete
const lldb::TargetSP & GetCreatedTarget() const
Definition Target.h:649
const TargetEventData & operator=(const TargetEventData &)=delete
static lldb::TargetSP GetTargetFromEvent(const Event *event_ptr)
Definition Target.cpp:6001
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:1941
lldb::ThreadSP CalculateThread() override
Definition Target.cpp:2693
llvm::Expected< uint32_t > AddScriptedFrameProviderDescriptor(const ScriptedFrameProviderDescriptor &descriptor)
Add or update a scripted frame provider descriptor for this target.
Definition Target.cpp:3895
StopHookCollection m_stop_hooks
Definition Target.h:2140
Module * GetExecutableModulePointer()
Definition Target.cpp:1641
void Dump(Stream *s, lldb::DescriptionLevel description_level)
Dump a description of this object to a Stream.
Definition Target.cpp:259
void DisableAllBreakpoints(bool internal_also=false)
Definition Target.cpp:1173
bool RemoveHookByID(lldb::user_id_t uid)
Definition Target.cpp:4793
lldb::WatchpointSP CreateWatchpoint(lldb::addr_t addr, size_t size, const CompilerType *type, uint32_t kind, Status &error)
Definition Target.cpp:1055
void ApplyNameToBreakpoints(BreakpointName &bp_name)
Definition Target.cpp:932
lldb::user_id_t m_hook_next_id
Definition Target.h:2151
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:6031
lldb::TraceSP GetTrace()
Get the Trace object containing processor trace information of this target.
Definition Target.cpp:3770
PathMappingList & GetImageSearchPathList()
Definition Target.cpp:2702
void FinalizeFileActions(ProcessLaunchInfo &info)
Definition Target.cpp:3977
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:3102
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:3110
ModuleList & GetImages()
Definition Target.h:1256
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:777
static Target * GetTargetFromContexts(const ExecutionContext *exe_ctx_ptr, const SymbolContext *sc_ptr)
Definition Target.cpp:2937
lldb::addr_t GetBreakableLoadAddress(lldb::addr_t addr)
Definition Target.cpp:3117
llvm::StringMap< std::unique_ptr< BreakpointName > > BreakpointNameMap
Definition Target.h:2105
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:4137
bool SetSuppresStopHooks(bool suppress)
Definition Target.h:1960
static void ImageSearchPathsChanged(const PathMappingList &path_list, void *baton)
Definition Target.cpp:2706
llvm::Expected< lldb_private::Address > GetEntryPointAddress()
This method will return the address of the starting function for this binary, e.g.
Definition Target.cpp:3068
bool IgnoreWatchpointByID(lldb::watch_id_t watch_id, uint32_t ignore_count)
Definition Target.cpp:1609
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:743
size_t GetNumHooks() const
Definition Target.h:1940
lldb::BreakpointSP GetBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:438
std::shared_ptr< StopHook > StopHookSP
Definition Target.h:1750
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:607
void SymbolsDidLoad(ModuleList &module_list)
Definition Target.cpp:1969
bool ClearAllWatchpointHistoricValues()
Definition Target.cpp:1523
const std::vector< StopHookSP > GetStopHooks(bool internal=false) const
Definition Target.cpp:3233
void SetTrace(const lldb::TraceSP &trace_sp)
Set the Trace object containing processor trace information of this target.
Definition Target.cpp:3768
BreakpointList & GetBreakpointList(bool internal=false)
Definition Target.cpp:424
uint32_t m_next_frame_provider_id
Definition Target.h:2132
lldb_private::SummaryStatisticsCache & GetSummaryStatisticsCache()
Definition Target.cpp:3585
const llvm::MapVector< uint32_t, ScriptedFrameProviderDescriptor > & GetScriptedFrameProviderDescriptors() const
Get all scripted frame provider descriptors for this target.
Definition Target.cpp:3956
lldb::addr_t GetSectionLoadAddress(const lldb::SectionSP &section_sp)
Definition Target.cpp:6048
llvm::StringRef GetABIName() const
Returns the name of the target's ABI plugin.
Definition Target.cpp:413
SourceManager & GetSourceManager()
Definition Target.cpp:3157
lldb::SearchFilterSP GetSearchFilterForModuleList(const FileSpecList *containingModuleList)
Definition Target.cpp:706
StopHookSP GetStopHookByID(lldb::user_id_t uid)
Definition Target.cpp:3199
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:2167
lldb::user_id_t AddBreakpointResolverOverride(BreakpointResolverOverrideUP override_up)
Add a breakpoint override resolver. This version can't fail.
Definition Target.h:1058
lldb::ProcessSP m_process_sp
Definition Target.h:2120
Debugger & GetDebugger() const
Definition Target.h:1337
lldb::SearchFilterSP m_search_filter_sp
Definition Target.h:2121
PersistentExpressionState * GetPersistentExpressionStateForLanguage(lldb::LanguageType language)
Definition Target.cpp:2787
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:4125
bool m_is_dummy_target
Used to not run stop hooks for expressions.
Definition Target.h:2147
static bool UpdateSignalFromDummy(lldb::UnixSignalsSP signals_sp, const DummySignalElement &element)
Definition Target.cpp:4083
PathMappingList m_image_search_paths
Definition Target.h:2122
bool ModuleIsExcludedForUnconstrainedSearches(const FileSpec &module_spec)
Return whether this FileSpec corresponds to a module that should be considered for general searches.
Definition Target.cpp:2027
lldb::StackFrameSP CalculateStackFrame() override
Definition Target.cpp:2695
SectionLoadList & GetSectionLoadList()
Definition Target.h:2224
lldb::addr_t GetPersistentSymbol(ConstString name)
Definition Target.cpp:3048
TargetAPIMutex GetAPIMutex()
Returns a handle resolved to the mutex to serialize on before touching the target through the SB API.
Definition Target.cpp:6027
void PrimeFromDummyTarget(Target &target)
Definition Target.cpp:226
bool RemoveScriptedFrameProviderDescriptor(uint32_t id)
Remove a scripted frame provider descriptor by id.
Definition Target.cpp:3931
lldb::RegisterTypeBuilderSP m_register_type_builder_sp
Definition Target.h:2169
static void SettingsTerminate()
Definition Target.cpp:2899
bool EnableWatchpointByID(lldb::watch_id_t watch_id)
Definition Target.cpp:1574
void DeleteBreakpointName(llvm::StringRef name)
Definition Target.cpp:909
HookSP CreateHook(Hook::HookKind kind)
Definition Target.cpp:4771
bool ResolveFileAddress(lldb::addr_t load_addr, Address &so_addr)
Definition Target.cpp:3501
bool ClearAllWatchpointHitCounts()
Definition Target.cpp:1509
CompilerType GetRegisterType(const RegisterInfo &reg_info)
Definition Target.cpp:2742
size_t ReadMemoryFromFileCache(const Address &addr, void *dst, size_t dst_len, Status &error)
Definition Target.cpp:2059
void ClearAllLoadedSections()
Definition Target.cpp:3577
std::vector< lldb::TypeSystemSP > GetScratchTypeSystems(bool create_on_demand=true)
Definition Target.cpp:2750
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:2367
void AddNameToBreakpoint(BreakpointID &id, llvm::StringRef name, Status &error)
Definition Target.cpp:854
void DumpSectionLoadList(Stream &s)
Definition Target.cpp:6054
void DeleteCurrentProcess()
Definition Target.cpp:295
BreakpointList m_internal_breakpoint_list
Definition Target.h:2104
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:2398
friend class TargetAPIMutex
Definition Target.h:590
void DisableAllowedBreakpoints()
Definition Target.cpp:1183
bool SetHookEnabledStateByID(lldb::user_id_t uid, bool enabled)
Definition Target.cpp:4815
bool LoadScriptingResources(std::list< Status > &errors, bool continue_on_error=true)
Definition Target.h:1231
bool SetSectionUnloaded(const lldb::SectionSP &section_sp)
Definition Target.cpp:3555
lldb::TargetSP CalculateTarget() override
Definition Target.cpp:2689
const lldb::ProcessSP & GetProcessSP() const
Definition Target.cpp:329
void ClearModules(bool delete_locations)
Definition Target.cpp:1645
void RemoveNameFromBreakpoint(lldb::BreakpointSP &bp_sp, llvm::StringRef name)
Definition Target.cpp:919
BreakpointNameMap m_breakpoint_names
Definition Target.h:2106
bool RemoveBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:1207
llvm::MapVector< uint32_t, ScriptedFrameProviderDescriptor > m_frame_provider_descriptors
Map of scripted frame provider descriptors for this target.
Definition Target.h:2130
lldb::ModuleSP GetOrCreateModule(const ModuleSpec &module_spec, bool notify, Status *error_ptr=nullptr)
Find a binary on the system and return its Module, or return an existing Module that is already in th...
Definition Target.cpp:2450
static bool ResetSignalFromDummy(lldb::UnixSignalsSP signals_sp, const DummySignalElement &element)
Definition Target.cpp:4110
Architecture * GetArchitecturePlugin() const
Definition Target.h:1335
llvm::json::Value ReportStatistics(const lldb_private::StatisticsOptions &options)
Get metrics associated with this target in JSON format.
Definition Target.cpp:6040
friend class TargetList
Definition Target.h:588
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:2840
TargetStats & GetStatistics()
Definition Target.h:2194
void EnableAllBreakpoints(bool internal_also=false)
Definition Target.cpp:1190
Status Launch(ProcessLaunchInfo &launch_info, Stream *stream)
Definition Target.cpp:3600
bool DisableBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:1227
lldb::BreakpointSP CreateBreakpointAtUserEntry(Status &error)
Definition Target.cpp:450
std::map< lldb::user_id_t, StopHookSP > StopHookCollection
Definition Target.h:2139
llvm::Expected< lldb::TraceSP > CreateTrace()
Create a Trace object for the current target using the using the default supported tracing technology...
Definition Target.cpp:3772
lldb::TraceSP m_trace_sp
An optional lldb_private::Trace object containing processor trace information of this target.
Definition Target.h:2161
lldb::user_id_t GetGloballyUniqueID() const
Get the globally unique ID for this target.
Definition Target.h:689
bool RemoveAllWatchpoints(bool end_to_end=true)
Definition Target.cpp:1427
bool ReadPointerFromMemory(const Address &addr, Status &error, Address &pointer_addr, bool force_live_memory=false)
Definition Target.cpp:2420
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:3185
WatchpointList m_watchpoint_list
Definition Target.h:2115
BreakpointList m_breakpoint_list
Definition Target.h:2103
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:986
lldb::SourceManagerUP m_source_manager_up
Definition Target.h:2137
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:2112
bool RemoveWatchpointByID(lldb::watch_id_t watch_id)
Definition Target.cpp:1593
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, uint32_t stop_id=SectionLoadHistory::eStopIDNow, bool allow_section_end=false)
Definition Target.cpp:3495
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:2318
HookSP GetHookByID(lldb::user_id_t uid)
Definition Target.cpp:4800
void NotifyWillClearList(const ModuleList &module_list) override
Definition Target.cpp:1903
bool SetArchitecture(const ArchSpec &arch_spec, bool set_platform=false, bool merge=true)
Set the architecture for this target.
Definition Target.cpp:1787
void ClearBreakpointResolverOverrides()
Definition Target.h:1076
bool RemoveBreakpointResolverOverride(lldb::user_id_t override_id)
Definition Target.h:1071
void NotifyModuleAdded(const ModuleList &module_list, const lldb::ModuleSP &module_sp) override
Implementing of ModuleList::Notifier.
Definition Target.cpp:1905
llvm::Expected< lldb::TypeSystemSP > GetScratchTypeSystemForLanguage(lldb::LanguageType language, bool create_on_demand=true)
Definition Target.cpp:2715
void ConfigureBreakpointName(BreakpointName &bp_name, const BreakpointOptions &options, const BreakpointName::Permissions &permissions)
Definition Target.cpp:924
lldb_private::SummaryStatisticsSP GetSummaryStatisticsSPForProviderName(lldb_private::TypeSummaryImpl &summary_provider)
Definition Target.cpp:3579
lldb::SearchFilterSP GetSearchFilterForModuleAndCUList(const FileSpecList *containingModules, const FileSpecList *containingSourceFiles)
Definition Target.cpp:723
lldb::ModuleSP GetExecutableModule()
Gets the module for the main executable.
Definition Target.cpp:1625
bool SetStopHookActiveStateByID(lldb::user_id_t uid, bool active_state)
Definition Target.cpp:3209
const lldb::ProcessSP & CreateProcess(lldb::ListenerSP listener_sp, llvm::StringRef plugin_name, const FileSpec *crash_file, bool can_connect)
Definition Target.cpp:317
void SetAllStopHooksActiveState(bool active_state)
Definition Target.cpp:3220
std::vector< StopHookSP > m_internal_stop_hooks
Definition Target.h:2142
lldb::ExpressionVariableSP GetPersistentVariable(ConstString name)
Definition Target.cpp:3029
void NotifyModulesRemoved(lldb_private::ModuleList &module_list) override
Definition Target.cpp:1937
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:3163
size_t ReadCStringFromMemory(const Address &addr, std::string &out_str, Status &error, bool force_live_memory=false)
Definition Target.cpp:2228
void SetAllHooksEnabledState(bool enabled)
Definition Target.cpp:4823
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:2089
std::recursive_mutex m_frame_provider_descriptors_mutex
Definition Target.h:2131
lldb::user_id_t m_target_unique_id
The globally unique ID assigned to this target.
Definition Target.h:2153
void ModulesDidUnload(ModuleList &module_list, bool delete_locations)
Definition Target.cpp:1985
void CalculateExecutionContext(ExecutionContext &exe_ctx) override
Reconstruct the object's execution context into sc.
Definition Target.cpp:2697
llvm::Expected< lldb::DisassemblerSP > ReadInstructions(const Address &start_addr, uint32_t count, const char *flavor_string=nullptr)
Definition Target.cpp:3123
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:3797
void NotifyModuleUpdated(const ModuleList &module_list, const lldb::ModuleSP &old_module_sp, const lldb::ModuleSP &new_module_sp) override
Definition Target.cpp:1925
SummaryStatisticsCache m_summary_statistics_cache
Definition Target.h:2101
Target(const Target &)=delete
void RegisterInternalStopHooks()
Status SerializeBreakpointsToFile(const FileSpec &file, const BreakpointIDList &bp_ids, bool append)
Definition Target.cpp:1268
void DidExec()
Called as the last function in Process::DidExec().
Definition Target.cpp:1652
void SaveScriptedLaunchInfo(lldb_private::ProcessInfo &process_info)
Definition Target.cpp:3589
bool GetSuppressStopHooks()
Definition Target.h:1966
std::string m_label
Definition Target.h:2098
lldb::user_id_t m_stop_hook_next_id
Definition Target.h:2141
static FileSpecList GetDefaultExecutableSearchPaths()
Definition Target.cpp:2901
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:760
void NotifyBreakpointChanged(Breakpoint &bp, lldb::BreakpointEventType event_kind)
Sends a breakpoint notification event.
Definition Target.cpp:6058
lldb::SearchFilterSP GetSearchFilterForModule(const FileSpec *containingModule)
Definition Target.cpp:688
llvm::StringMapEntry< DummySignalValues > DummySignalElement
Definition Target.h:2028
static llvm::StringRef GetStaticBroadcasterClass()
Definition Target.cpp:176
static FileSpecList GetDefaultDebugFileSearchPaths()
Definition Target.cpp:2905
void EnableAllowedBreakpoints()
Definition Target.cpp:1200
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:2092
llvm::Error SetLabel(llvm::StringRef label)
Set a label for a target.
Definition Target.cpp:2920
uint32_t m_latest_stop_hook_id
Definition Target.h:2143
void RunModuleHooks(bool is_load)
Definition Target.cpp:4828
std::map< lldb::user_id_t, BreakpointResolverOverrideUP > m_breakpoint_overrides
Definition Target.h:2109
StackFrameRecognizerManager & GetFrameRecognizerManager()
Definition Target.h:2004
void RemoveAllowedBreakpoints()
Definition Target.cpp:1152
bool DisableAllWatchpoints(bool end_to_end=true)
Definition Target.cpp:1456
bool RunStopHooks(bool at_initial_stop=false)
Definition Target.cpp:3244
void ClearSectionLoadList()
Definition Target.cpp:6052
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:2305
lldb::PlatformSP m_platform_sp
The platform for this target.
Definition Target.h:2088
void UndoCreateHook(lldb::user_id_t uid)
Removes the most recently created hook.
Definition Target.cpp:4786
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:2870
FileSpecList GetSafeAutoLoadPaths() const
Get the list of paths that LLDB will consider automatically loading scripting resources from.
Definition Target.cpp:6074
static TargetProperties & GetGlobalProperties()
Definition Target.cpp:3459
Status Install(ProcessLaunchInfo *launch_info)
Definition Target.cpp:3467
HookSP GetHookAtIndex(size_t index)
Definition Target.cpp:4807
lldb::PlatformSP GetPlatform()
Definition Target.h:1980
void NotifyModuleRemoved(const ModuleList &module_list, const lldb::ModuleSP &module_sp) override
Definition Target.cpp:1915
lldb::BreakpointSP CreateAddressInModuleBreakpoint(lldb::addr_t file_addr, bool internal, const FileSpec &file_spec, bool request_hardware)
Definition Target.cpp:594
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:505
void RemoveAllBreakpoints(bool internal_also=false)
Definition Target.cpp:1161
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:488
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:2909
void ResetBreakpointHitCounts()
Resets the hit count of all breakpoints.
Definition Target.cpp:1264
std::unique_ptr< BreakpointResolverOverride > BreakpointResolverOverrideUP
Definition Target.h:1030
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition Target.h:1254
const ArchSpec & GetArchitecture() const
Definition Target.h:1296
WatchpointList & GetWatchpointList()
Definition Target.h:966
@ eBroadcastBitWatchpointChanged
Definition Target.h:597
@ eBroadcastBitBreakpointChanged
Definition Target.h:594
@ eBroadcastBitNewTargetCreated
Definition Target.h:600
unsigned m_next_persistent_variable_index
Definition Target.h:2152
bool EnableBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:1245
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:2409
void InvalidateThreadFrameProviders()
Invalidate all potentially cached frame providers for all threads and trigger a stack changed event f...
Definition Target.cpp:3962
TargetStats m_stats
Definition Target.h:2177
bool IgnoreAllWatchpoints(uint32_t ignore_count)
Definition Target.cpp:1538
void AddBreakpoint(lldb::BreakpointSP breakpoint_sp, bool internal)
Definition Target.cpp:831
std::string m_target_session_name
The target session name for this target, used to name debugging sessions in DAP.
Definition Target.h:2156
TypeSystemMap m_scratch_type_system_map
Definition Target.h:2123
void AddBreakpointName(std::unique_ptr< BreakpointName > bp_name)
Definition Target.cpp:881
void SetTargetSessionName(llvm::StringRef target_session_name)
Set the target session name for this target.
Definition Target.h:722
SectionLoadHistory m_section_load_history
Definition Target.h:2102
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:1024
void GetBreakpointNames(std::vector< std::string > &names)
Definition Target.cpp:946
bool IsDummyTarget() const
Definition Target.h:678
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:181
size_t UnloadModuleSections(const lldb::ModuleSP &module_sp)
Definition Target.cpp:3536
llvm::StringRef GetTargetSessionName()
Get the target session name for this target.
Definition Target.h:710
const std::string & GetLabel() const
Definition Target.h:691
std::map< lldb::user_id_t, HookSP > HookCollection
Definition Target.h:2149
bool m_valid
This records the last natural stop at which we ran a stop-hook.
Definition Target.h:2145
bool DisableWatchpointByID(lldb::watch_id_t watch_id)
Definition Target.cpp:1555
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:4068
void ClearScriptedFrameProviderDescriptors()
Clear all scripted frame provider descriptors for this target.
Definition Target.cpp:3944
lldb::WatchpointSP m_last_created_watchpoint
Definition Target.h:2116
Status CreateBreakpointsFromFile(const FileSpec &file, BreakpointIDList &new_bps)
Definition Target.cpp:1360
Debugger & m_debugger
Definition Target.h:2087
void SetREPL(lldb::LanguageType language, lldb::REPLSP repl_sp)
Definition Target.cpp:382
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)
void SetExecutableModule(lldb::ModuleSP &module_sp, LoadDependentFiles load_dependent_files=eLoadDependentsDefault)
Set the main executable module.
Definition Target.cpp:1658
lldb::StackFrameRecognizerManagerUP m_frame_recognizer_manager_up
Stores the frame recognizers of this target.
Definition Target.h:2163
HookCollection m_hooks
Definition Target.h:2150
lldb::REPLSP GetREPL(Status &err, lldb::LanguageType language, const char *repl_options, bool can_create)
Definition Target.cpp:331
std::shared_ptr< Hook > HookSP
Definition Target.h:1921
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:2807
ModuleList m_images
The list of images for this process (shared libraries and anything dynamically loaded).
Definition Target.h:2099
lldb::ProcessSP CalculateProcess() override
Definition Target.cpp:2691
void PrintDummySignals(Stream &strm, Args &signals)
Print all the signals set in this target.
Definition Target.cpp:4162
void SetPlatform(const lldb::PlatformSP &platform_sp)
Definition Target.h:1982
bool SetSectionLoadAddress(const lldb::SectionSP &section, lldb::addr_t load_addr, bool warn_multiple=false)
Definition Target.cpp:3506
BreakpointName * FindBreakpointName(llvm::StringRef name, bool can_create, Status &error)
Definition Target.cpp:886
Status Attach(ProcessAttachInfo &attach_info, Stream *stream)
Definition Target.cpp:3803
std::map< lldb::LanguageType, lldb::REPLSP > REPLMap
Definition Target.h:2134
static void SetDefaultArchitecture(const ArchSpec &arch)
Definition Target.cpp:2913
lldb::BreakpointSP m_last_created_breakpoint
Definition Target.h:2114
lldb::WatchpointSP GetLastCreatedWatchpoint()
Definition Target.h:962
bool RemoveStopHookByID(lldb::user_id_t uid)
Definition Target.cpp:3192
friend class Debugger
Definition Target.h:589
lldb::BreakpointSP GetLastCreatedBreakpoint()
Definition Target.h:854
static void SettingsInitialize()
Definition Target.cpp:2897
~Target() override
Definition Target.cpp:220
bool EnableAllWatchpoints(bool end_to_end=true)
Definition Target.cpp:1483
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:2096
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:2951
bool MergeArchitecture(const ArchSpec &arch_spec)
Definition Target.cpp:1878
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:61
@ eLoadScriptFromSymFileTrue
Definition Target.h:62
@ eLoadScriptFromSymFileTrusted
Definition Target.h:65
@ eLoadScriptFromSymFileFalse
Definition Target.h:63
@ eLoadScriptFromSymFileWarn
Definition Target.h:64
@ eJITEngineMCJIT
Definition Target.h:87
@ eJITEngineORC
Definition Target.h:87
ExecutionPolicy
Expression execution policies.
DynamicClassInfoHelper
Definition Target.h:80
@ eDynamicClassInfoHelperCopyRealizedClassList
Definition Target.h:83
@ eDynamicClassInfoHelperGetRealizedClassList
Definition Target.h:84
@ eDynamicClassInfoHelperAuto
Definition Target.h:81
@ eDynamicClassInfoHelperRealizedClassesStruct
Definition Target.h:82
OptionEnumValues GetDynamicValueTypes()
Definition Target.cpp:4876
@ eImportStdModuleFalse
Definition Target.h:75
@ eImportStdModuleFallback
Definition Target.h:76
@ eImportStdModuleTrue
Definition Target.h:77
LoadCWDlldbinitFile
Definition Target.h:68
@ eLoadCWDlldbinitTrue
Definition Target.h:69
@ eLoadCWDlldbinitFalse
Definition Target.h:70
@ eLoadCWDlldbinitWarn
Definition Target.h:71
llvm::ArrayRef< OptionEnumValueElement > OptionEnumValues
@ eInlineBreakpointsNever
Definition Target.h:56
@ eInlineBreakpointsAlways
Definition Target.h:58
@ eInlineBreakpointsHeaders
Definition Target.h:57
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::shared_ptr< lldb_private::Thread > ThreadSP
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:2024
UserID(lldb::user_id_t uid=LLDB_INVALID_UID)
Construct with optional user ID.
Definition UserID.h:33