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
284 bool GetUseDILForCreatingValues() const;
285
286 void SetUseDILForCreatingValues(bool b);
287
289
291
292 bool GetAutoInstallMainExecutable() const;
293
295
296 void SetDebugUtilityExpression(bool debug);
297
298 bool GetDebugUtilityExpression() const;
299
300 void SetCheckValueObjectOwnership(bool check);
301
302 bool GetCheckValueObjectOwnership() const;
303
304 std::optional<LoadScriptFromSymFile>
305 GetAutoLoadScriptsForModule(llvm::StringRef module_name) const;
306
307 /// Set the \c LoadScriptFromSymFile for a module called \c module_name
308 /// (excluding file extension). LLDB will prefer this over the target-wide
309 /// target.load-script-from-symbol-file setting
310 /// (see \c SetLoadScriptFromSymbolFile).
311 void SetAutoLoadScriptsForModule(llvm::StringRef module_name,
312 LoadScriptFromSymFile load_style);
313
314private:
315 std::optional<bool>
316 GetExperimentalPropertyValue(size_t prop_idx,
317 ExecutionContext *exe_ctx = nullptr) const;
318
319 // Callbacks for m_launch_info.
330
331 // Settings checker for target.jit-save-objects-dir:
332 void CheckJITObjectsDir();
333
335
336 // Member variables.
338 std::unique_ptr<TargetExperimentalProperties> m_experimental_properties_up;
340};
341
343public:
345
346// MSVC has a bug here that reports C4268: 'const' static/global data
347// initialized with compiler generated default constructor fills the object
348// with zeros. Confirmed that MSVC is *not* zero-initializing, it's just a
349// bogus warning.
350#if defined(_MSC_VER)
351#pragma warning(push)
352#pragma warning(disable : 4268)
353#endif
354 static constexpr std::chrono::milliseconds default_timeout{500};
355#if defined(_MSC_VER)
356#pragma warning(pop)
357#endif
358
361
363
367
369
370 void SetLanguage(lldb::LanguageType language_type) {
371 m_language = SourceLanguage(language_type);
372 }
373
375 m_preferred_lookup_contexts = std::move(contexts);
376 }
377
381
382 /// Set the language using a pair of language code and version as
383 /// defined by the DWARF 6 specification.
384 /// WARNING: These codes may change until DWARF 6 is finalized.
385 void SetLanguage(uint16_t name, uint32_t version) {
386 m_language = SourceLanguage(name, version);
387 }
388
389 bool DoesCoerceToId() const { return m_coerce_to_id; }
390
391 const char *GetPrefix() const {
392 return (m_prefix.empty() ? nullptr : m_prefix.c_str());
393 }
394
395 void SetPrefix(const char *prefix) {
396 if (prefix && prefix[0])
397 m_prefix = prefix;
398 else
399 m_prefix.clear();
400 }
401
402 void SetCoerceToId(bool coerce = true) { m_coerce_to_id = coerce; }
403
404 bool DoesUnwindOnError() const { return m_unwind_on_error; }
405
406 void SetUnwindOnError(bool unwind = false) { m_unwind_on_error = unwind; }
407
409
410 void SetIgnoreBreakpoints(bool ignore = false) {
411 m_ignore_breakpoints = ignore;
412 }
413
414 bool DoesKeepInMemory() const { return m_keep_in_memory; }
415
416 void SetKeepInMemory(bool keep = true) { m_keep_in_memory = keep; }
417
419
420 void
424
425 const Timeout<std::micro> &GetTimeout() const { return m_timeout; }
426
427 void SetTimeout(const Timeout<std::micro> &timeout) { m_timeout = timeout; }
428
432
434 m_one_thread_timeout = timeout;
435 }
436
437 bool GetTryAllThreads() const { return m_try_others; }
438
439 void SetTryAllThreads(bool try_others = true) { m_try_others = try_others; }
440
441 bool GetStopOthers() const { return m_stop_others; }
442
443 void SetStopOthers(bool stop_others = true) { m_stop_others = stop_others; }
444
445 bool GetDebug() const { return m_debug; }
446
447 void SetDebug(bool b) {
448 m_debug = b;
449 if (m_debug)
451 }
452
454
456
457 bool GetColorizeErrors() const { return m_ansi_color_errors; }
458
460
461 bool GetTrapExceptions() const { return m_trap_exceptions; }
462
464
465 bool GetStopOnFork() const { return m_stop_on_fork; }
466
467 void SetStopOnFork(bool b) { m_stop_on_fork = b; }
468
469 bool GetREPLEnabled() const { return m_repl; }
470
471 void SetREPLEnabled(bool b) { m_repl = b; }
472
475 m_cancel_callback = callback;
476 }
477
479 return ((m_cancel_callback != nullptr)
481 : false);
482 }
483
484 // Allows the expression contents to be remapped to point to the specified
485 // file and line using #line directives.
486 void SetPoundLine(const char *path, uint32_t line) const {
487 if (path && path[0]) {
488 m_pound_line_file = path;
489 m_pound_line_line = line;
490 } else {
491 m_pound_line_file.clear();
493 }
494 }
495
496 const char *GetPoundLineFilePath() const {
497 return (m_pound_line_file.empty() ? nullptr : m_pound_line_file.c_str());
498 }
499
500 uint32_t GetPoundLineLine() const { return m_pound_line_line; }
501
503
507
509
511
512 void SetRetriesWithFixIts(uint64_t number_of_retries) {
513 m_retries_with_fixits = number_of_retries;
514 }
515
516 uint64_t GetRetriesWithFixIts() const { return m_retries_with_fixits; }
517
519
521
522 /// Set language-plugin specific option called \c option_name to
523 /// the specified boolean \c value.
524 llvm::Error SetBooleanLanguageOption(llvm::StringRef option_name, bool value);
525
526 /// Get the language-plugin specific boolean option called \c option_name.
527 ///
528 /// If the option doesn't exist or is not a boolean option, returns false.
529 /// Otherwise returns the boolean value of the option.
530 llvm::Expected<bool>
531 GetBooleanLanguageOption(llvm::StringRef option_name) const;
532
533 void SetCppIgnoreContextQualifiers(bool value);
534
536
537 void SetTryDILFirst(bool b) { m_try_DIL_first = b; }
538
539 bool GetTryDILFirst() const { return m_try_DIL_first; }
540
541private:
543
545
548 std::string m_prefix;
549 bool m_coerce_to_id = false;
550 bool m_unwind_on_error = true;
552 bool m_keep_in_memory = false;
553 bool m_try_others = true;
554 bool m_stop_others = true;
555 bool m_debug = false;
556 bool m_trap_exceptions = true;
557 bool m_stop_on_fork = false;
558 bool m_repl = false;
564 /// True if the executed code should be treated as utility code that is only
565 /// used by LLDB internally.
567 /// If enabled, Data Inspection Language (DIL) should attempt to evaluate the
568 /// expression first. If DIL is not called or fails, the evaluation falls
569 /// back to UserExpression.
570 bool m_try_DIL_first = false;
571
576 void *m_cancel_callback_baton = nullptr;
577 // If m_pound_line_file is not empty and m_pound_line_line is non-zero, use
578 // #line %u "%s" before the expression content to remap where the source
579 // originates
580 mutable std::string m_pound_line_file;
581 mutable uint32_t m_pound_line_line = 0;
582
583 /// Dictionary mapping names of language-plugin specific options
584 /// to values.
586
587 /// During expression evaluation, any SymbolContext in this list will be
588 /// used for symbol/function lookup before any other context (except for
589 /// the module corresponding to the current frame).
591};
592
593// Target
594class Target : public std::enable_shared_from_this<Target>,
595 public TargetProperties,
596 public Broadcaster,
598 public ModuleList::Notifier {
599public:
600 friend class TargetList;
601 friend class Debugger;
602 friend class TargetAPIMutex;
603
604 /// Broadcaster event bits definitions.
605 enum {
613 };
614
615 // These two functions fill out the Broadcaster interface:
616
617 static llvm::StringRef GetStaticBroadcasterClass();
618
619 llvm::StringRef GetBroadcasterClass() const override {
621 }
622
623 // This event data class is for use by the TargetList to broadcast new target
624 // notifications.
625 class TargetEventData : public EventData {
626 public:
627 TargetEventData(const lldb::TargetSP &target_sp);
628
629 TargetEventData(const lldb::TargetSP &target_sp,
630 const ModuleList &module_list);
631
632 // Constructor for eBroadcastBitNewTargetCreated events. For this event
633 // type:
634 // - target_sp is the parent target (the subject/broadcaster of the event)
635 // - created_target_sp is the newly created target
636 TargetEventData(const lldb::TargetSP &target_sp,
637 const lldb::TargetSP &created_target_sp);
638
640
641 static llvm::StringRef GetFlavorString();
642
643 llvm::StringRef GetFlavor() const override {
645 }
646
647 void Dump(Stream *s) const override;
648
649 static const TargetEventData *GetEventDataFromEvent(const Event *event_ptr);
650
651 static lldb::TargetSP GetTargetFromEvent(const Event *event_ptr);
652
653 // For eBroadcastBitNewTargetCreated events, returns the newly created
654 // target. For other event types, returns an invalid target.
655 static lldb::TargetSP GetCreatedTargetFromEvent(const Event *event_ptr);
656
657 static ModuleList GetModuleListFromEvent(const Event *event_ptr);
658
659 const lldb::TargetSP &GetTarget() const { return m_target_sp; }
660
662 return m_created_target_sp;
663 }
664
665 const ModuleList &GetModuleList() const { return m_module_list; }
666
667 private:
671
673 const TargetEventData &operator=(const TargetEventData &) = delete;
674 };
675
676 ~Target() override;
677
678 static void SettingsInitialize();
679
680 static void SettingsTerminate();
681
683
685
687
688 static void SetDefaultArchitecture(const ArchSpec &arch);
689
690 bool IsDummyTarget() const { return m_is_dummy_target; }
691
692 /// Get the globally unique ID for this target.
693 ///
694 /// This ID is unique across all debugger instances and all targets,
695 /// within the same lldb process. The ID is assigned
696 /// during target construction and remains constant for the target's lifetime.
697 /// The first target created (typically the dummy target) gets ID 1.
698 ///
699 /// \return
700 /// The globally unique ID for this target.
702
703 const std::string &GetLabel() const { return m_label; }
704
705 /// Set a label for a target.
706 ///
707 /// The label cannot be used by another target or be only integral.
708 ///
709 /// \return
710 /// The label for this target or an error if the label didn't match the
711 /// requirements.
712 llvm::Error SetLabel(llvm::StringRef label);
713
714 /// Get the target session name for this target.
715 ///
716 /// Provides a meaningful name for IDEs or tools to display for dynamically
717 /// created targets. Defaults to "Session {ID}" based on the globally unique
718 /// ID.
719 ///
720 /// \return
721 /// The target session name for this target.
722 llvm::StringRef GetTargetSessionName() { return m_target_session_name; }
723
724 /// Set the target session name for this target.
725 ///
726 /// This should typically be set along with the event
727 /// eBroadcastBitNewTargetCreated. Useful for scripts or triggers that
728 /// automatically create targets and want to provide meaningful names that
729 /// IDEs or other tools can display to help users identify the origin and
730 /// purpose of each target.
731 ///
732 /// \param[in] target_session_name
733 /// The target session name to set for this target.
734 void SetTargetSessionName(llvm::StringRef target_session_name) {
735 m_target_session_name = target_session_name.str();
736 }
737
738 /// Find a binary on the system and return its Module,
739 /// or return an existing Module that is already in the Target.
740 ///
741 /// Given a ModuleSpec, find a binary satisifying that specification,
742 /// or identify a matching Module already present in the Target,
743 /// and return a shared pointer to it.
744 ///
745 /// Note that this function previously also preloaded the module's symbols
746 /// depending on a setting. This function no longer does any module
747 /// preloading because that can potentially cause deadlocks when called in
748 /// parallel with this function.
749 ///
750 /// \param[in] module_spec
751 /// The criteria that must be matched for the binary being loaded.
752 /// e.g. UUID, architecture, file path.
753 ///
754 /// \param[in] notify
755 /// If notify is true, and the Module is new to this Target,
756 /// Target::ModulesDidLoad will be called. See note in
757 /// Target::ModulesDidLoad about thread-safety with
758 /// Target::GetOrCreateModule.
759 /// If notify is false, it is assumed that the caller is adding
760 /// multiple Modules and will call ModulesDidLoad with the
761 /// full list at the end.
762 /// ModulesDidLoad must be called when a Module/Modules have
763 /// been added to the target, one way or the other.
764 ///
765 /// \param[out] error_ptr
766 /// Optional argument, pointing to a Status object to fill in
767 /// with any results / messages while attempting to find/load
768 /// this binary. Many callers will be internal functions that
769 /// will handle / summarize the failures in a custom way and
770 /// don't use these messages.
771 ///
772 /// \return
773 /// An empty ModuleSP will be returned if no matching file
774 /// was found. If error_ptr was non-nullptr, an error message
775 /// will likely be provided.
776 lldb::ModuleSP GetOrCreateModule(const ModuleSpec &module_spec, bool notify,
777 Status *error_ptr = nullptr);
778
779 // Settings accessors
780
782
783 /// Returns a handle resolved to the mutex to serialize on before
784 /// touching the target through the SB API. The handle isn't locked yet;
785 /// lock()/try_lock() it (typically via std::lock_guard<TargetAPIMutex>/
786 /// std::unique_lock<TargetAPIMutex>) to actually acquire it.
788
790
791 void CleanupProcess();
792
793 /// Dump a description of this object to a Stream.
794 ///
795 /// Dump a description of the contents of this object to the
796 /// supplied stream \a s. The dumped content will be only what has
797 /// been loaded or parsed up to this point at which this function
798 /// is called, so this is a good way to see what has been parsed
799 /// in a target.
800 ///
801 /// \param[in] s
802 /// The stream to which to dump the object description.
803 void Dump(Stream *s, lldb::DescriptionLevel description_level);
804
805 // If listener_sp is null, the listener of the owning Debugger object will be
806 // used.
808 llvm::StringRef plugin_name,
809 const FileSpec *crash_file,
810 bool can_connect);
811
812 const lldb::ProcessSP &GetProcessSP() const;
813
814 bool IsValid() { return m_valid; }
815
816 void Destroy();
817
818 Status Launch(ProcessLaunchInfo &launch_info,
819 Stream *stream); // Optional stream to receive first stop info
820
821 Status Attach(ProcessAttachInfo &attach_info,
822 Stream *stream); // Optional stream to receive first stop info
823
824 /// Add or update a scripted frame provider descriptor for this target.
825 /// All new threads in this target will check if they match any descriptors
826 /// to create their frame providers.
827 ///
828 /// \param[in] descriptor
829 /// The descriptor to add or update.
830 ///
831 /// \return
832 /// The descriptor identifier if the registration succeeded, otherwise an
833 /// llvm::Error.
834 llvm::Expected<uint32_t> AddScriptedFrameProviderDescriptor(
835 const ScriptedFrameProviderDescriptor &descriptor);
836
837 /// Remove a scripted frame provider descriptor by id.
838 ///
839 /// \param[in] id
840 /// The id of the descriptor to remove.
841 ///
842 /// \return
843 /// True if a descriptor was removed, false if no descriptor with that
844 /// id existed.
846
847 /// Clear all scripted frame provider descriptors for this target.
849
850 /// Get all scripted frame provider descriptors for this target.
851 const llvm::MapVector<uint32_t, ScriptedFrameProviderDescriptor> &
853
854protected:
855 /// Invalidate all potentially cached frame providers for all threads
856 /// and trigger a stack changed event for all threads.
858
859public:
860 // This part handles the breakpoints.
861
862 BreakpointList &GetBreakpointList(bool internal = false);
863
864 const BreakpointList &GetBreakpointList(bool internal = false) const;
865
869
871
873
874 // Use this to create a file and line breakpoint to a given module or all
875 // module it is nullptr
876 lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules,
877 const FileSpec &file, uint32_t line_no,
878 uint32_t column, lldb::addr_t offset,
879 LazyBool check_inlines,
880 LazyBool skip_prologue, bool internal,
881 bool request_hardware,
882 LazyBool move_to_nearest_code);
883
884 // Use this to create breakpoint that matches regex against the source lines
885 // in files given in source_file_list: If function_names is non-empty, also
886 // filter by function after the matches are made.
888 const FileSpecList *containingModules,
889 const FileSpecList *source_file_list,
890 const std::unordered_set<std::string> &function_names,
891 RegularExpression source_regex, bool internal, bool request_hardware,
892 LazyBool move_to_nearest_code);
893
894 // Use this to create a breakpoint from a load address
895 lldb::BreakpointSP CreateBreakpoint(lldb::addr_t load_addr, bool internal,
896 bool request_hardware);
897
898 // Use this to create a breakpoint from a file address and a module file spec
900 bool internal,
901 const FileSpec &file_spec,
902 bool request_hardware);
903
904 // Use this to create Address breakpoints:
905 lldb::BreakpointSP CreateBreakpoint(const Address &addr, bool internal,
906 bool request_hardware);
907
908 // Use this to create a function breakpoint by regexp in
909 // containingModule/containingSourceFiles, or all modules if it is nullptr
910 // When "skip_prologue is set to eLazyBoolCalculate, we use the current
911 // target setting, else we use the values passed in
913 const FileSpecList *containingModules,
914 const FileSpecList *containingSourceFiles, RegularExpression func_regexp,
915 lldb::LanguageType requested_language, LazyBool skip_prologue,
916 bool internal, bool request_hardware);
917
918 // Use this to create a function breakpoint by name in containingModule, or
919 // all modules if it is nullptr When "skip_prologue is set to
920 // eLazyBoolCalculate, we use the current target setting, else we use the
921 // values passed in. func_name_type_mask is or'ed values from the
922 // FunctionNameType enum.
924 const FileSpecList *containingModules,
925 const FileSpecList *containingSourceFiles, const char *func_name,
926 lldb::FunctionNameType func_name_type_mask, lldb::LanguageType language,
927 lldb::addr_t offset, bool offset_is_insn_count, LazyBool skip_prologue,
928 bool internal, bool request_hardware);
929
931 CreateExceptionBreakpoint(enum lldb::LanguageType language, bool catch_bp,
932 bool throw_bp, bool internal,
933 Args *additional_args = nullptr,
934 Status *additional_args_error = nullptr);
935
937 const llvm::StringRef class_name, const FileSpecList *containingModules,
938 const FileSpecList *containingSourceFiles, bool internal,
939 bool request_hardware, StructuredData::ObjectSP extra_args_sp,
940 Status *creation_error = nullptr);
941
942 // This is the same as the func_name breakpoint except that you can specify a
943 // vector of names. This is cheaper than a regular expression breakpoint in
944 // the case where you just want to set a breakpoint on a set of names you
945 // already know. func_name_type_mask is or'ed values from the
946 // FunctionNameType enum.
948 const FileSpecList *containingModules,
949 const FileSpecList *containingSourceFiles, const char *func_names[],
950 size_t num_names, lldb::FunctionNameType func_name_type_mask,
951 lldb::LanguageType language, lldb::addr_t offset, LazyBool skip_prologue,
952 bool internal, bool request_hardware);
953
955 CreateBreakpoint(const FileSpecList *containingModules,
956 const FileSpecList *containingSourceFiles,
957 const std::vector<std::string> &func_names,
958 lldb::FunctionNameType func_name_type_mask,
959 lldb::LanguageType language, lldb::addr_t m_offset,
960 LazyBool skip_prologue, bool internal,
961 bool request_hardware);
962
963 // Use this to create a general breakpoint:
965 lldb::BreakpointResolverSP &resolver_sp,
966 bool internal, bool request_hardware,
967 bool resolve_indirect_symbols);
968
969 // Use this to create a watchpoint:
971 const CompilerType *type, uint32_t kind,
972 Status &error);
973
977
979
980 // Manages breakpoint names:
981 void AddNameToBreakpoint(BreakpointID &id, llvm::StringRef name,
982 Status &error);
983
984 void AddNameToBreakpoint(lldb::BreakpointSP &bp_sp, llvm::StringRef name,
985 Status &error);
986
988 llvm::StringRef name);
989
990 BreakpointName *FindBreakpointName(llvm::StringRef name, bool can_create,
991 Status &error);
992
993 void DeleteBreakpointName(llvm::StringRef name);
994
996 const BreakpointOptions &options,
997 const BreakpointName::Permissions &permissions);
999
1000 void AddBreakpointName(std::unique_ptr<BreakpointName> bp_name);
1001
1002 void GetBreakpointNames(std::vector<std::string> &names);
1003
1004 // This call removes ALL breakpoints regardless of permission.
1005 void RemoveAllBreakpoints(bool internal_also = false);
1006
1007 // This removes all the breakpoints, but obeys the ePermDelete on them.
1009
1010 void DisableAllBreakpoints(bool internal_also = false);
1011
1013
1014 void EnableAllBreakpoints(bool internal_also = false);
1015
1017
1019
1021
1023
1024 /// Resets the hit count of all breakpoints.
1026
1027 // This callout implements the "Resolver Override". When we have determined
1028 // the Resolver for a given breakpoint, we pass each of the registered
1029 // overrides the "natural" resolver, and then we will use whatever resolver
1030 // we get back from it if it is non-null.
1031 // We keep a list of overrides ordered by ID - and we search through the list
1032 // by ID order, and the first override that returns a non-null Resolver will
1033 // be the one we use. If no overrides return an override resolver, we'll use
1034 // the original one.
1035
1036 /// This is the abstract version of the override. Particular implementations,
1037 /// e.g. the scripted override resolver, instantiate actual versions of the
1038 /// class. The constructor takes the target this resolver is registered in, a
1039 /// description for the override and a mask of the resolver types this
1040 /// overrides, made of elements of the BreakpointResolverType enum.
1041 class BreakpointResolverOverride;
1043 std::unique_ptr<BreakpointResolverOverride>;
1044
1046 public:
1047 BreakpointResolverOverride(Target &target, const std::string &description,
1048 uint64_t type_mask)
1049 : m_target(target), m_desc(description), m_type_mask(type_mask) {}
1050
1052
1056 // Return whether constructing this resolver was successful.
1057 virtual llvm::Error Validate() = 0;
1058 const std::string &GetDescription() { return m_desc; }
1059 uint64_t GetTypeMask() { return m_type_mask; }
1060 std::string DescribeTypeMask();
1061
1062 protected:
1064 std::string m_desc;
1065 uint64_t m_type_mask = 0;
1066 };
1067
1068 /// Add a breakpoint override resolver. This version can't fail.
1072 m_breakpoint_overrides.emplace(m_override_id, std::move(override_up));
1073 m_override_id++;
1074 return id_used;
1075 }
1076
1077 /// Add a breakpoint override resolver. Return the ID or an error:
1078 llvm::Expected<lldb::user_id_t>
1079 AddBreakpointResolverOverride(llvm::StringRef class_name, uint64_t type_mask,
1080 StructuredData::DictionarySP args_data_sp,
1081 llvm::StringRef description);
1082
1084 size_t removed = m_breakpoint_overrides.erase(override_id);
1085 return removed == 1;
1086 }
1087
1089
1092
1093 /// Describe the breakpoint overrides. If ixds is empty, list all. Otherwise
1094 /// list the overrides whose ids match the ones given in idxs. The matched
1095 /// elements are removed from the list, so any elements remaining in idxs are
1096 /// indexes that are not breakpoint override indexes.
1098 std::vector<lldb::user_id_t> &idxs,
1099 uint32_t terminal_width, bool use_color);
1100
1101 // The flag 'end_to_end', default to true, signifies that the operation is
1102 // performed end to end, for both the debugger and the debuggee.
1103
1104 bool RemoveAllWatchpoints(bool end_to_end = true);
1105
1106 bool DisableAllWatchpoints(bool end_to_end = true);
1107
1108 bool EnableAllWatchpoints(bool end_to_end = true);
1109
1111
1113
1114 bool IgnoreAllWatchpoints(uint32_t ignore_count);
1115
1117
1119
1121
1122 bool IgnoreWatchpointByID(lldb::watch_id_t watch_id, uint32_t ignore_count);
1123
1125 const BreakpointIDList &bp_ids,
1126 bool append);
1127
1129 BreakpointIDList &new_bps);
1130
1132 std::vector<std::string> &names,
1133 BreakpointIDList &new_bps);
1134
1135 /// Get \a load_addr as a callable code load address for this target
1136 ///
1137 /// Take \a load_addr and potentially add any address bits that are
1138 /// needed to make the address callable. For ARM this can set bit
1139 /// zero (if it already isn't) if \a load_addr is a thumb function.
1140 /// If \a addr_class is set to AddressClass::eInvalid, then the address
1141 /// adjustment will always happen. If it is set to an address class
1142 /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
1143 /// returned.
1145 lldb::addr_t load_addr,
1146 AddressClass addr_class = AddressClass::eInvalid) const;
1147
1148 /// Get \a load_addr as an opcode for this target.
1149 ///
1150 /// Take \a load_addr and potentially strip any address bits that are
1151 /// needed to make the address point to an opcode. For ARM this can
1152 /// clear bit zero (if it already isn't) if \a load_addr is a
1153 /// thumb function and load_addr is in code.
1154 /// If \a addr_class is set to AddressClass::eInvalid, then the address
1155 /// adjustment will always happen. If it is set to an address class
1156 /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
1157 /// returned.
1160 AddressClass addr_class = AddressClass::eInvalid) const;
1161
1162 // Get load_addr as breakable load address for this target. Take a addr and
1163 // check if for any reason there is a better address than this to put a
1164 // breakpoint on. If there is then return that address. For MIPS, if
1165 // instruction at addr is a delay slot instruction then this method will find
1166 // the address of its previous instruction and return that address.
1168
1169 /// This call may preload module symbols, and may do so in parallel depending
1170 /// on the following target settings:
1171 /// - TargetProperties::GetPreloadSymbols()
1172 /// - TargetProperties::GetParallelModuleLoad()
1173 ///
1174 /// Warning: if preloading is active and this is called in parallel with
1175 /// Target::GetOrCreateModule, this may result in a ABBA deadlock situation.
1176 void ModulesDidLoad(ModuleList &module_list);
1177
1178 void ModulesDidUnload(ModuleList &module_list, bool delete_locations);
1179
1180 void SymbolsDidLoad(ModuleList &module_list);
1181
1182 void ClearModules(bool delete_locations);
1183
1184 /// Called as the last function in Process::DidExec().
1185 ///
1186 /// Process::DidExec() will clear a lot of state in the process,
1187 /// then try to reload a dynamic loader plugin to discover what
1188 /// binaries are currently available and then this function should
1189 /// be called to allow the target to do any cleanup after everything
1190 /// has been figured out. It can remove breakpoints that no longer
1191 /// make sense as the exec might have changed the target
1192 /// architecture, and unloaded some modules that might get deleted.
1193 void DidExec();
1194
1195 /// Gets the module for the main executable.
1196 ///
1197 /// Each process has a notion of a main executable that is the file
1198 /// that will be executed or attached to. Executable files can have
1199 /// dependent modules that are discovered from the object files, or
1200 /// discovered at runtime as things are dynamically loaded.
1201 ///
1202 /// \return
1203 /// The shared pointer to the executable module which can
1204 /// contains a nullptr Module object if no executable has been
1205 /// set.
1206 ///
1207 /// \see DynamicLoader
1208 /// \see ObjectFile::GetDependentModules (FileSpecList&)
1209 /// \see Process::SetExecutableModule(lldb::ModuleSP&)
1211
1213
1214 /// Set the main executable module.
1215 ///
1216 /// Each process has a notion of a main executable that is the file
1217 /// that will be executed or attached to. Executable files can have
1218 /// dependent modules that are discovered from the object files, or
1219 /// discovered at runtime as things are dynamically loaded.
1220 ///
1221 /// Setting the executable causes any of the current dependent
1222 /// image information to be cleared and replaced with the static
1223 /// dependent image information found by calling
1224 /// ObjectFile::GetDependentModules (FileSpecList&) on the main
1225 /// executable and any modules on which it depends. Calling
1226 /// Process::GetImages() will return the newly found images that
1227 /// were obtained from all of the object files.
1228 ///
1229 /// \param[in] module_sp
1230 /// A shared pointer reference to the module that will become
1231 /// the main executable for this process.
1232 ///
1233 /// \param[in] load_dependent_files
1234 /// If \b true then ask the object files to track down any
1235 /// known dependent files.
1236 ///
1237 /// \see ObjectFile::GetDependentModules (FileSpecList&)
1238 /// \see Process::GetImages()
1240 lldb::ModuleSP &module_sp,
1241 LoadDependentFiles load_dependent_files = eLoadDependentsDefault);
1242
1243 bool LoadScriptingResources(std::list<Status> &errors,
1244 bool continue_on_error = true) {
1245 return m_images.LoadScriptingResourcesInTarget(this, errors,
1246 continue_on_error);
1247 }
1248
1249 /// Get accessor for the images for this process.
1250 ///
1251 /// Each process has a notion of a main executable that is the file
1252 /// that will be executed or attached to. Executable files can have
1253 /// dependent modules that are discovered from the object files, or
1254 /// discovered at runtime as things are dynamically loaded. After
1255 /// a main executable has been set, the images will contain a list
1256 /// of all the files that the executable depends upon as far as the
1257 /// object files know. These images will usually contain valid file
1258 /// virtual addresses only. When the process is launched or attached
1259 /// to, the DynamicLoader plug-in will discover where these images
1260 /// were loaded in memory and will resolve the load virtual
1261 /// addresses is each image, and also in images that are loaded by
1262 /// code.
1263 ///
1264 /// \return
1265 /// A list of Module objects in a module list.
1266 const ModuleList &GetImages() const { return m_images; }
1267
1269
1270 /// Return whether this FileSpec corresponds to a module that should be
1271 /// considered for general searches.
1272 ///
1273 /// This API will be consulted by the SearchFilterForUnconstrainedSearches
1274 /// and any module that returns \b true will not be searched. Note the
1275 /// SearchFilterForUnconstrainedSearches is the search filter that
1276 /// gets used in the CreateBreakpoint calls when no modules is provided.
1277 ///
1278 /// The target call at present just consults the Platform's call of the
1279 /// same name.
1280 ///
1281 /// \param[in] module_spec
1282 /// Path to the module.
1283 ///
1284 /// \return \b true if the module should be excluded, \b false otherwise.
1285 bool ModuleIsExcludedForUnconstrainedSearches(const FileSpec &module_spec);
1286
1287 /// Return whether this module should be considered for general searches.
1288 ///
1289 /// This API will be consulted by the SearchFilterForUnconstrainedSearches
1290 /// and any module that returns \b true will not be searched. Note the
1291 /// SearchFilterForUnconstrainedSearches is the search filter that
1292 /// gets used in the CreateBreakpoint calls when no modules is provided.
1293 ///
1294 /// The target call at present just consults the Platform's call of the
1295 /// same name.
1296 ///
1297 /// FIXME: When we get time we should add a way for the user to set modules
1298 /// that they
1299 /// don't want searched, in addition to or instead of the platform ones.
1300 ///
1301 /// \param[in] module_sp
1302 /// A shared pointer reference to the module that checked.
1303 ///
1304 /// \return \b true if the module should be excluded, \b false otherwise.
1305 bool
1307
1308 const ArchSpec &GetArchitecture() const { return m_arch.GetSpec(); }
1309
1310 /// Returns the name of the target's ABI plugin.
1311 llvm::StringRef GetABIName() const;
1312
1313 /// Set the architecture for this target.
1314 ///
1315 /// If the current target has no Images read in, then this just sets the
1316 /// architecture, which will be used to select the architecture of the
1317 /// ExecutableModule when that is set. If the current target has an
1318 /// ExecutableModule, then calling SetArchitecture with a different
1319 /// architecture from the currently selected one will reset the
1320 /// ExecutableModule to that slice of the file backing the ExecutableModule.
1321 /// If the file backing the ExecutableModule does not contain a fork of this
1322 /// architecture, then this code will return false, and the architecture
1323 /// won't be changed. If the input arch_spec is the same as the already set
1324 /// architecture, this is a no-op.
1325 ///
1326 /// \param[in] arch_spec
1327 /// The new architecture.
1328 ///
1329 /// \param[in] set_platform
1330 /// If \b true, then the platform will be adjusted if the currently
1331 /// selected platform is not compatible with the architecture being set.
1332 /// If \b false, then just the architecture will be set even if the
1333 /// currently selected platform isn't compatible (in case it might be
1334 /// manually set following this function call).
1335 ///
1336 /// \param[in] merged
1337 /// If true, arch_spec is merged with the current
1338 /// architecture. Otherwise it's replaced.
1339 ///
1340 /// \return
1341 /// \b true if the architecture was successfully set, \b false otherwise.
1342 bool SetArchitecture(const ArchSpec &arch_spec, bool set_platform = false,
1343 bool merge = true);
1344
1345 bool MergeArchitecture(const ArchSpec &arch_spec);
1346
1347 Architecture *GetArchitecturePlugin() const { return m_arch.GetPlugin(); }
1348
1349 Debugger &GetDebugger() const { return m_debugger; }
1350
1351 size_t ReadMemoryFromFileCache(const Address &addr, void *dst, size_t dst_len,
1352 Status &error);
1353
1354 // Reading memory through the target allows us to skip going to the process
1355 // for reading memory if possible and it allows us to try and read from any
1356 // constant sections in our object files on disk. If you always want live
1357 // program memory, read straight from the process. If you possibly want to
1358 // read from const sections in object files, read from the target. This
1359 // version of ReadMemory will try and read memory from the process if the
1360 // process is alive. The order is:
1361 // 1 - if (force_live_memory == false) and the address falls in a read-only
1362 // section, then read from the file cache
1363 // 2 - if there is a process, then read from memory
1364 // 3 - if there is no process, then read from the file cache
1365 //
1366 // If did_read_live_memory is provided, will indicate if the read was from
1367 // live memory, or from file contents. A caller which needs to treat these two
1368 // sources differently should use this argument to disambiguate where the data
1369 // was read from.
1370 //
1371 // The method is virtual for mocking in the unit tests.
1372 virtual size_t ReadMemory(const Address &addr, void *dst, size_t dst_len,
1373 Status &error, bool force_live_memory = false,
1374 lldb::addr_t *load_addr_ptr = nullptr,
1375 bool *did_read_live_memory = nullptr);
1376
1377 size_t ReadCStringFromMemory(const Address &addr, std::string &out_str,
1378 Status &error, bool force_live_memory = false);
1379
1380 size_t ReadCStringFromMemory(const Address &addr, char *dst,
1381 size_t dst_max_len, Status &result_error,
1382 bool force_live_memory = false);
1383
1384 /// Read a NULL terminated string from memory
1385 ///
1386 /// This function will read a cache page at a time until a NULL string
1387 /// terminator is found. It will stop reading if an aligned sequence of NULL
1388 /// termination \a type_width bytes is not found before reading \a
1389 /// cstr_max_len bytes. The results are always guaranteed to be NULL
1390 /// terminated, and that no more than (max_bytes - type_width) bytes will be
1391 /// read.
1392 ///
1393 /// \param[in] addr
1394 /// The address to start the memory read.
1395 ///
1396 /// \param[in] dst
1397 /// A character buffer containing at least max_bytes.
1398 ///
1399 /// \param[in] max_bytes
1400 /// The maximum number of bytes to read.
1401 ///
1402 /// \param[in] error
1403 /// The error status of the read operation.
1404 ///
1405 /// \param[in] type_width
1406 /// The size of the null terminator (1 to 4 bytes per
1407 /// character). Defaults to 1.
1408 ///
1409 /// \return
1410 /// The error status or the number of bytes prior to the null terminator.
1411 size_t ReadStringFromMemory(const Address &addr, char *dst, size_t max_bytes,
1412 Status &error, size_t type_width,
1413 bool force_live_memory = true);
1414
1415 size_t ReadScalarIntegerFromMemory(const Address &addr, uint32_t byte_size,
1416 bool is_signed, Scalar &scalar,
1417 Status &error,
1418 bool force_live_memory = false);
1419
1420 int64_t ReadSignedIntegerFromMemory(const Address &addr,
1421 size_t integer_byte_size,
1422 int64_t fail_value, Status &error,
1423 bool force_live_memory = false);
1424
1425 uint64_t ReadUnsignedIntegerFromMemory(const Address &addr,
1426 size_t integer_byte_size,
1427 uint64_t fail_value, Status &error,
1428 bool force_live_memory = false);
1429
1430 bool ReadPointerFromMemory(const Address &addr, Status &error,
1431 Address &pointer_addr,
1432 bool force_live_memory = false);
1433
1434 bool HasLoadedSections();
1435
1437
1438 void ClearSectionLoadList();
1439
1440 void DumpSectionLoadList(Stream &s);
1441
1442 static Target *GetTargetFromContexts(const ExecutionContext *exe_ctx_ptr,
1443 const SymbolContext *sc_ptr);
1444
1445 // lldb::ExecutionContextScope pure virtual functions
1447
1449
1451
1453
1454 void CalculateExecutionContext(ExecutionContext &exe_ctx) override;
1455
1457
1458 llvm::Expected<lldb::TypeSystemSP>
1460 bool create_on_demand = true);
1461
1462 std::vector<lldb::TypeSystemSP>
1463 GetScratchTypeSystems(bool create_on_demand = true);
1464
1467
1468 // Creates a UserExpression for the given language, the rest of the
1469 // parameters have the same meaning as for the UserExpression constructor.
1470 // Returns a new-ed object which the caller owns.
1471
1473 GetUserExpressionForLanguage(llvm::StringRef expr, llvm::StringRef prefix,
1474 SourceLanguage language,
1475 Expression::ResultType desired_type,
1476 const EvaluateExpressionOptions &options,
1477 ValueObject *ctx_obj, Status &error);
1478
1479 // Creates a FunctionCaller for the given language, the rest of the
1480 // parameters have the same meaning as for the FunctionCaller constructor.
1481 // Since a FunctionCaller can't be
1482 // IR Interpreted, it makes no sense to call this with an
1483 // ExecutionContextScope that lacks
1484 // a Process.
1485 // Returns a new-ed object which the caller owns.
1486
1488 const CompilerType &return_type,
1489 const Address &function_address,
1490 const ValueList &arg_value_list,
1491 const char *name, Status &error);
1492
1493 /// Creates and installs a UtilityFunction for the given language.
1494 llvm::Expected<std::unique_ptr<UtilityFunction>>
1495 CreateUtilityFunction(std::string expression, std::string name,
1496 lldb::LanguageType language, ExecutionContext &exe_ctx);
1497
1498 // Install any files through the platform that need be to installed prior to
1499 // launching or attaching.
1500 Status Install(ProcessLaunchInfo *launch_info);
1501
1502 bool ResolveFileAddress(lldb::addr_t load_addr, Address &so_addr);
1503
1504 bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr,
1505 uint32_t stop_id = SectionLoadHistory::eStopIDNow,
1506 bool allow_section_end = false);
1507
1508 bool SetSectionLoadAddress(const lldb::SectionSP &section,
1509 lldb::addr_t load_addr,
1510 bool warn_multiple = false);
1511
1512 size_t UnloadModuleSections(const lldb::ModuleSP &module_sp);
1513
1514 size_t UnloadModuleSections(const ModuleList &module_list);
1515
1516 bool SetSectionUnloaded(const lldb::SectionSP &section_sp);
1517
1518 bool SetSectionUnloaded(const lldb::SectionSP &section_sp,
1519 lldb::addr_t load_addr);
1520
1522
1524 lldb_private::TypeSummaryImpl &summary_provider);
1526
1527 /// Set the \a Trace object containing processor trace information of this
1528 /// target.
1529 ///
1530 /// \param[in] trace_sp
1531 /// The trace object.
1532 void SetTrace(const lldb::TraceSP &trace_sp);
1533
1534 /// Get the \a Trace object containing processor trace information of this
1535 /// target.
1536 ///
1537 /// \return
1538 /// The trace object. It might be undefined.
1540
1541 /// Create a \a Trace object for the current target using the using the
1542 /// default supported tracing technology for this process.
1543 ///
1544 /// \return
1545 /// The new \a Trace or an \a llvm::Error if a \a Trace already exists or
1546 /// the trace couldn't be created.
1547 llvm::Expected<lldb::TraceSP> CreateTrace();
1548
1549 /// If a \a Trace object is present, this returns it, otherwise a new Trace is
1550 /// created with \a Trace::CreateTrace.
1551 llvm::Expected<lldb::TraceSP> GetTraceOrCreate();
1552
1553 // Since expressions results can persist beyond the lifetime of a process,
1554 // and the const expression results are available after a process is gone, we
1555 // provide a way for expressions to be evaluated from the Target itself. If
1556 // an expression is going to be run, then it should have a frame filled in in
1557 // the execution context.
1559 llvm::StringRef expression, ExecutionContextScope *exe_scope,
1560 lldb::ValueObjectSP &result_valobj_sp,
1562 std::string *fixed_expression = nullptr, ValueObject *ctx_obj = nullptr);
1563
1565
1567
1568 /// This method will return the address of the starting function for
1569 /// this binary, e.g. main() or its equivalent. This can be used as
1570 /// an address of a function that is not called once a binary has
1571 /// started running - e.g. as a return address for inferior function
1572 /// calls that are unambiguous completion of the function call, not
1573 /// called during the course of the inferior function code running.
1574 ///
1575 /// If no entry point can be found, an invalid address is returned.
1576 ///
1577 /// \param [out] err
1578 /// This object will be set to failure if no entry address could
1579 /// be found, and may contain a helpful error message.
1580 //
1581 /// \return
1582 /// Returns the entry address for this program, or an error
1583 /// if none can be found.
1584 llvm::Expected<lldb_private::Address> GetEntryPointAddress();
1585
1586 CompilerType GetRegisterType(const RegisterInfo &reg_info);
1587
1588 /// Sends a breakpoint notification event.
1590 lldb::BreakpointEventType event_kind);
1591 /// Sends a breakpoint notification event.
1593 const lldb::EventDataSP &breakpoint_data_sp);
1594
1595 llvm::Expected<lldb::DisassemblerSP>
1596 ReadInstructions(const Address &start_addr, uint32_t count,
1597 const char *flavor_string = nullptr);
1598
1599 // Target Stop Hooks
1600 class StopHook : public UserID {
1601 public:
1602 StopHook(const StopHook &rhs);
1603 virtual ~StopHook() = default;
1604
1605 enum class StopHookKind : uint32_t {
1609 };
1616
1618
1619 // Set the specifier. The stop hook will own the specifier, and is
1620 // responsible for deleting it when we're done.
1621 void SetSpecifier(SymbolContextSpecifier *specifier);
1622
1624
1625 bool ExecutionContextPasses(const ExecutionContext &exe_ctx);
1626
1627 // Called on stop, this gets passed the ExecutionContext for each "stop
1628 // with a reason" thread. It should add to the stream whatever text it
1629 // wants to show the user, and return False to indicate it wants the target
1630 // not to stop.
1632 lldb::StreamSP output) = 0;
1633
1634 // Set the Thread Specifier. The stop hook will own the thread specifier,
1635 // and is responsible for deleting it when we're done.
1636 void SetThreadSpecifier(ThreadSpec *specifier);
1637
1639
1640 bool IsActive() { return m_active; }
1641
1642 void SetIsActive(bool is_active) { m_active = is_active; }
1643
1644 void SetAutoContinue(bool auto_continue) {
1645 m_auto_continue = auto_continue;
1646 }
1647
1648 bool GetAutoContinue() const { return m_auto_continue; }
1649
1650 void SetRunAtInitialStop(bool at_initial_stop) {
1651 m_at_initial_stop = at_initial_stop;
1652 }
1653
1655
1656 void SetSuppressOutput(bool suppress_output) {
1657 m_suppress_output = suppress_output;
1658 }
1659
1660 bool GetSuppressOutput() const { return m_suppress_output; }
1661
1662 void GetDescription(Stream &s, lldb::DescriptionLevel level) const;
1664 lldb::DescriptionLevel level) const = 0;
1665
1666 protected:
1669 std::unique_ptr<ThreadSpec> m_thread_spec_up;
1670 bool m_active = true;
1671 bool m_auto_continue = false;
1673 bool m_suppress_output = false;
1674
1675 StopHook(lldb::TargetSP target_sp, lldb::user_id_t uid);
1676 };
1677
1679 public:
1680 ~StopHookCommandLine() override = default;
1681
1683 void SetActionFromString(const std::string &strings);
1684 void SetActionFromStrings(const std::vector<std::string> &strings);
1685
1687 lldb::StreamSP output_sp) override;
1689 lldb::DescriptionLevel level) const override;
1690
1691 private:
1693 // Use CreateStopHook to make a new empty stop hook. Use SetActionFromString
1694 // to fill it with commands, and SetSpecifier to set the specifier shared
1695 // pointer (can be null, that will match anything.)
1697 : StopHook(target_sp, uid) {}
1698 friend class Target;
1699 };
1700
1702 public:
1703 ~StopHookScripted() override = default;
1705 lldb::StreamSP output) override;
1706
1707 Status SetScriptCallback(const ScriptedMetadata &scripted_metadata);
1708
1710 lldb::DescriptionLevel level) const override;
1711
1712 private:
1713 llvm::StringRef GetScriptClassName() const;
1714
1716
1717 /// Use CreateStopHook to make a new empty stop hook. Use SetScriptCallback
1718 /// to set the script to execute, and SetSpecifier to set the specifier
1719 /// shared pointer (can be null, that will match anything.)
1721 : StopHook(target_sp, uid) {}
1722 friend class Target;
1723 };
1724
1725 class StopHookCoded : public StopHook {
1726 public:
1727 ~StopHookCoded() override = default;
1728
1730 lldb::StreamSP output);
1731
1732 void SetCallback(llvm::StringRef name, HandleStopCallback *callback) {
1733 m_name = name;
1734 m_callback = callback;
1735 }
1736
1738 lldb::StreamSP output) override {
1739 return m_callback(exc_ctx, output);
1740 }
1741
1743 lldb::DescriptionLevel level) const override {
1744 s.Indent();
1745 s.Printf("%s (built-in)\n", m_name.c_str());
1746 }
1747
1748 private:
1749 std::string m_name;
1751
1752 /// Use CreateStopHook to make a new empty stop hook. Use SetCallback to set
1753 /// the callback to execute, and SetSpecifier to set the specifier shared
1754 /// pointer (can be null, that will match anything.)
1756 : StopHook(target_sp, uid) {}
1757 friend class Target;
1758 };
1759
1761
1762 typedef std::shared_ptr<StopHook> StopHookSP;
1763
1764 // Target Hooks
1765 //
1766 // Hooks fire on target lifecycle events. There are two flows:
1767 //
1768 // Command-based hooks: the user specifies which triggers the hook responds
1769 // to (--on-load, --on-unload, --on-stop) and provides a list of commands.
1770 // All commands run for every trigger the hook is signed up for.
1771 //
1772 // Python class hooks: the user provides a Python class name and optional
1773 // extra_args that will be passed to the hook init method (-k key -v value).
1774 // The class controls which events it handles by implementing the
1775 // corresponding callback methods (handle_module_loaded,
1776 // handle_module_unloaded, handle_stop). Triggers are set automatically
1777 // based on which methods exist.
1778 class Hook : public UserID {
1779 public:
1780 Hook(const Hook &rhs);
1781 virtual ~Hook() = default;
1782
1783 enum class HookKind : uint32_t { CommandBased = 0, ScriptBased };
1784
1785 HookKind GetHookKind() const { return m_kind; }
1786
1787 /// Individual trigger bits. Combine with bitwise OR to form a trigger mask.
1788 // FIXME: Add kProcessExit, kProcessDetach, etc. as needed.
1789 enum TriggerBit : uint32_t {
1790 kModulesLoaded = (1u << 0),
1791 kModulesUnloaded = (1u << 1),
1792 kProcessStop = (1u << 2),
1793 };
1794
1796
1797 bool IsEnabled() { return m_enabled; }
1798 void SetIsEnabled(bool enabled) { m_enabled = enabled; }
1799
1800 /// Return the bitmask of triggers this hook responds to.
1801 /// Each bit corresponds to a TriggerBit value.
1802 uint32_t GetTriggerMask() const { return m_trigger_mask; }
1803
1804 /// Return true if this hook fires on the given trigger.
1805 bool FiresOn(uint32_t trigger) const { return m_trigger_mask & trigger; }
1806
1807 // Filter fields
1808
1809 /// Set the symbol context specifier. The hook takes ownership.
1810 void SetSCSpecifier(SymbolContextSpecifier *specifier);
1812
1813 /// Check if the execution context passes the specifier and thread spec
1814 /// filters. Always returns true if no filters are set.
1815 bool ExecutionContextPasses(const ExecutionContext &exe_ctx);
1816
1817 /// Set the thread specifier. The hook takes ownership.
1818 void SetThreadSpecifier(ThreadSpec *specifier);
1820
1821 void SetRunAtInitialStop(bool at_initial_stop) {
1822 m_at_initial_stop = at_initial_stop;
1823 }
1825
1826 // Reaction settings
1827
1828 void SetAutoContinue(bool auto_continue) {
1829 m_auto_continue = auto_continue;
1830 }
1831 bool GetAutoContinue() const { return m_auto_continue; }
1832
1833 void SetSuppressOutput(bool suppress_output) {
1834 m_suppress_output = suppress_output;
1835 }
1836 bool GetSuppressOutput() const { return m_suppress_output; }
1837
1838 // Event handler methods (default no-ops)
1839
1840 virtual void HandleModuleLoaded(lldb::StreamSP output) {}
1841 virtual void HandleModuleUnloaded(lldb::StreamSP output) {}
1842
1843 /// Called when the process stops. Returns a StopHookResult indicating
1844 /// whether the process should remain stopped or continue.
1849
1850 virtual void GetDescription(Stream &s, lldb::DescriptionLevel level) const;
1851
1852 protected:
1853 /// Print the filter portion of the description (AutoContinue, Specifier,
1854 /// ThreadSpec). Called by subclass GetDescription after printing the
1855 /// hook-specific content (commands or class).
1859 bool m_enabled = true;
1860 uint32_t m_trigger_mask = 0; // No default, triggers must be explicit.
1861
1862 // Filters
1864 std::unique_ptr<ThreadSpec> m_thread_spec_up;
1866
1867 // Reaction settings
1868 bool m_auto_continue = false;
1869 bool m_suppress_output = false;
1870
1871 Hook(lldb::TargetSP target_sp, lldb::user_id_t uid, HookKind kind);
1872 };
1873
1874 class HookCommandLine : public Hook {
1875 public:
1876 ~HookCommandLine() override = default;
1877
1878 /// Replace the trigger mask. \a mask is a bitwise OR of TriggerBit values.
1879 void SetTriggerMask(uint32_t mask) { m_trigger_mask = mask; }
1880
1881 /// Add a trigger to the mask. \a trigger is a single TriggerBit value.
1882 void AddTrigger(uint32_t trigger) { m_trigger_mask |= trigger; }
1883
1884 /// Remove a trigger from the mask. \a trigger is a single TriggerBit value.
1885 void RemoveTrigger(uint32_t trigger) { m_trigger_mask &= ~trigger; }
1886
1887 /// Return the list of commands that this hook runs.
1889
1890 /// Populate the command list by splitting a single string on newlines.
1891 void SetActionFromString(const std::string &string);
1892
1893 /// Populate the command list from a vector of individual command strings.
1894 void SetActionFromStrings(const std::vector<std::string> &strings);
1895
1896 void GetDescription(Stream &s, lldb::DescriptionLevel level) const override;
1897 void HandleModuleLoaded(lldb::StreamSP output) override;
1898 void HandleModuleUnloaded(lldb::StreamSP output) override;
1900 lldb::StreamSP output) override;
1901
1902 private:
1904
1906 : Hook(target_sp, uid, HookKind::CommandBased) {}
1907 friend class Target;
1908 };
1909
1910 class HookScripted : public Hook {
1911 public:
1912 ~HookScripted() override = default;
1913
1914 void GetDescription(Stream &s, lldb::DescriptionLevel level) const override;
1915
1916 void HandleModuleLoaded(lldb::StreamSP output) override;
1917 void HandleModuleUnloaded(lldb::StreamSP output) override;
1919 lldb::StreamSP output) override;
1920
1921 Status SetScriptCallback(const ScriptedMetadata &scripted_metadata);
1922
1923 private:
1924 llvm::StringRef GetScriptClassName() const;
1925
1927
1929 : Hook(target_sp, uid, HookKind::ScriptBased) {}
1930 friend class Target;
1931 };
1932
1933 typedef std::shared_ptr<Hook> HookSP;
1934
1936
1937 /// Removes the most recently created hook. Used to roll back a
1938 /// hook creation when an error occurs (e.g., invalid script class name
1939 /// or empty interactive input).
1941
1943
1944 void RemoveAllHooks();
1945
1947
1948 bool SetHookEnabledStateByID(lldb::user_id_t uid, bool enabled);
1949
1950 void SetAllHooksEnabledState(bool enabled);
1951
1952 size_t GetNumHooks() const { return m_hooks.size(); }
1953
1954 HookSP GetHookAtIndex(size_t index);
1955
1956 void RunModuleHooks(bool is_load);
1957
1958 /// Add an empty stop hook to the Target's stop hook list, and returns a
1959 /// shared pointer to the new hook.
1960 StopHookSP CreateStopHook(StopHook::StopHookKind kind, bool internal = false);
1961
1962 /// If you tried to create a stop hook, and that failed, call this to
1963 /// remove the stop hook, as it will also reset the stop hook counter.
1965
1966 // Runs the stop hooks that have been registered for this target.
1967 // Returns true if the stop hooks cause the target to resume.
1968 // Pass at_initial_stop if this is the stop where lldb gains
1969 // control over the process for the first time.
1970 bool RunStopHooks(bool at_initial_stop = false);
1971
1972 bool SetSuppresStopHooks(bool suppress) {
1973 bool old_value = m_suppress_stop_hooks;
1974 m_suppress_stop_hooks = suppress;
1975 return old_value;
1976 }
1977
1979
1981
1982 void RemoveAllStopHooks();
1983
1984 StopHookSP GetStopHookByID(lldb::user_id_t uid);
1985
1986 bool SetStopHookActiveStateByID(lldb::user_id_t uid, bool active_state);
1987
1988 void SetAllStopHooksActiveState(bool active_state);
1989
1990 const std::vector<StopHookSP> GetStopHooks(bool internal = false) const;
1991
1993
1994 void SetPlatform(const lldb::PlatformSP &platform_sp) {
1995 m_platform_sp = platform_sp;
1996 }
1997
1999
2000 // Methods.
2002 GetSearchFilterForModule(const FileSpec *containingModule);
2003
2005 GetSearchFilterForModuleList(const FileSpecList *containingModuleList);
2006
2008 GetSearchFilterForModuleAndCUList(const FileSpecList *containingModules,
2009 const FileSpecList *containingSourceFiles);
2010
2012 const char *repl_options, bool can_create);
2013
2014 void SetREPL(lldb::LanguageType language, lldb::REPLSP repl_sp);
2015
2019
2021
2022 /// Get the list of paths that LLDB will consider automatically loading
2023 /// scripting resources from. Currently whether to load scripts
2024 /// unconditionally is controlled via the
2025 /// `target.load-script-from-symbol-file` setting.
2027
2028 /// Add a signal for the target. This will get copied over to the process
2029 /// if the signal exists on that target. Only the values with Yes and No are
2030 /// set, Calculate values will be ignored.
2031protected:
2040 using DummySignalElement = llvm::StringMapEntry<DummySignalValues>;
2041 static bool UpdateSignalFromDummy(lldb::UnixSignalsSP signals_sp,
2042 const DummySignalElement &element);
2043 static bool ResetSignalFromDummy(lldb::UnixSignalsSP signals_sp,
2044 const DummySignalElement &element);
2045
2046public:
2047 /// Add a signal to the Target's list of stored signals/actions. These
2048 /// values will get copied into any processes launched from
2049 /// this target.
2050 void AddDummySignal(llvm::StringRef name, LazyBool pass, LazyBool print,
2051 LazyBool stop);
2052 /// Updates the signals in signals_sp using the stored dummy signals.
2053 /// If warning_stream_sp is not null, if any stored signals are not found in
2054 /// the current process, a warning will be emitted here.
2056 lldb::StreamSP warning_stream_sp);
2057 /// Clear the dummy signals in signal_names from the target, or all signals
2058 /// if signal_names is empty. Also remove the behaviors they set from the
2059 /// process's signals if it exists.
2060 void ClearDummySignals(Args &signal_names);
2061 /// Print all the signals set in this target.
2062 void PrintDummySignals(Stream &strm, Args &signals);
2063
2064protected:
2065 /// The mutex the calling thread must serialize on for its current policy, or
2066 /// nullptr when that policy bypasses the API mutex entirely.
2067 std::recursive_mutex *GetAPIMutexForCurrentPolicy();
2068
2069 /// Implementing of ModuleList::Notifier.
2070
2071 void NotifyModuleAdded(const ModuleList &module_list,
2072 const lldb::ModuleSP &module_sp) override;
2073
2074 void NotifyModuleRemoved(const ModuleList &module_list,
2075 const lldb::ModuleSP &module_sp) override;
2076
2077 void NotifyModuleUpdated(const ModuleList &module_list,
2078 const lldb::ModuleSP &old_module_sp,
2079 const lldb::ModuleSP &new_module_sp) override;
2080
2081 void NotifyWillClearList(const ModuleList &module_list) override;
2082
2083 void NotifyModulesRemoved(lldb_private::ModuleList &module_list) override;
2084
2085 class Arch {
2086 public:
2087 explicit Arch(const ArchSpec &spec);
2088 const Arch &operator=(const ArchSpec &spec);
2089
2090 const ArchSpec &GetSpec() const { return m_spec; }
2091 Architecture *GetPlugin() const { return m_plugin_up.get(); }
2092
2093 private:
2095 std::unique_ptr<Architecture> m_plugin_up;
2096 };
2097
2098 // Member variables.
2100 lldb::PlatformSP m_platform_sp; ///< The platform for this target.
2101 std::recursive_mutex m_mutex; ///< An API mutex that is used by the lldb::SB*
2102 /// classes make the SB interface thread safe
2103 /// When the private state thread calls SB API's - usually because it is
2104 /// running OS plugin or Python ThreadPlan code - it should not block on the
2105 /// API mutex that is held by the code that kicked off the sequence of events
2106 /// that led us to run the code. We hand out this mutex instead when we
2107 /// detect that code is running on the private state thread.
2108 std::recursive_mutex m_private_mutex;
2110 std::string m_label;
2111 ModuleList m_images; ///< The list of images for this process (shared
2112 /// libraries and anything dynamically loaded).
2117 using BreakpointNameMap = llvm::StringMap<std::unique_ptr<BreakpointName>>;
2119
2120 std::map<lldb::user_id_t, BreakpointResolverOverrideUP>
2122 /// This is the ID that will be handed out for the next added breakpoint
2123 /// override resolver for this target.
2125
2129 // We want to tightly control the process destruction process so we can
2130 // correctly tear down everything that we need to, so the only class that
2131 // knows about the process lifespan is this target class.
2136
2137 /// Map of scripted frame provider descriptors for this target.
2138 /// Keys are the provider descriptor IDs, values are the descriptors.
2139 /// Insertion order is preserved so that equal-priority providers chain
2140 /// in registration order.
2141 llvm::MapVector<uint32_t, ScriptedFrameProviderDescriptor>
2143 mutable std::recursive_mutex m_frame_provider_descriptors_mutex;
2145
2146 typedef std::map<lldb::LanguageType, lldb::REPLSP> REPLMap;
2148
2150
2151 typedef std::map<lldb::user_id_t, StopHookSP> StopHookCollection;
2154 std::vector<StopHookSP> m_internal_stop_hooks;
2155 uint32_t m_latest_stop_hook_id; /// This records the last natural stop at
2156 /// which we ran a stop-hook.
2158 bool m_suppress_stop_hooks; /// Used to not run stop hooks for expressions
2160
2161 typedef std::map<lldb::user_id_t, HookSP> HookCollection;
2166 LLDB_INVALID_GLOBALLY_UNIQUE_TARGET_ID; ///< The globally unique ID
2167 /// assigned to this target
2168 std::string m_target_session_name; ///< The target session name for this
2169 /// target, used to name debugging
2170 /// sessions in DAP.
2171 /// An optional \a lldb_private::Trace object containing processor trace
2172 /// information of this target.
2174 /// Stores the frame recognizers of this target.
2176 /// These are used to set the signal state when you don't have a process and
2177 /// more usefully in the Dummy target where you can't know exactly what
2178 /// signals you will have.
2179 llvm::StringMap<DummySignalValues> m_dummy_signals;
2180
2182
2183 static void ImageSearchPathsChanged(const PathMappingList &path_list,
2184 void *baton);
2185
2186 // Utilities for `statistics` command.
2187private:
2188 // Target metrics storage.
2190
2191public:
2192 /// Get metrics associated with this target in JSON format.
2193 ///
2194 /// Target metrics help measure timings and information that is contained in
2195 /// a target. These are designed to help measure performance of a debug
2196 /// session as well as represent the current state of the target, like
2197 /// information on the currently modules, currently set breakpoints and more.
2198 ///
2199 /// \return
2200 /// Returns a JSON value that contains all target metrics.
2201 llvm::json::Value
2203
2204 void ResetStatistics();
2205
2207
2208protected:
2209 /// Construct with optional file and arch.
2210 ///
2211 /// This member is private. Clients must use
2212 /// TargetList::CreateTarget(const FileSpec*, const ArchSpec*)
2213 /// so all targets can be tracked from the central target list.
2214 ///
2215 /// \see TargetList::CreateTarget(const FileSpec*, const ArchSpec*)
2216 Target(Debugger &debugger, const ArchSpec &target_arch,
2217 const lldb::PlatformSP &platform_sp, bool is_dummy_target);
2218
2219 // Helper function.
2220 bool ProcessIsValid();
2221
2222 // Copy breakpoints, stop hooks and so forth from the dummy target:
2223 void PrimeFromDummyTarget(Target &target);
2224
2225 void AddBreakpoint(lldb::BreakpointSP breakpoint_sp, bool internal);
2226
2228
2229 /// Return a recommended size for memory reads at \a addr, optimizing for
2230 /// cache usage.
2232
2233 Target(const Target &) = delete;
2234 const Target &operator=(const Target &) = delete;
2235
2237 return m_section_load_history.GetCurrentSectionLoadList();
2238 }
2239};
2240
2241} // namespace lldb_private
2242
2243#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:374
void SetOneThreadTimeout(const Timeout< std::micro > &timeout)
Definition Target.h:433
void SetUnwindOnError(bool unwind=false)
Definition Target.h:406
SourceLanguage GetLanguage() const
Definition Target.h:368
const char * GetPoundLineFilePath() const
Definition Target.h:496
lldb::DynamicValueType m_use_dynamic
Definition Target.h:572
void SetExecutionPolicy(ExecutionPolicy policy=eExecutionPolicyAlways)
Definition Target.h:364
Timeout< std::micro > m_one_thread_timeout
Definition Target.h:574
bool InvokeCancelCallback(lldb::ExpressionEvaluationPhase phase) const
Definition Target.h:478
lldb::DynamicValueType GetUseDynamic() const
Definition Target.h:418
void SetKeepInMemory(bool keep=true)
Definition Target.h:416
bool m_try_DIL_first
If enabled, Data Inspection Language (DIL) should attempt to evaluate the expression first.
Definition Target.h:570
void SetCoerceToId(bool coerce=true)
Definition Target.h:402
void SetLanguage(lldb::LanguageType language_type)
Definition Target.h:370
ExecutionPolicy GetExecutionPolicy() const
Definition Target.h:362
Timeout< std::micro > m_timeout
Definition Target.h:573
void SetCppIgnoreContextQualifiers(bool value)
Definition Target.cpp:6180
const StructuredData::Dictionary & GetLanguageOptions() const
Definition Target.cpp:6158
llvm::Expected< bool > GetBooleanLanguageOption(llvm::StringRef option_name) const
Get the language-plugin specific boolean option called option_name.
Definition Target.cpp:6142
void SetPrefix(const char *prefix)
Definition Target.h:395
void SetTryAllThreads(bool try_others=true)
Definition Target.h:439
static constexpr std::chrono::milliseconds default_timeout
Definition Target.h:354
void SetPoundLine(const char *path, uint32_t line) const
Definition Target.h:486
void SetRetriesWithFixIts(uint64_t number_of_retries)
Definition Target.h:512
SymbolContextList m_preferred_lookup_contexts
During expression evaluation, any SymbolContext in this list will be used for symbol/function lookup ...
Definition Target.h:590
void SetTimeout(const Timeout< std::micro > &timeout)
Definition Target.h:427
static constexpr ExecutionPolicy default_execution_policy
Definition Target.h:359
void SetStopOthers(bool stop_others=true)
Definition Target.h:443
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:566
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:6125
StructuredData::DictionarySP m_language_options_sp
Dictionary mapping names of language-plugin specific options to values.
Definition Target.h:585
void SetCancelCallback(lldb::ExpressionCancelCallback callback, void *baton)
Definition Target.h:473
const Timeout< std::micro > & GetTimeout() const
Definition Target.h:425
const SymbolContextList & GetPreferredSymbolContexts() const
Definition Target.h:378
void SetIgnoreBreakpoints(bool ignore=false)
Definition Target.h:410
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:385
void SetUseDynamic(lldb::DynamicValueType dynamic=lldb::eDynamicCanRunTarget)
Definition Target.h:421
lldb::ExpressionCancelCallback m_cancel_callback
Definition Target.h:575
const Timeout< std::micro > & GetOneThreadTimeout() const
Definition Target.h:429
"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...
bool GetUseDILForCreatingValues() const
Definition Target.cpp:5226
uint32_t GetMaximumSizeOfStringSummary() const
Definition Target.cpp:5653
FileSpecList GetDebugFileSearchPaths()
Definition Target.cpp:5528
llvm::StringRef GetLaunchWorkingDirectory() const
Definition Target.cpp:5334
bool GetDisplayRecognizedArguments() const
Definition Target.cpp:5817
ImportStdModule GetImportStdModule() const
Definition Target.cpp:5544
void AppendExecutableSearchPaths(const FileSpec &)
Definition Target.cpp:5515
bool GetEnableSyntheticValue() const
Definition Target.cpp:5620
void SetStandardInputPath(const char *path)=delete
ProcessLaunchInfo m_launch_info
Definition Target.h:337
bool GetCheckValueObjectOwnership() const
Definition Target.cpp:5945
uint64_t GetExprAllocAlign() const
Definition Target.cpp:5732
MemoryModuleLoadLevel GetMemoryModuleLoadLevel() const
Definition Target.cpp:5789
llvm::StringRef GetArg0() const
Definition Target.cpp:5387
uint32_t GetMaximumMemReadSize() const
Definition Target.cpp:5659
void SetRunArguments(const Args &args)
Definition Target.cpp:5404
FileSpec GetStandardErrorPath() const
Definition Target.cpp:5685
void SetLoadScriptFromSymbolFile(LoadScriptFromSymFile load_style)
Set the target-wide target.load-script-from-symbol-file setting.
Definition Target.cpp:5769
bool GetEnableNotifyAboutFixIts() const
Definition Target.cpp:5570
bool SetPreferDynamicValue(lldb::DynamicValueType d)
Definition Target.cpp:5271
void SetDisplayRecognizedArguments(bool b)
Definition Target.cpp:5823
void SetUseDILForCreatingValues(bool b)
Definition Target.cpp:5239
std::optional< bool > GetExperimentalPropertyValue(size_t prop_idx, ExecutionContext *exe_ctx=nullptr) const
Definition Target.cpp:5188
const ProcessLaunchInfo & GetProcessLaunchInfo() const
Definition Target.cpp:5828
Environment ComputeEnvironment() const
Definition Target.cpp:5410
void SetStandardOutputPath(const char *path)=delete
bool GetUserSpecifiedTrapHandlerNames(Args &args) const
Definition Target.cpp:5796
uint64_t GetExprErrorLimit() const
Definition Target.cpp:5714
bool GetEnableAutoImportClangModules() const
Definition Target.cpp:5538
bool GetDebugUtilityExpression() const
Definition Target.cpp:5934
JITEngine GetJITEngine() const
Definition Target.cpp:5581
DynamicClassInfoHelper GetDynamicClassInfoHelper() const
Definition Target.cpp:5551
FileSpec GetStandardOutputPath() const
Definition Target.cpp:5675
void SetDisplayRuntimeSupportValues(bool b)
Definition Target.cpp:5812
uint32_t GetMaximumNumberOfChildrenToDisplay() const
Definition Target.cpp:5638
void SetRequireHardwareBreakpoints(bool b)
Definition Target.cpp:5866
bool GetAutoInstallMainExecutable() const
Definition Target.cpp:5871
const char * GetDisassemblyFeatures() const
Definition Target.cpp:5366
void SetAutoLoadScriptsForModule(llvm::StringRef module_name, LoadScriptFromSymFile load_style)
Set the LoadScriptFromSymFile for a module called module_name (excluding file extension).
Definition Target.cpp:5971
RealpathPrefixes GetSourceRealpathPrefixes() const
Definition Target.cpp:5382
void SetCheckValueObjectOwnership(bool check)
Definition Target.cpp:5951
uint64_t GetNumberOfRetriesWithFixits() const
Definition Target.cpp:5564
uint64_t GetExprAllocSize() const
Definition Target.cpp:5726
std::optional< LoadScriptFromSymFile > GetAutoLoadScriptsForModule(llvm::StringRef module_name) const
Definition Target.cpp:5957
llvm::StringRef GetExpressionPrefixContents()
Definition Target.cpp:5700
PathMappingList & GetObjectPathMap() const
Definition Target.cpp:5501
const char * GetDisassemblyFlavor() const
Definition Target.cpp:5346
FileSpec GetStandardInputPath() const
Definition Target.cpp:5665
lldb::DynamicValueType GetPreferDynamicValue() const
Definition Target.cpp:5264
InlineStrategy GetInlineStrategy() const
Definition Target.cpp:5373
Environment GetTargetEnvironment() const
Definition Target.cpp:5470
bool GetDisplayRuntimeSupportValues() const
Definition Target.cpp:5806
void SetUserSpecifiedTrapHandlerNames(const Args &args)
Definition Target.cpp:5801
uint32_t GetMaxZeroPaddingInFloatFormat() const
Definition Target.cpp:5632
uint64_t GetExprAllocAddress() const
Definition Target.cpp:5720
LoadCWDlldbinitFile GetLoadCWDlldbinitFile() const
Definition Target.cpp:5775
Environment GetInheritedEnvironment() const
Definition Target.cpp:5442
void SetArg0(llvm::StringRef arg)
Definition Target.cpp:5393
bool GetInjectLocalVariables(ExecutionContext *exe_ctx) const
Definition Target.cpp:5199
void SetStandardErrorPath(const char *path)=delete
bool ShowHexVariableValuesWithLeadingZeroes() const
Definition Target.cpp:5626
SourceLanguage GetLanguage() const
Definition Target.cpp:5695
Environment GetEnvironment() const
Definition Target.cpp:5438
void SetProcessLaunchInfo(const ProcessLaunchInfo &launch_info)
Definition Target.cpp:5832
FileSpec GetSaveJITObjectsDir() const
Definition Target.cpp:5576
void SetEnvironment(Environment env)
Definition Target.cpp:5481
LoadScriptFromSymFile GetLoadScriptFromSymbolFile() const
Definition Target.cpp:5762
const char * GetDisassemblyCPU() const
Definition Target.cpp:5359
void SetStandardErrorPath(llvm::StringRef path)
Definition Target.cpp:5690
bool GetRunArguments(Args &args) const
Definition Target.cpp:5399
FileSpecList GetExecutableSearchPaths()
Definition Target.cpp:5523
ArchSpec GetDefaultArchitecture() const
Definition Target.cpp:5248
Disassembler::HexImmediateStyle GetHexImmediateStyle() const
Definition Target.cpp:5782
void SetUseDIL(ExecutionContext *exe_ctx, bool b)
Definition Target.cpp:5217
std::unique_ptr< TargetExperimentalProperties > m_experimental_properties_up
Definition Target.h:338
FileSpecList GetClangModuleSearchPaths()
Definition Target.cpp:5533
void SetStandardOutputPath(llvm::StringRef path)
Definition Target.cpp:5680
bool GetRequireHardwareBreakpoints() const
Definition Target.cpp:5860
PathMappingList & GetSourcePathMap() const
Definition Target.cpp:5493
bool GetAutoSourceMapRelative() const
Definition Target.cpp:5509
bool GetUseDIL(ExecutionContext *exe_ctx) const
Definition Target.cpp:5205
void SetDefaultArchitecture(const ArchSpec &arch)
Definition Target.cpp:5253
void SetStandardInputPath(llvm::StringRef path)
Definition Target.cpp:5670
TargetProperties(Target *target)
Definition Target.cpp:5112
bool GetDisplayExpressionsInCrashlogs() const
Definition Target.cpp:5756
bool GetEnableAutoApplyFixIts() const
Definition Target.cpp:5558
void SetDebugUtilityExpression(bool debug)
Definition Target.cpp:5940
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:5645
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:2095
const ArchSpec & GetSpec() const
Definition Target.h:2090
const Arch & operator=(const ArchSpec &spec)
Definition Target.cpp:170
Arch(const ArchSpec &spec)
Definition Target.cpp:166
Architecture * GetPlugin() const
Definition Target.h:2091
virtual BreakpointResolverOverrideUP CopyIntoNewTarget(Target &target)=0
BreakpointResolverOverride(Target &target, const std::string &description, uint64_t type_mask)
Definition Target.h:1047
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:1882
void RemoveTrigger(uint32_t trigger)
Remove a trigger from the mask. trigger is a single TriggerBit value.
Definition Target.h:1885
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:1905
void SetTriggerMask(uint32_t mask)
Replace the trigger mask. mask is a bitwise OR of TriggerBit values.
Definition Target.h:1879
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:1888
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:1928
void GetDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.cpp:4731
lldb::ScriptedHookInterfaceSP m_interface_sp
Definition Target.h:1926
void HandleModuleUnloaded(lldb::StreamSP output) override
Definition Target.cpp:4697
virtual ~Hook()=default
void SetSuppressOutput(bool suppress_output)
Definition Target.h:1833
bool GetRunAtInitialStop() const
Definition Target.h:1824
ThreadSpec * GetThreadSpecifier()
Definition Target.h:1819
TriggerBit
Individual trigger bits. Combine with bitwise OR to form a trigger mask.
Definition Target.h:1789
bool GetSuppressOutput() const
Definition Target.h:1836
void SetRunAtInitialStop(bool at_initial_stop)
Definition Target.h:1821
lldb::SymbolContextSpecifierSP m_sc_specifier_sp
Definition Target.h:1863
void SetIsEnabled(bool enabled)
Definition Target.h:1798
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:1785
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:1845
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:1828
bool GetAutoContinue() const
Definition Target.h:1831
virtual void HandleModuleUnloaded(lldb::StreamSP output)
Definition Target.h:1841
uint32_t GetTriggerMask() const
Return the bitmask of triggers this hook responds to.
Definition Target.h:1802
lldb::TargetSP & GetTarget()
Definition Target.h:1795
SymbolContextSpecifier * GetSCSpecifier()
Definition Target.h:1811
lldb::TargetSP m_target_sp
Definition Target.h:1857
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:1840
bool FiresOn(uint32_t trigger) const
Return true if this hook fires on the given trigger.
Definition Target.h:1805
std::unique_ptr< ThreadSpec > m_thread_spec_up
Definition Target.h:1864
void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.h:1742
HandleStopCallback * m_callback
Definition Target.h:1750
StopHookResult HandleStop(ExecutionContext &exc_ctx, lldb::StreamSP output) override
Definition Target.h:1737
StopHookCoded(lldb::TargetSP target_sp, lldb::user_id_t uid)
Use CreateStopHook to make a new empty stop hook.
Definition Target.h:1755
void SetCallback(llvm::StringRef name, HandleStopCallback *callback)
Definition Target.h:1732
StopHookResult(ExecutionContext &exc_ctx, lldb::StreamSP output) HandleStopCallback
Definition Target.h:1729
void SetActionFromString(const std::string &strings)
Definition Target.cpp:4285
StopHookCommandLine(lldb::TargetSP target_sp, lldb::user_id_t uid)
Definition Target.h:1696
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:1715
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:1720
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:1654
SymbolContextSpecifier * GetSpecifier()
Definition Target.h:1623
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:1669
void SetIsActive(bool is_active)
Definition Target.h:1642
void SetSuppressOutput(bool suppress_output)
Definition Target.h:1656
void SetThreadSpecifier(ThreadSpec *specifier)
Definition Target.cpp:4209
ThreadSpec * GetThreadSpecifier()
Definition Target.h:1638
StopHook(const StopHook &rhs)
Definition Target.cpp:4197
bool ExecutionContextPasses(const ExecutionContext &exe_ctx)
Definition Target.cpp:4213
lldb::TargetSP & GetTarget()
Definition Target.h:1617
void SetRunAtInitialStop(bool at_initial_stop)
Definition Target.h:1650
lldb::SymbolContextSpecifierSP m_specifier_sp
Definition Target.h:1668
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:1644
const ModuleList & GetModuleList() const
Definition Target.h:665
void Dump(Stream *s) const override
Definition Target.cpp:6003
static llvm::StringRef GetFlavorString()
Definition Target.cpp:5999
static lldb::TargetSP GetCreatedTargetFromEvent(const Event *event_ptr)
Definition Target.cpp:6032
static ModuleList GetModuleListFromEvent(const Event *event_ptr)
Definition Target.cpp:6041
static const TargetEventData * GetEventDataFromEvent(const Event *event_ptr)
Definition Target.cpp:6013
llvm::StringRef GetFlavor() const override
Definition Target.h:643
const lldb::TargetSP & GetTarget() const
Definition Target.h:659
TargetEventData(const lldb::TargetSP &target_sp)
Definition Target.cpp:5985
TargetEventData(const TargetEventData &)=delete
const lldb::TargetSP & GetCreatedTarget() const
Definition Target.h:661
const TargetEventData & operator=(const TargetEventData &)=delete
static lldb::TargetSP GetTargetFromEvent(const Event *event_ptr)
Definition Target.cpp:6023
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:2152
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:2163
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:6053
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:1268
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:2117
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:1972
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:1952
lldb::BreakpointSP GetBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:438
std::shared_ptr< StopHook > StopHookSP
Definition Target.h:1762
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:619
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:2144
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:6070
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:2179
lldb::user_id_t AddBreakpointResolverOverride(BreakpointResolverOverrideUP override_up)
Add a breakpoint override resolver. This version can't fail.
Definition Target.h:1070
lldb::ProcessSP m_process_sp
Definition Target.h:2132
Debugger & GetDebugger() const
Definition Target.h:1349
lldb::SearchFilterSP m_search_filter_sp
Definition Target.h:2133
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:2159
static bool UpdateSignalFromDummy(lldb::UnixSignalsSP signals_sp, const DummySignalElement &element)
Definition Target.cpp:4083
PathMappingList m_image_search_paths
Definition Target.h:2134
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:2236
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:6049
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:2181
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:6076
void DeleteCurrentProcess()
Definition Target.cpp:295
BreakpointList m_internal_breakpoint_list
Definition Target.h:2116
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:602
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:1243
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:2118
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:2142
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:1347
llvm::json::Value ReportStatistics(const lldb_private::StatisticsOptions &options)
Get metrics associated with this target in JSON format.
Definition Target.cpp:6062
friend class TargetList
Definition Target.h:600
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:2206
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:2151
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:2173
lldb::user_id_t GetGloballyUniqueID() const
Get the globally unique ID for this target.
Definition Target.h:701
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:2127
BreakpointList m_breakpoint_list
Definition Target.h:2115
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:2149
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:2124
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:1088
bool RemoveBreakpointResolverOverride(lldb::user_id_t override_id)
Definition Target.h:1083
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:2154
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:2101
std::recursive_mutex m_frame_provider_descriptors_mutex
Definition Target.h:2143
lldb::user_id_t m_target_unique_id
The globally unique ID assigned to this target.
Definition Target.h:2165
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:2113
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:1978
std::string m_label
Definition Target.h:2110
lldb::user_id_t m_stop_hook_next_id
Definition Target.h:2153
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:6080
lldb::SearchFilterSP GetSearchFilterForModule(const FileSpec *containingModule)
Definition Target.cpp:688
llvm::StringMapEntry< DummySignalValues > DummySignalElement
Definition Target.h:2040
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:2155
void RunModuleHooks(bool is_load)
Definition Target.cpp:4828
std::map< lldb::user_id_t, BreakpointResolverOverrideUP > m_breakpoint_overrides
Definition Target.h:2121
StackFrameRecognizerManager & GetFrameRecognizerManager()
Definition Target.h:2016
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:6074
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:2100
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:6096
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:1992
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:1042
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition Target.h:1266
const ArchSpec & GetArchitecture() const
Definition Target.h:1308
WatchpointList & GetWatchpointList()
Definition Target.h:978
@ eBroadcastBitWatchpointChanged
Definition Target.h:609
@ eBroadcastBitBreakpointChanged
Definition Target.h:606
@ eBroadcastBitNewTargetCreated
Definition Target.h:612
unsigned m_next_persistent_variable_index
Definition Target.h:2164
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:2189
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:2168
TypeSystemMap m_scratch_type_system_map
Definition Target.h:2135
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:734
SectionLoadHistory m_section_load_history
Definition Target.h:2114
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:690
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:722
const std::string & GetLabel() const
Definition Target.h:703
std::map< lldb::user_id_t, HookSP > HookCollection
Definition Target.h:2161
bool m_valid
This records the last natural stop at which we ran a stop-hook.
Definition Target.h:2157
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:2128
Status CreateBreakpointsFromFile(const FileSpec &file, BreakpointIDList &new_bps)
Definition Target.cpp:1360
Debugger & m_debugger
Definition Target.h:2099
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:2175
HookCollection m_hooks
Definition Target.h:2162
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:1933
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:2111
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:1994
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:2146
static void SetDefaultArchitecture(const ArchSpec &arch)
Definition Target.cpp:2913
lldb::BreakpointSP m_last_created_breakpoint
Definition Target.h:2126
lldb::WatchpointSP GetLastCreatedWatchpoint()
Definition Target.h:974
bool RemoveStopHookByID(lldb::user_id_t uid)
Definition Target.cpp:3192
friend class Debugger
Definition Target.h:601
lldb::BreakpointSP GetLastCreatedBreakpoint()
Definition Target.h:866
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:2108
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:2036
UserID(lldb::user_id_t uid=LLDB_INVALID_UID)
Construct with optional user ID.
Definition UserID.h:33