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
231
233
234 llvm::StringRef GetExpressionPrefixContents();
235
236 uint64_t GetExprErrorLimit() const;
237
238 uint64_t GetExprAllocAddress() const;
239
240 uint64_t GetExprAllocSize() const;
241
242 uint64_t GetExprAllocAlign() const;
243
244 bool GetUseHexImmediates() const;
245
246 bool GetUseFastStepping() const;
247
249
251
252 /// Set the target-wide target.load-script-from-symbol-file setting.
253 /// See \c SetAutoLoadScriptsForModule for overriding this setting
254 /// per-module.
256
258
260
262
263 bool GetUserSpecifiedTrapHandlerNames(Args &args) const;
264
265 void SetUserSpecifiedTrapHandlerNames(const Args &args);
266
268
270
272
274
276
277 void SetProcessLaunchInfo(const ProcessLaunchInfo &launch_info);
278
279 bool GetInjectLocalVariables(ExecutionContext *exe_ctx) const;
280
281 bool GetUseDIL(ExecutionContext *exe_ctx) const;
282
283 void SetUseDIL(ExecutionContext *exe_ctx, bool b);
284
285 bool GetUseDILForCreatingValues() const;
286
287 void SetUseDILForCreatingValues(bool b);
288
290
292
293 bool GetAutoInstallMainExecutable() const;
294
296
297 void SetDebugUtilityExpression(bool debug);
298
299 bool GetDebugUtilityExpression() const;
300
301 void SetCheckValueObjectOwnership(bool check);
302
303 bool GetCheckValueObjectOwnership() const;
304
305 std::optional<LoadScriptFromSymFile>
306 GetAutoLoadScriptsForModule(llvm::StringRef module_name) const;
307
308 /// Set the \c LoadScriptFromSymFile for a module called \c module_name
309 /// (excluding file extension). LLDB will prefer this over the target-wide
310 /// target.load-script-from-symbol-file setting
311 /// (see \c SetLoadScriptFromSymbolFile).
312 void SetAutoLoadScriptsForModule(llvm::StringRef module_name,
313 LoadScriptFromSymFile load_style);
314
315private:
316 std::optional<bool>
317 GetExperimentalPropertyValue(size_t prop_idx,
318 ExecutionContext *exe_ctx = nullptr) const;
319
320 // Callbacks for m_launch_info.
331
332 // Settings checker for target.jit-save-objects-dir:
333 void CheckJITObjectsDir();
334
336
337 // Member variables.
339 std::unique_ptr<TargetExperimentalProperties> m_experimental_properties_up;
341};
342
344public:
346
347// MSVC has a bug here that reports C4268: 'const' static/global data
348// initialized with compiler generated default constructor fills the object
349// with zeros. Confirmed that MSVC is *not* zero-initializing, it's just a
350// bogus warning.
351#if defined(_MSC_VER)
352#pragma warning(push)
353#pragma warning(disable : 4268)
354#endif
355 static constexpr std::chrono::milliseconds default_timeout{500};
356#if defined(_MSC_VER)
357#pragma warning(pop)
358#endif
359
362
364
368
370
371 void SetLanguage(lldb::LanguageType language_type) {
372 m_language = SourceLanguage(language_type);
373 }
374
376 m_preferred_lookup_contexts = std::move(contexts);
377 }
378
382
383 /// Set the language using a pair of language code and version as
384 /// defined by the DWARF 6 specification.
385 /// WARNING: These codes may change until DWARF 6 is finalized.
386 void SetLanguage(uint16_t name, uint32_t version) {
387 m_language = SourceLanguage(name, version);
388 }
389
390 bool DoesCoerceToId() const { return m_coerce_to_id; }
391
392 const char *GetPrefix() const {
393 return (m_prefix.empty() ? nullptr : m_prefix.c_str());
394 }
395
396 void SetPrefix(const char *prefix) {
397 if (prefix && prefix[0])
398 m_prefix = prefix;
399 else
400 m_prefix.clear();
401 }
402
403 void SetCoerceToId(bool coerce = true) { m_coerce_to_id = coerce; }
404
405 bool DoesUnwindOnError() const { return m_unwind_on_error; }
406
407 void SetUnwindOnError(bool unwind = false) { m_unwind_on_error = unwind; }
408
410
411 void SetIgnoreBreakpoints(bool ignore = false) {
412 m_ignore_breakpoints = ignore;
413 }
414
415 bool DoesKeepInMemory() const { return m_keep_in_memory; }
416
417 void SetKeepInMemory(bool keep = true) { m_keep_in_memory = keep; }
418
420
421 void
425
426 const Timeout<std::micro> &GetTimeout() const { return m_timeout; }
427
428 void SetTimeout(const Timeout<std::micro> &timeout) { m_timeout = timeout; }
429
433
435 m_one_thread_timeout = timeout;
436 }
437
438 bool GetTryAllThreads() const { return m_try_others; }
439
440 void SetTryAllThreads(bool try_others = true) { m_try_others = try_others; }
441
442 bool GetStopOthers() const { return m_stop_others; }
443
444 void SetStopOthers(bool stop_others = true) { m_stop_others = stop_others; }
445
446 bool GetDebug() const { return m_debug; }
447
448 void SetDebug(bool b) {
449 m_debug = b;
450 if (m_debug)
452 }
453
455
457
458 bool GetColorizeErrors() const { return m_ansi_color_errors; }
459
461
462 bool GetTrapExceptions() const { return m_trap_exceptions; }
463
465
466 bool GetStopOnFork() const { return m_stop_on_fork; }
467
468 void SetStopOnFork(bool b) { m_stop_on_fork = b; }
469
470 bool GetREPLEnabled() const { return m_repl; }
471
472 void SetREPLEnabled(bool b) { m_repl = b; }
473
476 m_cancel_callback = callback;
477 }
478
480 return ((m_cancel_callback != nullptr)
482 : false);
483 }
484
485 // Allows the expression contents to be remapped to point to the specified
486 // file and line using #line directives.
487 void SetPoundLine(const char *path, uint32_t line) const {
488 if (path && path[0]) {
489 m_pound_line_file = path;
490 m_pound_line_line = line;
491 } else {
492 m_pound_line_file.clear();
494 }
495 }
496
497 const char *GetPoundLineFilePath() const {
498 return (m_pound_line_file.empty() ? nullptr : m_pound_line_file.c_str());
499 }
500
501 uint32_t GetPoundLineLine() const { return m_pound_line_line; }
502
504
508
510
512
513 void SetRetriesWithFixIts(uint64_t number_of_retries) {
514 m_retries_with_fixits = number_of_retries;
515 }
516
517 uint64_t GetRetriesWithFixIts() const { return m_retries_with_fixits; }
518
520
522
523 /// Set language-plugin specific option called \c option_name to
524 /// the specified boolean \c value.
525 llvm::Error SetBooleanLanguageOption(llvm::StringRef option_name, bool value);
526
527 /// Get the language-plugin specific boolean option called \c option_name.
528 ///
529 /// If the option doesn't exist or is not a boolean option, returns false.
530 /// Otherwise returns the boolean value of the option.
531 llvm::Expected<bool>
532 GetBooleanLanguageOption(llvm::StringRef option_name) const;
533
534 void SetCppIgnoreContextQualifiers(bool value);
535
537
538 void SetTryDILFirst(bool b) { m_try_DIL_first = b; }
539
540 bool GetTryDILFirst() const { return m_try_DIL_first; }
541
542private:
544
546
549 std::string m_prefix;
550 bool m_coerce_to_id = false;
551 bool m_unwind_on_error = true;
553 bool m_keep_in_memory = false;
554 bool m_try_others = true;
555 bool m_stop_others = true;
556 bool m_debug = false;
557 bool m_trap_exceptions = true;
558 bool m_stop_on_fork = false;
559 bool m_repl = false;
565 /// True if the executed code should be treated as utility code that is only
566 /// used by LLDB internally.
568 /// If enabled, Data Inspection Language (DIL) should attempt to evaluate the
569 /// expression first. If DIL is not called or fails, the evaluation falls
570 /// back to UserExpression.
571 bool m_try_DIL_first = false;
572
577 void *m_cancel_callback_baton = nullptr;
578 // If m_pound_line_file is not empty and m_pound_line_line is non-zero, use
579 // #line %u "%s" before the expression content to remap where the source
580 // originates
581 mutable std::string m_pound_line_file;
582 mutable uint32_t m_pound_line_line = 0;
583
584 /// Dictionary mapping names of language-plugin specific options
585 /// to values.
587
588 /// During expression evaluation, any SymbolContext in this list will be
589 /// used for symbol/function lookup before any other context (except for
590 /// the module corresponding to the current frame).
592};
593
594// Target
595class Target : public std::enable_shared_from_this<Target>,
596 public TargetProperties,
597 public Broadcaster,
599 public ModuleList::Notifier {
600public:
601 friend class TargetList;
602 friend class Debugger;
603 friend class TargetAPIMutex;
604
605 /// Broadcaster event bits definitions.
606 enum {
614 };
615
616 // These two functions fill out the Broadcaster interface:
617
618 static llvm::StringRef GetStaticBroadcasterClass();
619
620 llvm::StringRef GetBroadcasterClass() const override {
622 }
623
624 // This event data class is for use by the TargetList to broadcast new target
625 // notifications.
626 class TargetEventData : public EventData {
627 public:
628 TargetEventData(const lldb::TargetSP &target_sp);
629
630 TargetEventData(const lldb::TargetSP &target_sp,
631 const ModuleList &module_list);
632
633 // Constructor for eBroadcastBitNewTargetCreated events. For this event
634 // type:
635 // - target_sp is the parent target (the subject/broadcaster of the event)
636 // - created_target_sp is the newly created target
637 TargetEventData(const lldb::TargetSP &target_sp,
638 const lldb::TargetSP &created_target_sp);
639
641
642 static llvm::StringRef GetFlavorString();
643
644 llvm::StringRef GetFlavor() const override {
646 }
647
648 void Dump(Stream *s) const override;
649
650 static const TargetEventData *GetEventDataFromEvent(const Event *event_ptr);
651
652 static lldb::TargetSP GetTargetFromEvent(const Event *event_ptr);
653
654 // For eBroadcastBitNewTargetCreated events, returns the newly created
655 // target. For other event types, returns an invalid target.
656 static lldb::TargetSP GetCreatedTargetFromEvent(const Event *event_ptr);
657
658 static ModuleList GetModuleListFromEvent(const Event *event_ptr);
659
660 const lldb::TargetSP &GetTarget() const { return m_target_sp; }
661
663 return m_created_target_sp;
664 }
665
666 const ModuleList &GetModuleList() const { return m_module_list; }
667
668 private:
672
674 const TargetEventData &operator=(const TargetEventData &) = delete;
675 };
676
677 ~Target() override;
678
679 static void SettingsInitialize();
680
681 static void SettingsTerminate();
682
684
686
688
689 static void SetDefaultArchitecture(const ArchSpec &arch);
690
691 bool IsDummyTarget() const { return m_is_dummy_target; }
692
693 /// Get the globally unique ID for this target.
694 ///
695 /// This ID is unique across all debugger instances and all targets,
696 /// within the same lldb process. The ID is assigned
697 /// during target construction and remains constant for the target's lifetime.
698 /// The first target created (typically the dummy target) gets ID 1.
699 ///
700 /// \return
701 /// The globally unique ID for this target.
703
704 const std::string &GetLabel() const { return m_label; }
705
706 /// Set a label for a target.
707 ///
708 /// The label cannot be used by another target or be only integral.
709 ///
710 /// \return
711 /// The label for this target or an error if the label didn't match the
712 /// requirements.
713 llvm::Error SetLabel(llvm::StringRef label);
714
715 /// Get the target session name for this target.
716 ///
717 /// Provides a meaningful name for IDEs or tools to display for dynamically
718 /// created targets. Defaults to "Session {ID}" based on the globally unique
719 /// ID.
720 ///
721 /// \return
722 /// The target session name for this target.
723 llvm::StringRef GetTargetSessionName() { return m_target_session_name; }
724
725 /// Set the target session name for this target.
726 ///
727 /// This should typically be set along with the event
728 /// eBroadcastBitNewTargetCreated. Useful for scripts or triggers that
729 /// automatically create targets and want to provide meaningful names that
730 /// IDEs or other tools can display to help users identify the origin and
731 /// purpose of each target.
732 ///
733 /// \param[in] target_session_name
734 /// The target session name to set for this target.
735 void SetTargetSessionName(llvm::StringRef target_session_name) {
736 m_target_session_name = target_session_name.str();
737 }
738
739 /// Find a binary on the system and return its Module,
740 /// or return an existing Module that is already in the Target.
741 ///
742 /// Given a ModuleSpec, find a binary satisifying that specification,
743 /// or identify a matching Module already present in the Target,
744 /// and return a shared pointer to it.
745 ///
746 /// Note that this function previously also preloaded the module's symbols
747 /// depending on a setting. This function no longer does any module
748 /// preloading because that can potentially cause deadlocks when called in
749 /// parallel with this function.
750 ///
751 /// \param[in] module_spec
752 /// The criteria that must be matched for the binary being loaded.
753 /// e.g. UUID, architecture, file path.
754 ///
755 /// \param[in] notify
756 /// If notify is true, and the Module is new to this Target,
757 /// Target::ModulesDidLoad will be called. See note in
758 /// Target::ModulesDidLoad about thread-safety with
759 /// Target::GetOrCreateModule.
760 /// If notify is false, it is assumed that the caller is adding
761 /// multiple Modules and will call ModulesDidLoad with the
762 /// full list at the end.
763 /// ModulesDidLoad must be called when a Module/Modules have
764 /// been added to the target, one way or the other.
765 ///
766 /// \param[out] error_ptr
767 /// Optional argument, pointing to a Status object to fill in
768 /// with any results / messages while attempting to find/load
769 /// this binary. Many callers will be internal functions that
770 /// will handle / summarize the failures in a custom way and
771 /// don't use these messages.
772 ///
773 /// \param[in] invoke_symbol_locators
774 /// Whether to search beyond the Target's modules, the shared module list
775 /// and the locate module callback, i.e. with the platform and the symbol
776 /// locators. A caller that has already searched passes false.
777 ///
778 /// \return
779 /// An empty ModuleSP will be returned if no matching file
780 /// was found. If error_ptr was non-nullptr, an error message
781 /// will likely be provided.
782 lldb::ModuleSP GetOrCreateModule(const ModuleSpec &module_spec, bool notify,
783 Status *error_ptr = nullptr,
784 bool invoke_symbol_locators = true);
785
786 // Settings accessors
787
789
790 /// Returns a handle resolved to the mutex to serialize on before
791 /// touching the target through the SB API. The handle isn't locked yet;
792 /// lock()/try_lock() it (typically via std::lock_guard<TargetAPIMutex>/
793 /// std::unique_lock<TargetAPIMutex>) to actually acquire it.
795
797
798 void CleanupProcess();
799
800 /// Dump a description of this object to a Stream.
801 ///
802 /// Dump a description of the contents of this object to the
803 /// supplied stream \a s. The dumped content will be only what has
804 /// been loaded or parsed up to this point at which this function
805 /// is called, so this is a good way to see what has been parsed
806 /// in a target.
807 ///
808 /// \param[in] s
809 /// The stream to which to dump the object description.
810 void Dump(Stream *s, lldb::DescriptionLevel description_level);
811
812 // If listener_sp is null, the listener of the owning Debugger object will be
813 // used.
815 llvm::StringRef plugin_name,
816 const FileSpec *crash_file,
817 bool can_connect);
818
819 const lldb::ProcessSP &GetProcessSP() const;
820
821 bool IsValid() { return m_valid; }
822
823 void Destroy();
824
825 Status Launch(ProcessLaunchInfo &launch_info,
826 Stream *stream); // Optional stream to receive first stop info
827
828 Status Attach(ProcessAttachInfo &attach_info,
829 Stream *stream); // Optional stream to receive first stop info
830
831 /// Add or update a scripted frame provider descriptor for this target.
832 /// All new threads in this target will check if they match any descriptors
833 /// to create their frame providers.
834 ///
835 /// \param[in] descriptor
836 /// The descriptor to add or update.
837 ///
838 /// \return
839 /// The descriptor identifier if the registration succeeded, otherwise an
840 /// llvm::Error.
841 llvm::Expected<uint32_t> AddScriptedFrameProviderDescriptor(
842 const ScriptedFrameProviderDescriptor &descriptor);
843
844 /// Remove a scripted frame provider descriptor by id.
845 ///
846 /// \param[in] id
847 /// The id of the descriptor to remove.
848 ///
849 /// \return
850 /// True if a descriptor was removed, false if no descriptor with that
851 /// id existed.
853
854 /// Clear all scripted frame provider descriptors for this target.
856
857 /// Get all scripted frame provider descriptors for this target.
858 const llvm::MapVector<uint32_t, ScriptedFrameProviderDescriptor> &
860
861protected:
862 /// Invalidate all potentially cached frame providers for all threads
863 /// and trigger a stack changed event for all threads.
865
866public:
867 // This part handles the breakpoints.
868
869 BreakpointList &GetBreakpointList(bool internal = false);
870
871 const BreakpointList &GetBreakpointList(bool internal = false) const;
872
876
878
880
881 // Use this to create a file and line breakpoint to a given module or all
882 // module it is nullptr
883 lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules,
884 const FileSpec &file, uint32_t line_no,
885 uint32_t column, lldb::addr_t offset,
886 LazyBool check_inlines,
887 LazyBool skip_prologue, bool internal,
888 bool request_hardware,
889 LazyBool move_to_nearest_code);
890
891 // Use this to create breakpoint that matches regex against the source lines
892 // in files given in source_file_list: If function_names is non-empty, also
893 // filter by function after the matches are made.
895 const FileSpecList *containingModules,
896 const FileSpecList *source_file_list,
897 const std::unordered_set<std::string> &function_names,
898 RegularExpression source_regex, bool internal, bool request_hardware,
899 LazyBool move_to_nearest_code);
900
901 // Use this to create a breakpoint from a load address
902 lldb::BreakpointSP CreateBreakpoint(lldb::addr_t load_addr, bool internal,
903 bool request_hardware);
904
905 // Use this to create a breakpoint from a file address and a module file spec
907 bool internal,
908 const FileSpec &file_spec,
909 bool request_hardware);
910
911 // Use this to create Address breakpoints:
912 lldb::BreakpointSP CreateBreakpoint(const Address &addr, bool internal,
913 bool request_hardware);
914
915 // Use this to create a function breakpoint by regexp in
916 // containingModule/containingSourceFiles, or all modules if it is nullptr
917 // When "skip_prologue is set to eLazyBoolCalculate, we use the current
918 // target setting, else we use the values passed in
920 const FileSpecList *containingModules,
921 const FileSpecList *containingSourceFiles, RegularExpression func_regexp,
922 lldb::LanguageType requested_language, LazyBool skip_prologue,
923 bool internal, bool request_hardware);
924
925 // Use this to create a function breakpoint by name in containingModule, or
926 // all modules if it is nullptr When "skip_prologue is set to
927 // eLazyBoolCalculate, we use the current target setting, else we use the
928 // values passed in. func_name_type_mask is or'ed values from the
929 // FunctionNameType enum.
931 const FileSpecList *containingModules,
932 const FileSpecList *containingSourceFiles, const char *func_name,
933 lldb::FunctionNameType func_name_type_mask, lldb::LanguageType language,
934 lldb::addr_t offset, bool offset_is_insn_count, LazyBool skip_prologue,
935 bool internal, bool request_hardware);
936
938 CreateExceptionBreakpoint(enum lldb::LanguageType language, bool catch_bp,
939 bool throw_bp, bool internal,
940 Args *additional_args = nullptr,
941 Status *additional_args_error = nullptr);
942
944 const llvm::StringRef class_name, const FileSpecList *containingModules,
945 const FileSpecList *containingSourceFiles, bool internal,
946 bool request_hardware, StructuredData::ObjectSP extra_args_sp,
947 Status *creation_error = nullptr);
948
949 // This is the same as the func_name breakpoint except that you can specify a
950 // vector of names. This is cheaper than a regular expression breakpoint in
951 // the case where you just want to set a breakpoint on a set of names you
952 // already know. func_name_type_mask is or'ed values from the
953 // FunctionNameType enum.
955 const FileSpecList *containingModules,
956 const FileSpecList *containingSourceFiles, const char *func_names[],
957 size_t num_names, lldb::FunctionNameType func_name_type_mask,
958 lldb::LanguageType language, lldb::addr_t offset, LazyBool skip_prologue,
959 bool internal, bool request_hardware);
960
962 CreateBreakpoint(const FileSpecList *containingModules,
963 const FileSpecList *containingSourceFiles,
964 const std::vector<std::string> &func_names,
965 lldb::FunctionNameType func_name_type_mask,
966 lldb::LanguageType language, lldb::addr_t m_offset,
967 LazyBool skip_prologue, bool internal,
968 bool request_hardware);
969
970 // Use this to create a general breakpoint:
972 lldb::BreakpointResolverSP &resolver_sp,
973 bool internal, bool request_hardware,
974 bool resolve_indirect_symbols);
975
976 // Use this to create a watchpoint:
978 const CompilerType *type, uint32_t kind,
979 Status &error);
980
984
986
987 // Manages breakpoint names:
988 void AddNameToBreakpoint(BreakpointID &id, llvm::StringRef name,
989 Status &error);
990
991 void AddNameToBreakpoint(lldb::BreakpointSP &bp_sp, llvm::StringRef name,
992 Status &error);
993
995 llvm::StringRef name);
996
997 BreakpointName *FindBreakpointName(llvm::StringRef name, bool can_create,
998 Status &error);
999
1000 void DeleteBreakpointName(llvm::StringRef name);
1001
1003 const BreakpointOptions &options,
1004 const BreakpointName::Permissions &permissions);
1006
1007 void AddBreakpointName(std::unique_ptr<BreakpointName> bp_name);
1008
1009 void GetBreakpointNames(std::vector<std::string> &names);
1010
1011 // This call removes ALL breakpoints regardless of permission.
1012 void RemoveAllBreakpoints(bool internal_also = false);
1013
1014 // This removes all the breakpoints, but obeys the ePermDelete on them.
1016
1017 void DisableAllBreakpoints(bool internal_also = false);
1018
1020
1021 void EnableAllBreakpoints(bool internal_also = false);
1022
1024
1026
1028
1030
1031 /// Resets the hit count of all breakpoints.
1033
1034 // This callout implements the "Resolver Override". When we have determined
1035 // the Resolver for a given breakpoint, we pass each of the registered
1036 // overrides the "natural" resolver, and then we will use whatever resolver
1037 // we get back from it if it is non-null.
1038 // We keep a list of overrides ordered by ID - and we search through the list
1039 // by ID order, and the first override that returns a non-null Resolver will
1040 // be the one we use. If no overrides return an override resolver, we'll use
1041 // the original one.
1042
1043 /// This is the abstract version of the override. Particular implementations,
1044 /// e.g. the scripted override resolver, instantiate actual versions of the
1045 /// class. The constructor takes the target this resolver is registered in, a
1046 /// description for the override and a mask of the resolver types this
1047 /// overrides, made of elements of the BreakpointResolverType enum.
1048 class BreakpointResolverOverride;
1050 std::unique_ptr<BreakpointResolverOverride>;
1051
1053 public:
1054 BreakpointResolverOverride(Target &target, const std::string &description,
1055 uint64_t type_mask)
1056 : m_target(target), m_desc(description), m_type_mask(type_mask) {}
1057
1059
1063 // Return whether constructing this resolver was successful.
1064 virtual llvm::Error Validate() = 0;
1065 const std::string &GetDescription() { return m_desc; }
1066 uint64_t GetTypeMask() { return m_type_mask; }
1067 std::string DescribeTypeMask();
1068
1069 protected:
1071 std::string m_desc;
1072 uint64_t m_type_mask = 0;
1073 };
1074
1075 /// Add a breakpoint override resolver. This version can't fail.
1079 m_breakpoint_overrides.emplace(m_override_id, std::move(override_up));
1080 m_override_id++;
1081 return id_used;
1082 }
1083
1084 /// Add a breakpoint override resolver. Return the ID or an error:
1085 llvm::Expected<lldb::user_id_t>
1086 AddBreakpointResolverOverride(llvm::StringRef class_name, uint64_t type_mask,
1087 StructuredData::DictionarySP args_data_sp,
1088 llvm::StringRef description);
1089
1091 size_t removed = m_breakpoint_overrides.erase(override_id);
1092 return removed == 1;
1093 }
1094
1096
1099
1100 /// Describe the breakpoint overrides. If ixds is empty, list all. Otherwise
1101 /// list the overrides whose ids match the ones given in idxs. The matched
1102 /// elements are removed from the list, so any elements remaining in idxs are
1103 /// indexes that are not breakpoint override indexes.
1105 std::vector<lldb::user_id_t> &idxs,
1106 uint32_t terminal_width, bool use_color);
1107
1108 // The flag 'end_to_end', default to true, signifies that the operation is
1109 // performed end to end, for both the debugger and the debuggee.
1110
1111 bool RemoveAllWatchpoints(bool end_to_end = true);
1112
1113 bool DisableAllWatchpoints(bool end_to_end = true);
1114
1115 bool EnableAllWatchpoints(bool end_to_end = true);
1116
1118
1120
1121 bool IgnoreAllWatchpoints(uint32_t ignore_count);
1122
1124
1126
1128
1129 bool IgnoreWatchpointByID(lldb::watch_id_t watch_id, uint32_t ignore_count);
1130
1132 const BreakpointIDList &bp_ids,
1133 bool append);
1134
1136 BreakpointIDList &new_bps);
1137
1139 std::vector<std::string> &names,
1140 BreakpointIDList &new_bps);
1141
1142 /// Get \a load_addr as a callable code load address for this target
1143 ///
1144 /// Take \a load_addr and potentially add any address bits that are
1145 /// needed to make the address callable. For ARM this can set bit
1146 /// zero (if it already isn't) if \a load_addr is a thumb function.
1147 /// If \a addr_class is set to AddressClass::eInvalid, then the address
1148 /// adjustment will always happen. If it is set to an address class
1149 /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
1150 /// returned.
1152 lldb::addr_t load_addr,
1153 AddressClass addr_class = AddressClass::eInvalid) const;
1154
1155 /// Get \a load_addr as an opcode for this target.
1156 ///
1157 /// Take \a load_addr and potentially strip any address bits that are
1158 /// needed to make the address point to an opcode. For ARM this can
1159 /// clear bit zero (if it already isn't) if \a load_addr is a
1160 /// thumb function and load_addr is in code.
1161 /// If \a addr_class is set to AddressClass::eInvalid, then the address
1162 /// adjustment will always happen. If it is set to an address class
1163 /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
1164 /// returned.
1167 AddressClass addr_class = AddressClass::eInvalid) const;
1168
1169 // Get load_addr as breakable load address for this target. Take a addr and
1170 // check if for any reason there is a better address than this to put a
1171 // breakpoint on. If there is then return that address. For MIPS, if
1172 // instruction at addr is a delay slot instruction then this method will find
1173 // the address of its previous instruction and return that address.
1175
1176 /// This call may preload module symbols, and may do so in parallel depending
1177 /// on the following target settings:
1178 /// - TargetProperties::GetPreloadSymbols()
1179 /// - TargetProperties::GetParallelModuleLoad()
1180 ///
1181 /// Warning: if preloading is active and this is called in parallel with
1182 /// Target::GetOrCreateModule, this may result in a ABBA deadlock situation.
1183 void ModulesDidLoad(ModuleList &module_list);
1184
1185 void ModulesDidUnload(ModuleList &module_list, bool delete_locations);
1186
1187 void SymbolsDidLoad(ModuleList &module_list);
1188
1189 void ClearModules(bool delete_locations);
1190
1191 /// Called as the last function in Process::DidExec().
1192 ///
1193 /// Process::DidExec() will clear a lot of state in the process,
1194 /// then try to reload a dynamic loader plugin to discover what
1195 /// binaries are currently available and then this function should
1196 /// be called to allow the target to do any cleanup after everything
1197 /// has been figured out. It can remove breakpoints that no longer
1198 /// make sense as the exec might have changed the target
1199 /// architecture, and unloaded some modules that might get deleted.
1200 void DidExec();
1201
1202 /// Gets the module for the main executable.
1203 ///
1204 /// Each process has a notion of a main executable that is the file
1205 /// that will be executed or attached to. Executable files can have
1206 /// dependent modules that are discovered from the object files, or
1207 /// discovered at runtime as things are dynamically loaded.
1208 ///
1209 /// \return
1210 /// The first module of type ObjectFile::eTypeExecutable. Failing that,
1211 /// the module set by RebuildModuleListWithExecutable or
1212 /// MarkExecutableModule while the target still holds it, which can be a
1213 /// shared library (an ELF PIE). Otherwise, nullptr.
1214 ///
1215 /// \see DynamicLoader
1216 /// \see ObjectFile::GetDependentModules (FileSpecList&)
1217 /// \see Target::RebuildModuleListWithExecutable(lldb::ModuleSP&)
1219
1221
1222 /// Make \a module_sp the main executable without clearing the other images,
1223 /// unlike RebuildModuleListWithExecutable. Has no effect until the target
1224 /// holds it.
1225 void MarkExecutableModule(const lldb::ModuleSP &module_sp);
1226
1227 /// Clear the module list and rebuild it around a new main executable.
1228 ///
1229 /// Each process has a notion of a main executable that is the file
1230 /// that will be executed or attached to. Executable files can have
1231 /// dependent modules that are discovered from the object files, or
1232 /// discovered at runtime as things are dynamically loaded.
1233 ///
1234 /// Rebuilding causes any of the current dependent
1235 /// image information to be cleared and replaced with the static
1236 /// dependent image information found by calling
1237 /// ObjectFile::GetDependentModules (FileSpecList&) on the main
1238 /// executable and any modules on which it depends. Calling
1239 /// Process::GetImages() will return the newly found images that
1240 /// were obtained from all of the object files.
1241 ///
1242 /// \param[in] module_sp
1243 /// A shared pointer reference to the module that will become
1244 /// the main executable for this process.
1245 ///
1246 /// \param[in] load_dependent_files
1247 /// If \b true then ask the object files to track down any
1248 /// known dependent files.
1249 ///
1250 /// \see ObjectFile::GetDependentModules (FileSpecList&)
1251 /// \see Process::GetImages()
1253 lldb::ModuleSP &module_sp,
1254 LoadDependentFiles load_dependent_files = eLoadDependentsDefault);
1255
1256 bool LoadScriptingResources(std::list<Status> &errors,
1257 bool continue_on_error = true) {
1258 return m_images.LoadScriptingResourcesInTarget(this, errors,
1259 continue_on_error);
1260 }
1261
1262 /// Get accessor for the images for this process.
1263 ///
1264 /// Each process has a notion of a main executable that is the file
1265 /// that will be executed or attached to. Executable files can have
1266 /// dependent modules that are discovered from the object files, or
1267 /// discovered at runtime as things are dynamically loaded. After
1268 /// a main executable has been set, the images will contain a list
1269 /// of all the files that the executable depends upon as far as the
1270 /// object files know. These images will usually contain valid file
1271 /// virtual addresses only. When the process is launched or attached
1272 /// to, the DynamicLoader plug-in will discover where these images
1273 /// were loaded in memory and will resolve the load virtual
1274 /// addresses is each image, and also in images that are loaded by
1275 /// code.
1276 ///
1277 /// \return
1278 /// A list of Module objects in a module list.
1279 const ModuleList &GetImages() const { return m_images; }
1280
1282
1283 /// Return whether this FileSpec corresponds to a module that should be
1284 /// considered for general searches.
1285 ///
1286 /// This API will be consulted by the SearchFilterForUnconstrainedSearches
1287 /// and any module that returns \b true will not be searched. Note the
1288 /// SearchFilterForUnconstrainedSearches is the search filter that
1289 /// gets used in the CreateBreakpoint calls when no modules is provided.
1290 ///
1291 /// The target call at present just consults the Platform's call of the
1292 /// same name.
1293 ///
1294 /// \param[in] module_spec
1295 /// Path to the module.
1296 ///
1297 /// \return \b true if the module should be excluded, \b false otherwise.
1298 bool ModuleIsExcludedForUnconstrainedSearches(const FileSpec &module_spec);
1299
1300 /// Return whether this module should be considered for general searches.
1301 ///
1302 /// This API will be consulted by the SearchFilterForUnconstrainedSearches
1303 /// and any module that returns \b true will not be searched. Note the
1304 /// SearchFilterForUnconstrainedSearches is the search filter that
1305 /// gets used in the CreateBreakpoint calls when no modules is provided.
1306 ///
1307 /// The target call at present just consults the Platform's call of the
1308 /// same name.
1309 ///
1310 /// FIXME: When we get time we should add a way for the user to set modules
1311 /// that they
1312 /// don't want searched, in addition to or instead of the platform ones.
1313 ///
1314 /// \param[in] module_sp
1315 /// A shared pointer reference to the module that checked.
1316 ///
1317 /// \return \b true if the module should be excluded, \b false otherwise.
1318 bool
1320
1321 const ArchSpec &GetArchitecture() const { return m_arch.GetSpec(); }
1322
1323 /// Returns the name of the target's ABI plugin.
1324 llvm::StringRef GetABIName() const;
1325
1326 /// Set the architecture for this target.
1327 ///
1328 /// If the current target has no Images read in, then this just sets the
1329 /// architecture, which will be used to select the architecture of the
1330 /// ExecutableModule when that is set. If the current target has an
1331 /// ExecutableModule, then calling SetArchitecture with a different
1332 /// architecture from the currently selected one will reset the
1333 /// ExecutableModule to that slice of the file backing the ExecutableModule.
1334 /// If the file backing the ExecutableModule does not contain a fork of this
1335 /// architecture, then this code will return false, and the architecture
1336 /// won't be changed. If the input arch_spec is the same as the already set
1337 /// architecture, this is a no-op.
1338 ///
1339 /// \param[in] arch_spec
1340 /// The new architecture.
1341 ///
1342 /// \param[in] set_platform
1343 /// If \b true, then the platform will be adjusted if the currently
1344 /// selected platform is not compatible with the architecture being set.
1345 /// If \b false, then just the architecture will be set even if the
1346 /// currently selected platform isn't compatible (in case it might be
1347 /// manually set following this function call).
1348 ///
1349 /// \param[in] merged
1350 /// If true, arch_spec is merged with the current
1351 /// architecture. Otherwise it's replaced.
1352 ///
1353 /// \return
1354 /// \b true if the architecture was successfully set, \b false otherwise.
1355 bool SetArchitecture(const ArchSpec &arch_spec, bool set_platform = false,
1356 bool merge = true);
1357
1358 bool MergeArchitecture(const ArchSpec &arch_spec);
1359
1360 Architecture *GetArchitecturePlugin() const { return m_arch.GetPlugin(); }
1361
1362 Debugger &GetDebugger() const { return m_debugger; }
1363
1364 size_t ReadMemoryFromFileCache(const Address &addr, void *dst, size_t dst_len,
1365 Status &error);
1366
1367 // Reading memory through the target allows us to skip going to the process
1368 // for reading memory if possible and it allows us to try and read from any
1369 // constant sections in our object files on disk. If you always want live
1370 // program memory, read straight from the process. If you possibly want to
1371 // read from const sections in object files, read from the target. This
1372 // version of ReadMemory will try and read memory from the process if the
1373 // process is alive. The order is:
1374 // 1 - if (force_live_memory == false) and the address falls in a read-only
1375 // section, then read from the file cache
1376 // 2 - if there is a process, then read from memory
1377 // 3 - if there is no process, then read from the file cache
1378 //
1379 // If did_read_live_memory is provided, will indicate if the read was from
1380 // live memory, or from file contents. A caller which needs to treat these two
1381 // sources differently should use this argument to disambiguate where the data
1382 // was read from.
1383 //
1384 // The method is virtual for mocking in the unit tests.
1385 virtual size_t ReadMemory(const Address &addr, void *dst, size_t dst_len,
1386 Status &error, bool force_live_memory = false,
1387 lldb::addr_t *load_addr_ptr = nullptr,
1388 bool *did_read_live_memory = nullptr);
1389
1390 size_t ReadCStringFromMemory(const Address &addr, std::string &out_str,
1391 Status &error, bool force_live_memory = false);
1392
1393 size_t ReadCStringFromMemory(const Address &addr, char *dst,
1394 size_t dst_max_len, Status &result_error,
1395 bool force_live_memory = false);
1396
1397 /// Read a null-terminated string from memory
1398 ///
1399 /// This function will read a cache page at a time until a null terminator
1400 /// is found. It will stop reading if an aligned null terminator of \a
1401 /// type_width bytes is not found before reading \a cstr_max_len bytes. The
1402 /// results are always guaranteed to be null-terminated, and that no more
1403 /// than (max_bytes - type_width) bytes will be read.
1404 ///
1405 /// \param[in] addr
1406 /// The address to start the memory read.
1407 ///
1408 /// \param[in] dst
1409 /// A character buffer containing at least max_bytes.
1410 ///
1411 /// \param[in] max_bytes
1412 /// The maximum number of bytes to read.
1413 ///
1414 /// \param[in] error
1415 /// The error status of the read operation.
1416 ///
1417 /// \param[in] type_width
1418 /// The size of the null terminator (1 to 4 bytes per
1419 /// character). Defaults to 1.
1420 ///
1421 /// \return
1422 /// The error status or the number of bytes prior to the null terminator.
1423 size_t ReadStringFromMemory(const Address &addr, char *dst, size_t max_bytes,
1424 Status &error, size_t type_width,
1425 bool force_live_memory = true);
1426
1427 size_t ReadScalarIntegerFromMemory(const Address &addr, uint32_t byte_size,
1428 bool is_signed, Scalar &scalar,
1429 Status &error,
1430 bool force_live_memory = false);
1431
1432 int64_t ReadSignedIntegerFromMemory(const Address &addr,
1433 size_t integer_byte_size,
1434 int64_t fail_value, Status &error,
1435 bool force_live_memory = false);
1436
1437 uint64_t ReadUnsignedIntegerFromMemory(const Address &addr,
1438 size_t integer_byte_size,
1439 uint64_t fail_value, Status &error,
1440 bool force_live_memory = false);
1441
1442 bool ReadPointerFromMemory(const Address &addr, Status &error,
1443 Address &pointer_addr,
1444 bool force_live_memory = false);
1445
1446 bool HasLoadedSections();
1447
1449
1450 void ClearSectionLoadList();
1451
1452 void DumpSectionLoadList(Stream &s);
1453
1454 static Target *GetTargetFromContexts(const ExecutionContext *exe_ctx_ptr,
1455 const SymbolContext *sc_ptr);
1456
1457 // lldb::ExecutionContextScope pure virtual functions
1459
1461
1463
1465
1466 void CalculateExecutionContext(ExecutionContext &exe_ctx) override;
1467
1469
1470 llvm::Expected<lldb::TypeSystemSP>
1472 bool create_on_demand = true);
1473
1474 std::vector<lldb::TypeSystemSP>
1475 GetScratchTypeSystems(bool create_on_demand = true);
1476
1479
1480 // Creates a UserExpression for the given language, the rest of the
1481 // parameters have the same meaning as for the UserExpression constructor.
1482 // Returns a new-ed object which the caller owns.
1483
1485 GetUserExpressionForLanguage(llvm::StringRef expr, llvm::StringRef prefix,
1486 SourceLanguage language,
1487 Expression::ResultType desired_type,
1488 const EvaluateExpressionOptions &options,
1489 ValueObject *ctx_obj, Status &error);
1490
1491 // Creates a FunctionCaller for the given language, the rest of the
1492 // parameters have the same meaning as for the FunctionCaller constructor.
1493 // Since a FunctionCaller can't be
1494 // IR Interpreted, it makes no sense to call this with an
1495 // ExecutionContextScope that lacks
1496 // a Process.
1497 // Returns a new-ed object which the caller owns.
1498
1500 const CompilerType &return_type,
1501 const Address &function_address,
1502 const ValueList &arg_value_list,
1503 const char *name, Status &error);
1504
1505 /// Creates and installs a UtilityFunction for the given language.
1506 llvm::Expected<std::unique_ptr<UtilityFunction>>
1507 CreateUtilityFunction(std::string expression, std::string name,
1508 lldb::LanguageType language, ExecutionContext &exe_ctx);
1509
1510 // Install any files through the platform that need be to installed prior to
1511 // launching or attaching.
1512 Status Install(ProcessLaunchInfo *launch_info);
1513
1514 bool ResolveFileAddress(lldb::addr_t load_addr, Address &so_addr);
1515
1516 bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr,
1517 uint32_t stop_id = SectionLoadHistory::eStopIDNow,
1518 bool allow_section_end = false);
1519
1520 bool SetSectionLoadAddress(const lldb::SectionSP &section,
1521 lldb::addr_t load_addr,
1522 bool warn_multiple = false);
1523
1524 size_t UnloadModuleSections(const lldb::ModuleSP &module_sp);
1525
1526 size_t UnloadModuleSections(const ModuleList &module_list);
1527
1528 bool SetSectionUnloaded(const lldb::SectionSP &section_sp);
1529
1530 bool SetSectionUnloaded(const lldb::SectionSP &section_sp,
1531 lldb::addr_t load_addr);
1532
1534
1536 lldb_private::TypeSummaryImpl &summary_provider);
1538
1539 /// Set the \a Trace object containing processor trace information of this
1540 /// target.
1541 ///
1542 /// \param[in] trace_sp
1543 /// The trace object.
1544 void SetTrace(const lldb::TraceSP &trace_sp);
1545
1546 /// Get the \a Trace object containing processor trace information of this
1547 /// target.
1548 ///
1549 /// \return
1550 /// The trace object. It might be undefined.
1552
1553 /// Create a \a Trace object for the current target using the using the
1554 /// default supported tracing technology for this process.
1555 ///
1556 /// \return
1557 /// The new \a Trace or an \a llvm::Error if a \a Trace already exists or
1558 /// the trace couldn't be created.
1559 llvm::Expected<lldb::TraceSP> CreateTrace();
1560
1561 /// If a \a Trace object is present, this returns it, otherwise a new Trace is
1562 /// created with \a Trace::CreateTrace.
1563 llvm::Expected<lldb::TraceSP> GetTraceOrCreate();
1564
1565 // Since expressions results can persist beyond the lifetime of a process,
1566 // and the const expression results are available after a process is gone, we
1567 // provide a way for expressions to be evaluated from the Target itself. If
1568 // an expression is going to be run, then it should have a frame filled in in
1569 // the execution context.
1571 llvm::StringRef expression, ExecutionContextScope *exe_scope,
1572 lldb::ValueObjectSP &result_valobj_sp,
1574 std::string *fixed_expression = nullptr, ValueObject *ctx_obj = nullptr);
1575
1577
1579
1580 /// This method will return the address of the starting function for
1581 /// this binary, e.g. main() or its equivalent. This can be used as
1582 /// an address of a function that is not called once a binary has
1583 /// started running - e.g. as a return address for inferior function
1584 /// calls that are unambiguous completion of the function call, not
1585 /// called during the course of the inferior function code running.
1586 ///
1587 /// If no entry point can be found, an invalid address is returned.
1588 ///
1589 /// \param [out] err
1590 /// This object will be set to failure if no entry address could
1591 /// be found, and may contain a helpful error message.
1592 //
1593 /// \return
1594 /// Returns the entry address for this program, or an error
1595 /// if none can be found.
1596 llvm::Expected<lldb_private::Address> GetEntryPointAddress();
1597
1598 CompilerType GetRegisterType(const RegisterInfo &reg_info);
1599
1600 /// Sends a breakpoint notification event.
1602 lldb::BreakpointEventType event_kind);
1603 /// Sends a breakpoint notification event.
1605 const lldb::EventDataSP &breakpoint_data_sp);
1606
1607 llvm::Expected<lldb::DisassemblerSP>
1608 ReadInstructions(const Address &start_addr, uint32_t count,
1609 const char *flavor_string = nullptr);
1610
1611 // Target Stop Hooks
1612 class StopHook : public UserID {
1613 public:
1614 StopHook(const StopHook &rhs);
1615 virtual ~StopHook() = default;
1616
1617 enum class StopHookKind : uint32_t {
1621 };
1628
1630
1631 // Set the specifier. The stop hook will own the specifier, and is
1632 // responsible for deleting it when we're done.
1633 void SetSpecifier(SymbolContextSpecifier *specifier);
1634
1636
1637 bool ExecutionContextPasses(const ExecutionContext &exe_ctx);
1638
1639 // Called on stop, this gets passed the ExecutionContext for each "stop
1640 // with a reason" thread. It should add to the stream whatever text it
1641 // wants to show the user, and return False to indicate it wants the target
1642 // not to stop.
1644 lldb::StreamSP output) = 0;
1645
1646 // Set the Thread Specifier. The stop hook will own the thread specifier,
1647 // and is responsible for deleting it when we're done.
1648 void SetThreadSpecifier(ThreadSpec *specifier);
1649
1651
1652 bool IsActive() { return m_active; }
1653
1654 void SetIsActive(bool is_active) { m_active = is_active; }
1655
1656 void SetAutoContinue(bool auto_continue) {
1657 m_auto_continue = auto_continue;
1658 }
1659
1660 bool GetAutoContinue() const { return m_auto_continue; }
1661
1662 void SetRunAtInitialStop(bool at_initial_stop) {
1663 m_at_initial_stop = at_initial_stop;
1664 }
1665
1667
1668 void SetSuppressOutput(bool suppress_output) {
1669 m_suppress_output = suppress_output;
1670 }
1671
1672 bool GetSuppressOutput() const { return m_suppress_output; }
1673
1674 void GetDescription(Stream &s, lldb::DescriptionLevel level) const;
1676 lldb::DescriptionLevel level) const = 0;
1677
1678 protected:
1681 std::unique_ptr<ThreadSpec> m_thread_spec_up;
1682 bool m_active = true;
1683 bool m_auto_continue = false;
1685 bool m_suppress_output = false;
1686
1687 StopHook(lldb::TargetSP target_sp, lldb::user_id_t uid);
1688 };
1689
1691 public:
1692 ~StopHookCommandLine() override = default;
1693
1695 void SetActionFromString(const std::string &strings);
1696 void SetActionFromStrings(const std::vector<std::string> &strings);
1697
1699 lldb::StreamSP output_sp) override;
1701 lldb::DescriptionLevel level) const override;
1702
1703 private:
1705 // Use CreateStopHook to make a new empty stop hook. Use SetActionFromString
1706 // to fill it with commands, and SetSpecifier to set the specifier shared
1707 // pointer (can be null, that will match anything.)
1709 : StopHook(target_sp, uid) {}
1710 friend class Target;
1711 };
1712
1714 public:
1715 ~StopHookScripted() override = default;
1717 lldb::StreamSP output) override;
1718
1719 Status SetScriptCallback(const ScriptedMetadata &scripted_metadata);
1720
1722 lldb::DescriptionLevel level) const override;
1723
1724 private:
1725 llvm::StringRef GetScriptClassName() const;
1726
1728
1729 /// Use CreateStopHook to make a new empty stop hook. Use SetScriptCallback
1730 /// to set the script to execute, and SetSpecifier to set the specifier
1731 /// shared pointer (can be null, that will match anything.)
1733 : StopHook(target_sp, uid) {}
1734 friend class Target;
1735 };
1736
1737 class StopHookCoded : public StopHook {
1738 public:
1739 ~StopHookCoded() override = default;
1740
1742 lldb::StreamSP output);
1743
1744 void SetCallback(llvm::StringRef name, HandleStopCallback *callback) {
1745 m_name = name;
1746 m_callback = callback;
1747 }
1748
1750 lldb::StreamSP output) override {
1751 return m_callback(exc_ctx, output);
1752 }
1753
1755 lldb::DescriptionLevel level) const override {
1756 s.Indent();
1757 s.Printf("%s (built-in)\n", m_name.c_str());
1758 }
1759
1760 private:
1761 std::string m_name;
1763
1764 /// Use CreateStopHook to make a new empty stop hook. Use SetCallback to set
1765 /// the callback to execute, and SetSpecifier to set the specifier shared
1766 /// pointer (can be null, that will match anything.)
1768 : StopHook(target_sp, uid) {}
1769 friend class Target;
1770 };
1771
1773
1774 typedef std::shared_ptr<StopHook> StopHookSP;
1775
1776 // Target Hooks
1777 //
1778 // Hooks fire on target lifecycle events. There are two flows:
1779 //
1780 // Command-based hooks: the user specifies which triggers the hook responds
1781 // to (--on-load, --on-unload, --on-stop) and provides a list of commands.
1782 // All commands run for every trigger the hook is signed up for.
1783 //
1784 // Python class hooks: the user provides a Python class name and optional
1785 // extra_args that will be passed to the hook init method (-k key -v value).
1786 // The class controls which events it handles by implementing the
1787 // corresponding callback methods (handle_module_loaded,
1788 // handle_module_unloaded, handle_stop). Triggers are set automatically
1789 // based on which methods exist.
1790 class Hook : public UserID {
1791 public:
1792 Hook(const Hook &rhs);
1793 virtual ~Hook() = default;
1794
1795 enum class HookKind : uint32_t { CommandBased = 0, ScriptBased };
1796
1797 HookKind GetHookKind() const { return m_kind; }
1798
1799 /// Individual trigger bits. Combine with bitwise OR to form a trigger mask.
1800 // FIXME: Add kProcessExit, kProcessDetach, etc. as needed.
1801 enum TriggerBit : uint32_t {
1802 kModulesLoaded = (1u << 0),
1803 kModulesUnloaded = (1u << 1),
1804 kProcessStop = (1u << 2),
1805 };
1806
1808
1809 bool IsEnabled() { return m_enabled; }
1810 void SetIsEnabled(bool enabled) { m_enabled = enabled; }
1811
1812 /// Return the bitmask of triggers this hook responds to.
1813 /// Each bit corresponds to a TriggerBit value.
1814 uint32_t GetTriggerMask() const { return m_trigger_mask; }
1815
1816 /// Return true if this hook fires on the given trigger.
1817 bool FiresOn(uint32_t trigger) const { return m_trigger_mask & trigger; }
1818
1819 // Filter fields
1820
1821 /// Set the symbol context specifier. The hook takes ownership.
1822 void SetSCSpecifier(SymbolContextSpecifier *specifier);
1824
1825 /// Check if the execution context passes the specifier and thread spec
1826 /// filters. Always returns true if no filters are set.
1827 bool ExecutionContextPasses(const ExecutionContext &exe_ctx);
1828
1829 /// Set the thread specifier. The hook takes ownership.
1830 void SetThreadSpecifier(ThreadSpec *specifier);
1832
1833 void SetRunAtInitialStop(bool at_initial_stop) {
1834 m_at_initial_stop = at_initial_stop;
1835 }
1837
1838 // Reaction settings
1839
1840 void SetAutoContinue(bool auto_continue) {
1841 m_auto_continue = auto_continue;
1842 }
1843 bool GetAutoContinue() const { return m_auto_continue; }
1844
1845 void SetSuppressOutput(bool suppress_output) {
1846 m_suppress_output = suppress_output;
1847 }
1848 bool GetSuppressOutput() const { return m_suppress_output; }
1849
1850 // Event handler methods (default no-ops)
1851
1852 virtual void HandleModuleLoaded(lldb::StreamSP output) {}
1853 virtual void HandleModuleUnloaded(lldb::StreamSP output) {}
1854
1855 /// Called when the process stops. Returns a StopHookResult indicating
1856 /// whether the process should remain stopped or continue.
1861
1862 virtual void GetDescription(Stream &s, lldb::DescriptionLevel level) const;
1863
1864 protected:
1865 /// Print the filter portion of the description (AutoContinue, Specifier,
1866 /// ThreadSpec). Called by subclass GetDescription after printing the
1867 /// hook-specific content (commands or class).
1871 bool m_enabled = true;
1872 uint32_t m_trigger_mask = 0; // No default, triggers must be explicit.
1873
1874 // Filters
1876 std::unique_ptr<ThreadSpec> m_thread_spec_up;
1878
1879 // Reaction settings
1880 bool m_auto_continue = false;
1881 bool m_suppress_output = false;
1882
1883 Hook(lldb::TargetSP target_sp, lldb::user_id_t uid, HookKind kind);
1884 };
1885
1886 class HookCommandLine : public Hook {
1887 public:
1888 ~HookCommandLine() override = default;
1889
1890 /// Replace the trigger mask. \a mask is a bitwise OR of TriggerBit values.
1891 void SetTriggerMask(uint32_t mask) { m_trigger_mask = mask; }
1892
1893 /// Add a trigger to the mask. \a trigger is a single TriggerBit value.
1894 void AddTrigger(uint32_t trigger) { m_trigger_mask |= trigger; }
1895
1896 /// Remove a trigger from the mask. \a trigger is a single TriggerBit value.
1897 void RemoveTrigger(uint32_t trigger) { m_trigger_mask &= ~trigger; }
1898
1899 /// Return the list of commands that this hook runs.
1901
1902 /// Populate the command list by splitting a single string on newlines.
1903 void SetActionFromString(const std::string &string);
1904
1905 /// Populate the command list from a vector of individual command strings.
1906 void SetActionFromStrings(const std::vector<std::string> &strings);
1907
1908 void GetDescription(Stream &s, lldb::DescriptionLevel level) const override;
1909 void HandleModuleLoaded(lldb::StreamSP output) override;
1910 void HandleModuleUnloaded(lldb::StreamSP output) override;
1912 lldb::StreamSP output) override;
1913
1914 private:
1916
1918 : Hook(target_sp, uid, HookKind::CommandBased) {}
1919 friend class Target;
1920 };
1921
1922 class HookScripted : public Hook {
1923 public:
1924 ~HookScripted() override = default;
1925
1926 void GetDescription(Stream &s, lldb::DescriptionLevel level) const override;
1927
1928 void HandleModuleLoaded(lldb::StreamSP output) override;
1929 void HandleModuleUnloaded(lldb::StreamSP output) override;
1931 lldb::StreamSP output) override;
1932
1933 Status SetScriptCallback(const ScriptedMetadata &scripted_metadata);
1934
1935 private:
1936 llvm::StringRef GetScriptClassName() const;
1937
1939
1941 : Hook(target_sp, uid, HookKind::ScriptBased) {}
1942 friend class Target;
1943 };
1944
1945 typedef std::shared_ptr<Hook> HookSP;
1946
1948
1949 /// Removes the most recently created hook. Used to roll back a
1950 /// hook creation when an error occurs (e.g., invalid script class name
1951 /// or empty interactive input).
1953
1955
1956 void RemoveAllHooks();
1957
1959
1960 bool SetHookEnabledStateByID(lldb::user_id_t uid, bool enabled);
1961
1962 void SetAllHooksEnabledState(bool enabled);
1963
1964 size_t GetNumHooks() const { return m_hooks.size(); }
1965
1966 HookSP GetHookAtIndex(size_t index);
1967
1968 void RunModuleHooks(bool is_load);
1969
1970 /// Add an empty stop hook to the Target's stop hook list, and returns a
1971 /// shared pointer to the new hook.
1972 StopHookSP CreateStopHook(StopHook::StopHookKind kind, bool internal = false);
1973
1974 /// If you tried to create a stop hook, and that failed, call this to
1975 /// remove the stop hook, as it will also reset the stop hook counter.
1977
1978 // Runs the stop hooks that have been registered for this target.
1979 // Returns true if the stop hooks cause the target to resume.
1980 // Pass at_initial_stop if this is the stop where lldb gains
1981 // control over the process for the first time.
1982 bool RunStopHooks(bool at_initial_stop = false);
1983
1984 bool SetSuppresStopHooks(bool suppress) {
1985 bool old_value = m_suppress_stop_hooks;
1986 m_suppress_stop_hooks = suppress;
1987 return old_value;
1988 }
1989
1991
1993
1994 void RemoveAllStopHooks();
1995
1996 StopHookSP GetStopHookByID(lldb::user_id_t uid);
1997
1998 bool SetStopHookActiveStateByID(lldb::user_id_t uid, bool active_state);
1999
2000 void SetAllStopHooksActiveState(bool active_state);
2001
2002 const std::vector<StopHookSP> GetStopHooks(bool internal = false) const;
2003
2005
2006 void SetPlatform(const lldb::PlatformSP &platform_sp) {
2007 m_platform_sp = platform_sp;
2008 }
2009
2011
2012 // Methods.
2014 GetSearchFilterForModule(const FileSpec *containingModule);
2015
2017 GetSearchFilterForModuleList(const FileSpecList *containingModuleList);
2018
2020 GetSearchFilterForModuleAndCUList(const FileSpecList *containingModules,
2021 const FileSpecList *containingSourceFiles);
2022
2024 const char *repl_options, bool can_create);
2025
2026 void SetREPL(lldb::LanguageType language, lldb::REPLSP repl_sp);
2027
2031
2033
2034 /// Get the list of paths that LLDB will consider automatically loading
2035 /// scripting resources from. Currently whether to load scripts
2036 /// unconditionally is controlled via the
2037 /// `target.load-script-from-symbol-file` setting.
2039
2040 /// Add a signal for the target. This will get copied over to the process
2041 /// if the signal exists on that target. Only the values with Yes and No are
2042 /// set, Calculate values will be ignored.
2043protected:
2052 using DummySignalElement = llvm::StringMapEntry<DummySignalValues>;
2053 static bool UpdateSignalFromDummy(lldb::UnixSignalsSP signals_sp,
2054 const DummySignalElement &element);
2055 static bool ResetSignalFromDummy(lldb::UnixSignalsSP signals_sp,
2056 const DummySignalElement &element);
2057
2058public:
2059 /// Add a signal to the Target's list of stored signals/actions. These
2060 /// values will get copied into any processes launched from
2061 /// this target.
2062 void AddDummySignal(llvm::StringRef name, LazyBool pass, LazyBool print,
2063 LazyBool stop);
2064 /// Updates the signals in signals_sp using the stored dummy signals.
2065 /// If warning_stream_sp is not null, if any stored signals are not found in
2066 /// the current process, a warning will be emitted here.
2068 lldb::StreamSP warning_stream_sp);
2069 /// Clear the dummy signals in signal_names from the target, or all signals
2070 /// if signal_names is empty. Also remove the behaviors they set from the
2071 /// process's signals if it exists.
2072 void ClearDummySignals(Args &signal_names);
2073 /// Print all the signals set in this target.
2074 void PrintDummySignals(Stream &strm, Args &signals);
2075
2076protected:
2077 /// The mutex the calling thread must serialize on for its current policy, or
2078 /// nullptr when that policy bypasses the API mutex entirely.
2079 std::recursive_mutex *GetAPIMutexForCurrentPolicy();
2080
2081 /// Implementing of ModuleList::Notifier.
2082
2083 void NotifyModuleAdded(const ModuleList &module_list,
2084 const lldb::ModuleSP &module_sp) override;
2085
2086 void NotifyModuleRemoved(const ModuleList &module_list,
2087 const lldb::ModuleSP &module_sp) override;
2088
2089 void NotifyModuleUpdated(const ModuleList &module_list,
2090 const lldb::ModuleSP &old_module_sp,
2091 const lldb::ModuleSP &new_module_sp) override;
2092
2093 void NotifyWillClearList(const ModuleList &module_list) override;
2094
2095 void NotifyModulesRemoved(lldb_private::ModuleList &module_list) override;
2096
2097 class Arch {
2098 public:
2099 explicit Arch(const ArchSpec &spec);
2100 const Arch &operator=(const ArchSpec &spec);
2101
2102 const ArchSpec &GetSpec() const { return m_spec; }
2103 Architecture *GetPlugin() const { return m_plugin_up.get(); }
2104
2105 private:
2107 std::unique_ptr<Architecture> m_plugin_up;
2108 };
2109
2110 // Member variables.
2112 lldb::PlatformSP m_platform_sp; ///< The platform for this target.
2113 std::recursive_mutex m_mutex; ///< An API mutex that is used by the lldb::SB*
2114 /// classes make the SB interface thread safe
2115 /// When the private state thread calls SB API's - usually because it is
2116 /// running OS plugin or Python ThreadPlan code - it should not block on the
2117 /// API mutex that is held by the code that kicked off the sequence of events
2118 /// that led us to run the code. We hand out this mutex instead when we
2119 /// detect that code is running on the private state thread.
2120 std::recursive_mutex m_private_mutex;
2122 std::string m_label;
2123 ModuleList m_images; ///< The list of images for this process (shared
2124 /// libraries and anything dynamically loaded).
2125 /// The marked main executable. Weak, so it can't outlive its image.
2131 using BreakpointNameMap = llvm::StringMap<std::unique_ptr<BreakpointName>>;
2133
2134 std::map<lldb::user_id_t, BreakpointResolverOverrideUP>
2136 /// This is the ID that will be handed out for the next added breakpoint
2137 /// override resolver for this target.
2139
2143 // We want to tightly control the process destruction process so we can
2144 // correctly tear down everything that we need to, so the only class that
2145 // knows about the process lifespan is this target class.
2150
2151 /// Map of scripted frame provider descriptors for this target.
2152 /// Keys are the provider descriptor IDs, values are the descriptors.
2153 /// Insertion order is preserved so that equal-priority providers chain
2154 /// in registration order.
2155 llvm::MapVector<uint32_t, ScriptedFrameProviderDescriptor>
2157 mutable std::recursive_mutex m_frame_provider_descriptors_mutex;
2159
2160 typedef std::map<lldb::LanguageType, lldb::REPLSP> REPLMap;
2162
2164
2165 typedef std::map<lldb::user_id_t, StopHookSP> StopHookCollection;
2168 std::vector<StopHookSP> m_internal_stop_hooks;
2169 uint32_t m_latest_stop_hook_id; /// This records the last natural stop at
2170 /// which we ran a stop-hook.
2172 bool m_suppress_stop_hooks; /// Used to not run stop hooks for expressions
2174
2175 typedef std::map<lldb::user_id_t, HookSP> HookCollection;
2180 LLDB_INVALID_GLOBALLY_UNIQUE_TARGET_ID; ///< The globally unique ID
2181 /// assigned to this target
2182 std::string m_target_session_name; ///< The target session name for this
2183 /// target, used to name debugging
2184 /// sessions in DAP.
2185 /// An optional \a lldb_private::Trace object containing processor trace
2186 /// information of this target.
2188 /// Stores the frame recognizers of this target.
2190 /// These are used to set the signal state when you don't have a process and
2191 /// more usefully in the Dummy target where you can't know exactly what
2192 /// signals you will have.
2193 llvm::StringMap<DummySignalValues> m_dummy_signals;
2194
2196
2197 static void ImageSearchPathsChanged(const PathMappingList &path_list,
2198 void *baton);
2199
2200 // Utilities for `statistics` command.
2201private:
2202 // Target metrics storage.
2204
2205public:
2206 /// Get metrics associated with this target in JSON format.
2207 ///
2208 /// Target metrics help measure timings and information that is contained in
2209 /// a target. These are designed to help measure performance of a debug
2210 /// session as well as represent the current state of the target, like
2211 /// information on the currently modules, currently set breakpoints and more.
2212 ///
2213 /// \return
2214 /// Returns a JSON value that contains all target metrics.
2215 llvm::json::Value
2217
2218 void ResetStatistics();
2219
2221
2222protected:
2223 /// Construct with optional file and arch.
2224 ///
2225 /// This member is private. Clients must use
2226 /// TargetList::CreateTarget(const FileSpec*, const ArchSpec*)
2227 /// so all targets can be tracked from the central target list.
2228 ///
2229 /// \see TargetList::CreateTarget(const FileSpec*, const ArchSpec*)
2230 Target(Debugger &debugger, const ArchSpec &target_arch,
2231 const lldb::PlatformSP &platform_sp, bool is_dummy_target);
2232
2233 // Helper function.
2234 bool ProcessIsValid();
2235
2236 // Copy breakpoints, stop hooks and so forth from the dummy target:
2237 void PrimeFromDummyTarget(Target &target);
2238
2239 void AddBreakpoint(lldb::BreakpointSP breakpoint_sp, bool internal);
2240
2242
2243 /// Return a recommended size for memory reads at \a addr, optimizing for
2244 /// cache usage.
2246
2247 Target(const Target &) = delete;
2248 const Target &operator=(const Target &) = delete;
2249
2251 return m_section_load_history.GetCurrentSectionLoadList();
2252 }
2253};
2254
2255} // namespace lldb_private
2256
2257#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:101
void SetPreferredSymbolContexts(SymbolContextList contexts)
Definition Target.h:375
void SetOneThreadTimeout(const Timeout< std::micro > &timeout)
Definition Target.h:434
void SetUnwindOnError(bool unwind=false)
Definition Target.h:407
SourceLanguage GetLanguage() const
Definition Target.h:369
const char * GetPoundLineFilePath() const
Definition Target.h:497
lldb::DynamicValueType m_use_dynamic
Definition Target.h:573
void SetExecutionPolicy(ExecutionPolicy policy=eExecutionPolicyAlways)
Definition Target.h:365
Timeout< std::micro > m_one_thread_timeout
Definition Target.h:575
bool InvokeCancelCallback(lldb::ExpressionEvaluationPhase phase) const
Definition Target.h:479
lldb::DynamicValueType GetUseDynamic() const
Definition Target.h:419
void SetKeepInMemory(bool keep=true)
Definition Target.h:417
bool m_try_DIL_first
If enabled, Data Inspection Language (DIL) should attempt to evaluate the expression first.
Definition Target.h:571
void SetCoerceToId(bool coerce=true)
Definition Target.h:403
void SetLanguage(lldb::LanguageType language_type)
Definition Target.h:371
ExecutionPolicy GetExecutionPolicy() const
Definition Target.h:363
Timeout< std::micro > m_timeout
Definition Target.h:574
void SetCppIgnoreContextQualifiers(bool value)
Definition Target.cpp:6231
const StructuredData::Dictionary & GetLanguageOptions() const
Definition Target.cpp:6209
llvm::Expected< bool > GetBooleanLanguageOption(llvm::StringRef option_name) const
Get the language-plugin specific boolean option called option_name.
Definition Target.cpp:6193
void SetPrefix(const char *prefix)
Definition Target.h:396
void SetTryAllThreads(bool try_others=true)
Definition Target.h:440
static constexpr std::chrono::milliseconds default_timeout
Definition Target.h:355
void SetPoundLine(const char *path, uint32_t line) const
Definition Target.h:487
void SetRetriesWithFixIts(uint64_t number_of_retries)
Definition Target.h:513
SymbolContextList m_preferred_lookup_contexts
During expression evaluation, any SymbolContext in this list will be used for symbol/function lookup ...
Definition Target.h:591
void SetTimeout(const Timeout< std::micro > &timeout)
Definition Target.h:428
static constexpr ExecutionPolicy default_execution_policy
Definition Target.h:360
void SetStopOthers(bool stop_others=true)
Definition Target.h:444
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:567
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:6176
StructuredData::DictionarySP m_language_options_sp
Dictionary mapping names of language-plugin specific options to values.
Definition Target.h:586
void SetCancelCallback(lldb::ExpressionCancelCallback callback, void *baton)
Definition Target.h:474
const Timeout< std::micro > & GetTimeout() const
Definition Target.h:426
const SymbolContextList & GetPreferredSymbolContexts() const
Definition Target.h:379
void SetIgnoreBreakpoints(bool ignore=false)
Definition Target.h:411
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:386
void SetUseDynamic(lldb::DynamicValueType dynamic=lldb::eDynamicCanRunTarget)
Definition Target.h:422
lldb::ExpressionCancelCallback m_cancel_callback
Definition Target.h:576
const Timeout< std::micro > & GetOneThreadTimeout() const
Definition Target.h:430
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A file collection class.
A file utility class.
Definition FileSpec.h:56
Encapsulates a function that can be called.
A collection class for Module objects.
Definition ModuleList.h:128
A class that describes an executable image and its associated object and symbol files.
Definition Module.h:91
Class that provides a registry of known stack frame recognizers.
An error handling class.
Definition Status.h:118
A stream class that can stream formatted output to a file.
Definition Stream.h:28
size_t Indent(llvm::StringRef s="")
Indent the current line in the stream.
Definition Stream.cpp:157
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition Stream.cpp:134
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
A class that wraps a std::map of SummaryStatistics objects behind a mutex.
Definition Statistics.h:281
Defines a list of symbol context objects.
Defines a symbol context baton that can be handed other debug core functions.
A Lockable handle over a Target's API mutex, returned by Target::GetAPIMutex() and backing the public...
bool GetUseDILForCreatingValues() const
Definition Target.cpp:5270
uint32_t GetMaximumSizeOfStringSummary() const
Definition Target.cpp:5697
FileSpecList GetDebugFileSearchPaths()
Definition Target.cpp:5572
llvm::StringRef GetLaunchWorkingDirectory() const
Definition Target.cpp:5378
bool GetDisplayRecognizedArguments() const
Definition Target.cpp:5868
ImportStdModule GetImportStdModule() const
Definition Target.cpp:5588
void AppendExecutableSearchPaths(const FileSpec &)
Definition Target.cpp:5559
bool GetEnableSyntheticValue() const
Definition Target.cpp:5664
void SetStandardInputPath(const char *path)=delete
ProcessLaunchInfo m_launch_info
Definition Target.h:338
bool GetCheckValueObjectOwnership() const
Definition Target.cpp:5996
uint64_t GetExprAllocAlign() const
Definition Target.cpp:5776
MemoryModuleLoadLevel GetMemoryModuleLoadLevel() const
Definition Target.cpp:5840
llvm::StringRef GetArg0() const
Definition Target.cpp:5431
uint32_t GetMaximumMemReadSize() const
Definition Target.cpp:5703
void SetRunArguments(const Args &args)
Definition Target.cpp:5448
FileSpec GetStandardErrorPath() const
Definition Target.cpp:5729
void SetLoadScriptFromSymbolFile(LoadScriptFromSymFile load_style)
Set the target-wide target.load-script-from-symbol-file setting.
Definition Target.cpp:5820
bool GetEnableNotifyAboutFixIts() const
Definition Target.cpp:5614
bool SetPreferDynamicValue(lldb::DynamicValueType d)
Definition Target.cpp:5315
void SetDisplayRecognizedArguments(bool b)
Definition Target.cpp:5874
void SetUseDILForCreatingValues(bool b)
Definition Target.cpp:5283
std::optional< bool > GetExperimentalPropertyValue(size_t prop_idx, ExecutionContext *exe_ctx=nullptr) const
Definition Target.cpp:5232
const ProcessLaunchInfo & GetProcessLaunchInfo() const
Definition Target.cpp:5879
Environment ComputeEnvironment() const
Definition Target.cpp:5454
void SetStandardOutputPath(const char *path)=delete
bool GetUserSpecifiedTrapHandlerNames(Args &args) const
Definition Target.cpp:5847
uint64_t GetExprErrorLimit() const
Definition Target.cpp:5758
bool GetEnableAutoImportClangModules() const
Definition Target.cpp:5582
bool GetDebugUtilityExpression() const
Definition Target.cpp:5985
JITEngine GetJITEngine() const
Definition Target.cpp:5625
DynamicClassInfoHelper GetDynamicClassInfoHelper() const
Definition Target.cpp:5595
FileSpec GetStandardOutputPath() const
Definition Target.cpp:5719
void SetDisplayRuntimeSupportValues(bool b)
Definition Target.cpp:5863
uint32_t GetMaximumNumberOfChildrenToDisplay() const
Definition Target.cpp:5682
void SetRequireHardwareBreakpoints(bool b)
Definition Target.cpp:5917
lldb::BreakpointConditionMode GetBreakpointsConditionMode() const
Definition Target.cpp:5788
bool GetAutoInstallMainExecutable() const
Definition Target.cpp:5922
const char * GetDisassemblyFeatures() const
Definition Target.cpp:5410
void SetAutoLoadScriptsForModule(llvm::StringRef module_name, LoadScriptFromSymFile load_style)
Set the LoadScriptFromSymFile for a module called module_name (excluding file extension).
Definition Target.cpp:6022
RealpathPrefixes GetSourceRealpathPrefixes() const
Definition Target.cpp:5426
void SetCheckValueObjectOwnership(bool check)
Definition Target.cpp:6002
uint64_t GetNumberOfRetriesWithFixits() const
Definition Target.cpp:5608
uint64_t GetExprAllocSize() const
Definition Target.cpp:5770
std::optional< LoadScriptFromSymFile > GetAutoLoadScriptsForModule(llvm::StringRef module_name) const
Definition Target.cpp:6008
llvm::StringRef GetExpressionPrefixContents()
Definition Target.cpp:5744
PathMappingList & GetObjectPathMap() const
Definition Target.cpp:5545
const char * GetDisassemblyFlavor() const
Definition Target.cpp:5390
FileSpec GetStandardInputPath() const
Definition Target.cpp:5709
lldb::DynamicValueType GetPreferDynamicValue() const
Definition Target.cpp:5308
InlineStrategy GetInlineStrategy() const
Definition Target.cpp:5417
Environment GetTargetEnvironment() const
Definition Target.cpp:5514
bool GetDisplayRuntimeSupportValues() const
Definition Target.cpp:5857
void SetUserSpecifiedTrapHandlerNames(const Args &args)
Definition Target.cpp:5852
uint32_t GetMaxZeroPaddingInFloatFormat() const
Definition Target.cpp:5676
uint64_t GetExprAllocAddress() const
Definition Target.cpp:5764
LoadCWDlldbinitFile GetLoadCWDlldbinitFile() const
Definition Target.cpp:5826
Environment GetInheritedEnvironment() const
Definition Target.cpp:5486
void SetArg0(llvm::StringRef arg)
Definition Target.cpp:5437
bool GetInjectLocalVariables(ExecutionContext *exe_ctx) const
Definition Target.cpp:5243
void SetStandardErrorPath(const char *path)=delete
bool ShowHexVariableValuesWithLeadingZeroes() const
Definition Target.cpp:5670
SourceLanguage GetLanguage() const
Definition Target.cpp:5739
Environment GetEnvironment() const
Definition Target.cpp:5482
void SetProcessLaunchInfo(const ProcessLaunchInfo &launch_info)
Definition Target.cpp:5883
FileSpec GetSaveJITObjectsDir() const
Definition Target.cpp:5620
void SetEnvironment(Environment env)
Definition Target.cpp:5525
LoadScriptFromSymFile GetLoadScriptFromSymbolFile() const
Definition Target.cpp:5813
const char * GetDisassemblyCPU() const
Definition Target.cpp:5403
void SetStandardErrorPath(llvm::StringRef path)
Definition Target.cpp:5734
bool GetRunArguments(Args &args) const
Definition Target.cpp:5443
FileSpecList GetExecutableSearchPaths()
Definition Target.cpp:5567
ArchSpec GetDefaultArchitecture() const
Definition Target.cpp:5292
Disassembler::HexImmediateStyle GetHexImmediateStyle() const
Definition Target.cpp:5833
void SetUseDIL(ExecutionContext *exe_ctx, bool b)
Definition Target.cpp:5261
std::unique_ptr< TargetExperimentalProperties > m_experimental_properties_up
Definition Target.h:339
FileSpecList GetClangModuleSearchPaths()
Definition Target.cpp:5577
void SetStandardOutputPath(llvm::StringRef path)
Definition Target.cpp:5724
bool GetRequireHardwareBreakpoints() const
Definition Target.cpp:5911
PathMappingList & GetSourcePathMap() const
Definition Target.cpp:5537
bool GetAutoSourceMapRelative() const
Definition Target.cpp:5553
bool GetUseDIL(ExecutionContext *exe_ctx) const
Definition Target.cpp:5249
void SetDefaultArchitecture(const ArchSpec &arch)
Definition Target.cpp:5297
void SetStandardInputPath(llvm::StringRef path)
Definition Target.cpp:5714
TargetProperties(Target *target)
Definition Target.cpp:5156
bool GetDisplayExpressionsInCrashlogs() const
Definition Target.cpp:5807
bool GetEnableAutoApplyFixIts() const
Definition Target.cpp:5602
void SetDebugUtilityExpression(bool debug)
Definition Target.cpp:5991
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:5689
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:2107
const ArchSpec & GetSpec() const
Definition Target.h:2102
const Arch & operator=(const ArchSpec &spec)
Definition Target.cpp:171
Arch(const ArchSpec &spec)
Definition Target.cpp:167
Architecture * GetPlugin() const
Definition Target.h:2103
virtual BreakpointResolverOverrideUP CopyIntoNewTarget(Target &target)=0
BreakpointResolverOverride(Target &target, const std::string &description, uint64_t type_mask)
Definition Target.h:1054
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:1894
void RemoveTrigger(uint32_t trigger)
Remove a trigger from the mask. trigger is a single TriggerBit value.
Definition Target.h:1897
void GetDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.cpp:4560
HookCommandLine(lldb::TargetSP target_sp, lldb::user_id_t uid)
Definition Target.h:1917
void SetTriggerMask(uint32_t mask)
Replace the trigger mask. mask is a bitwise OR of TriggerBit values.
Definition Target.h:1891
void SetActionFromString(const std::string &string)
Populate the command list by splitting a single string on newlines.
Definition Target.cpp:4587
void SetActionFromStrings(const std::vector< std::string > &strings)
Populate the command list from a vector of individual command strings.
Definition Target.cpp:4591
void HandleModuleLoaded(lldb::StreamSP output) override
Definition Target.cpp:4597
StringList & GetCommands()
Return the list of commands that this hook runs.
Definition Target.h:1900
StopHook::StopHookResult HandleStop(ExecutionContext &exe_ctx, lldb::StreamSP output) override
Called when the process stops.
Definition Target.cpp:4637
void HandleModuleUnloaded(lldb::StreamSP output) override
Definition Target.cpp:4631
llvm::StringRef GetScriptClassName() const
Definition Target.cpp:4769
Status SetScriptCallback(const ScriptedMetadata &scripted_metadata)
Definition Target.cpp:4672
void HandleModuleLoaded(lldb::StreamSP output) override
Definition Target.cpp:4714
StopHook::StopHookResult HandleStop(ExecutionContext &exe_ctx, lldb::StreamSP output) override
Called when the process stops.
Definition Target.cpp:4747
HookScripted(lldb::TargetSP target_sp, lldb::user_id_t uid)
Definition Target.h:1940
void GetDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.cpp:4775
lldb::ScriptedHookInterfaceSP m_interface_sp
Definition Target.h:1938
void HandleModuleUnloaded(lldb::StreamSP output) override
Definition Target.cpp:4730
virtual ~Hook()=default
void SetSuppressOutput(bool suppress_output)
Definition Target.h:1845
bool GetRunAtInitialStop() const
Definition Target.h:1836
ThreadSpec * GetThreadSpecifier()
Definition Target.h:1831
TriggerBit
Individual trigger bits. Combine with bitwise OR to form a trigger mask.
Definition Target.h:1801
bool GetSuppressOutput() const
Definition Target.h:1848
void SetRunAtInitialStop(bool at_initial_stop)
Definition Target.h:1833
lldb::SymbolContextSpecifierSP m_sc_specifier_sp
Definition Target.h:1875
void SetIsEnabled(bool enabled)
Definition Target.h:1810
bool ExecutionContextPasses(const ExecutionContext &exe_ctx)
Check if the execution context passes the specifier and thread spec filters.
Definition Target.cpp:4483
HookKind GetHookKind() const
Definition Target.h:1797
Hook(const Hook &rhs)
Definition Target.cpp:4464
virtual StopHook::StopHookResult HandleStop(ExecutionContext &exe_ctx, lldb::StreamSP output)
Called when the process stops.
Definition Target.h:1857
void GetFilterDescription(Stream &s, lldb::DescriptionLevel level) const
Print the filter portion of the description (AutoContinue, Specifier, ThreadSpec).
Definition Target.cpp:4532
void SetAutoContinue(bool auto_continue)
Definition Target.h:1840
bool GetAutoContinue() const
Definition Target.h:1843
virtual void HandleModuleUnloaded(lldb::StreamSP output)
Definition Target.h:1853
uint32_t GetTriggerMask() const
Return the bitmask of triggers this hook responds to.
Definition Target.h:1814
lldb::TargetSP & GetTarget()
Definition Target.h:1807
SymbolContextSpecifier * GetSCSpecifier()
Definition Target.h:1823
lldb::TargetSP m_target_sp
Definition Target.h:1869
virtual void GetDescription(Stream &s, lldb::DescriptionLevel level) const
Definition Target.cpp:4499
void SetSCSpecifier(SymbolContextSpecifier *specifier)
Set the symbol context specifier. The hook takes ownership.
Definition Target.cpp:4475
void SetThreadSpecifier(ThreadSpec *specifier)
Set the thread specifier. The hook takes ownership.
Definition Target.cpp:4479
virtual void HandleModuleLoaded(lldb::StreamSP output)
Definition Target.h:1852
bool FiresOn(uint32_t trigger) const
Return true if this hook fires on the given trigger.
Definition Target.h:1817
std::unique_ptr< ThreadSpec > m_thread_spec_up
Definition Target.h:1876
void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.h:1754
HandleStopCallback * m_callback
Definition Target.h:1762
StopHookResult HandleStop(ExecutionContext &exc_ctx, lldb::StreamSP output) override
Definition Target.h:1749
StopHookCoded(lldb::TargetSP target_sp, lldb::user_id_t uid)
Use CreateStopHook to make a new empty stop hook.
Definition Target.h:1767
void SetCallback(llvm::StringRef name, HandleStopCallback *callback)
Definition Target.h:1744
StopHookResult(ExecutionContext &exc_ctx, lldb::StreamSP output) HandleStopCallback
Definition Target.h:1741
void SetActionFromString(const std::string &strings)
Definition Target.cpp:4297
StopHookCommandLine(lldb::TargetSP target_sp, lldb::user_id_t uid)
Definition Target.h:1708
void SetActionFromStrings(const std::vector< std::string > &strings)
Definition Target.cpp:4301
StopHookResult HandleStop(ExecutionContext &exc_ctx, lldb::StreamSP output_sp) override
Definition Target.cpp:4308
void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.cpp:4279
lldb::ScriptedHookInterfaceSP m_interface_sp
Definition Target.h:1727
StopHookResult HandleStop(ExecutionContext &exc_ctx, lldb::StreamSP output) override
Definition Target.cpp:4393
Status SetScriptCallback(const ScriptedMetadata &scripted_metadata)
Definition Target.cpp:4343
StopHookScripted(lldb::TargetSP target_sp, lldb::user_id_t uid)
Use CreateStopHook to make a new empty stop hook.
Definition Target.h:1732
void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.cpp:4422
llvm::StringRef GetScriptClassName() const
Definition Target.cpp:4416
bool GetRunAtInitialStop() const
Definition Target.h:1666
SymbolContextSpecifier * GetSpecifier()
Definition Target.h:1635
void SetSpecifier(SymbolContextSpecifier *specifier)
Definition Target.cpp:4217
virtual StopHookResult HandleStop(ExecutionContext &exe_ctx, lldb::StreamSP output)=0
std::unique_ptr< ThreadSpec > m_thread_spec_up
Definition Target.h:1681
void SetIsActive(bool is_active)
Definition Target.h:1654
void SetSuppressOutput(bool suppress_output)
Definition Target.h:1668
void SetThreadSpecifier(ThreadSpec *specifier)
Definition Target.cpp:4221
ThreadSpec * GetThreadSpecifier()
Definition Target.h:1650
StopHook(const StopHook &rhs)
Definition Target.cpp:4209
bool ExecutionContextPasses(const ExecutionContext &exe_ctx)
Definition Target.cpp:4225
lldb::TargetSP & GetTarget()
Definition Target.h:1629
void SetRunAtInitialStop(bool at_initial_stop)
Definition Target.h:1662
lldb::SymbolContextSpecifierSP m_specifier_sp
Definition Target.h:1680
virtual void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const =0
void GetDescription(Stream &s, lldb::DescriptionLevel level) const
Definition Target.cpp:4241
void SetAutoContinue(bool auto_continue)
Definition Target.h:1656
const ModuleList & GetModuleList() const
Definition Target.h:666
void Dump(Stream *s) const override
Definition Target.cpp:6054
static llvm::StringRef GetFlavorString()
Definition Target.cpp:6050
static lldb::TargetSP GetCreatedTargetFromEvent(const Event *event_ptr)
Definition Target.cpp:6083
static ModuleList GetModuleListFromEvent(const Event *event_ptr)
Definition Target.cpp:6092
static const TargetEventData * GetEventDataFromEvent(const Event *event_ptr)
Definition Target.cpp:6064
llvm::StringRef GetFlavor() const override
Definition Target.h:644
const lldb::TargetSP & GetTarget() const
Definition Target.h:660
TargetEventData(const lldb::TargetSP &target_sp)
Definition Target.cpp:6036
TargetEventData(const TargetEventData &)=delete
const lldb::TargetSP & GetCreatedTarget() const
Definition Target.h:662
const TargetEventData & operator=(const TargetEventData &)=delete
static lldb::TargetSP GetTargetFromEvent(const Event *event_ptr)
Definition Target.cpp:6074
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:1961
lldb::ThreadSP CalculateThread() override
Definition Target.cpp:2715
llvm::Expected< uint32_t > AddScriptedFrameProviderDescriptor(const ScriptedFrameProviderDescriptor &descriptor)
Add or update a scripted frame provider descriptor for this target.
Definition Target.cpp:3907
StopHookCollection m_stop_hooks
Definition Target.h:2166
Module * GetExecutableModulePointer()
Definition Target.cpp:1650
void Dump(Stream *s, lldb::DescriptionLevel description_level)
Dump a description of this object to a Stream.
Definition Target.cpp:260
void DisableAllBreakpoints(bool internal_also=false)
Definition Target.cpp:1178
lldb::ModuleWP m_executable_module_wp
The marked main executable. Weak, so it can't outlive its image.
Definition Target.h:2126
bool RemoveHookByID(lldb::user_id_t uid)
Definition Target.cpp:4837
lldb::WatchpointSP CreateWatchpoint(lldb::addr_t addr, size_t size, const CompilerType *type, uint32_t kind, Status &error)
Definition Target.cpp:1060
void ApplyNameToBreakpoints(BreakpointName &bp_name)
Definition Target.cpp:937
lldb::user_id_t m_hook_next_id
Definition Target.h:2177
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:6104
lldb::TraceSP GetTrace()
Get the Trace object containing processor trace information of this target.
Definition Target.cpp:3782
PathMappingList & GetImageSearchPathList()
Definition Target.cpp:2724
void FinalizeFileActions(ProcessLaunchInfo &info)
Definition Target.cpp:3989
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:3114
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:3122
ModuleList & GetImages()
Definition Target.h:1281
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:782
static Target * GetTargetFromContexts(const ExecutionContext *exe_ctx_ptr, const SymbolContext *sc_ptr)
Definition Target.cpp:2959
lldb::addr_t GetBreakableLoadAddress(lldb::addr_t addr)
Definition Target.cpp:3129
llvm::StringMap< std::unique_ptr< BreakpointName > > BreakpointNameMap
Definition Target.h:2131
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:4149
bool SetSuppresStopHooks(bool suppress)
Definition Target.h:1984
static void ImageSearchPathsChanged(const PathMappingList &path_list, void *baton)
Definition Target.cpp:2728
llvm::Expected< lldb_private::Address > GetEntryPointAddress()
This method will return the address of the starting function for this binary, e.g.
Definition Target.cpp:3080
bool IgnoreWatchpointByID(lldb::watch_id_t watch_id, uint32_t ignore_count)
Definition Target.cpp:1614
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:748
size_t GetNumHooks() const
Definition Target.h:1964
lldb::BreakpointSP GetBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:439
std::shared_ptr< StopHook > StopHookSP
Definition Target.h:1774
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:620
void SymbolsDidLoad(ModuleList &module_list)
Definition Target.cpp:1989
bool ClearAllWatchpointHistoricValues()
Definition Target.cpp:1528
void MarkExecutableModule(const lldb::ModuleSP &module_sp)
Make module_sp the main executable without clearing the other images, unlike RebuildModuleListWithExe...
Definition Target.cpp:1654
const std::vector< StopHookSP > GetStopHooks(bool internal=false) const
Definition Target.cpp:3245
void SetTrace(const lldb::TraceSP &trace_sp)
Set the Trace object containing processor trace information of this target.
Definition Target.cpp:3780
BreakpointList & GetBreakpointList(bool internal=false)
Definition Target.cpp:425
uint32_t m_next_frame_provider_id
Definition Target.h:2158
lldb_private::SummaryStatisticsCache & GetSummaryStatisticsCache()
Definition Target.cpp:3597
const llvm::MapVector< uint32_t, ScriptedFrameProviderDescriptor > & GetScriptedFrameProviderDescriptors() const
Get all scripted frame provider descriptors for this target.
Definition Target.cpp:3968
lldb::addr_t GetSectionLoadAddress(const lldb::SectionSP &section_sp)
Definition Target.cpp:6121
llvm::StringRef GetABIName() const
Returns the name of the target's ABI plugin.
Definition Target.cpp:414
SourceManager & GetSourceManager()
Definition Target.cpp:3169
lldb::SearchFilterSP GetSearchFilterForModuleList(const FileSpecList *containingModuleList)
Definition Target.cpp:711
StopHookSP GetStopHookByID(lldb::user_id_t uid)
Definition Target.cpp:3211
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:2193
lldb::user_id_t AddBreakpointResolverOverride(BreakpointResolverOverrideUP override_up)
Add a breakpoint override resolver. This version can't fail.
Definition Target.h:1077
lldb::ProcessSP m_process_sp
Definition Target.h:2146
Debugger & GetDebugger() const
Definition Target.h:1362
lldb::SearchFilterSP m_search_filter_sp
Definition Target.h:2147
PersistentExpressionState * GetPersistentExpressionStateForLanguage(lldb::LanguageType language)
Definition Target.cpp:2809
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:4137
bool m_is_dummy_target
Used to not run stop hooks for expressions.
Definition Target.h:2173
static bool UpdateSignalFromDummy(lldb::UnixSignalsSP signals_sp, const DummySignalElement &element)
Definition Target.cpp:4095
PathMappingList m_image_search_paths
Definition Target.h:2148
bool ModuleIsExcludedForUnconstrainedSearches(const FileSpec &module_spec)
Return whether this FileSpec corresponds to a module that should be considered for general searches.
Definition Target.cpp:2047
lldb::StackFrameSP CalculateStackFrame() override
Definition Target.cpp:2717
SectionLoadList & GetSectionLoadList()
Definition Target.h:2250
lldb::addr_t GetPersistentSymbol(ConstString name)
Definition Target.cpp:3060
TargetAPIMutex GetAPIMutex()
Returns a handle resolved to the mutex to serialize on before touching the target through the SB API.
Definition Target.cpp:6100
void PrimeFromDummyTarget(Target &target)
Definition Target.cpp:227
bool RemoveScriptedFrameProviderDescriptor(uint32_t id)
Remove a scripted frame provider descriptor by id.
Definition Target.cpp:3943
lldb::RegisterTypeBuilderSP m_register_type_builder_sp
Definition Target.h:2195
static void SettingsTerminate()
Definition Target.cpp:2921
bool EnableWatchpointByID(lldb::watch_id_t watch_id)
Definition Target.cpp:1579
void DeleteBreakpointName(llvm::StringRef name)
Definition Target.cpp:914
HookSP CreateHook(Hook::HookKind kind)
Definition Target.cpp:4815
bool ResolveFileAddress(lldb::addr_t load_addr, Address &so_addr)
Definition Target.cpp:3513
bool ClearAllWatchpointHitCounts()
Definition Target.cpp:1514
CompilerType GetRegisterType(const RegisterInfo &reg_info)
Definition Target.cpp:2764
size_t ReadMemoryFromFileCache(const Address &addr, void *dst, size_t dst_len, Status &error)
Definition Target.cpp:2079
void ClearAllLoadedSections()
Definition Target.cpp:3589
std::vector< lldb::TypeSystemSP > GetScratchTypeSystems(bool create_on_demand=true)
Definition Target.cpp:2772
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:2387
void AddNameToBreakpoint(BreakpointID &id, llvm::StringRef name, Status &error)
Definition Target.cpp:859
void DumpSectionLoadList(Stream &s)
Definition Target.cpp:6127
void DeleteCurrentProcess()
Definition Target.cpp:296
BreakpointList m_internal_breakpoint_list
Definition Target.h:2130
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:2418
friend class TargetAPIMutex
Definition Target.h:603
void DisableAllowedBreakpoints()
Definition Target.cpp:1188
bool SetHookEnabledStateByID(lldb::user_id_t uid, bool enabled)
Definition Target.cpp:4859
bool LoadScriptingResources(std::list< Status > &errors, bool continue_on_error=true)
Definition Target.h:1256
bool SetSectionUnloaded(const lldb::SectionSP &section_sp)
Definition Target.cpp:3567
lldb::TargetSP CalculateTarget() override
Definition Target.cpp:2711
const lldb::ProcessSP & GetProcessSP() const
Definition Target.cpp:330
void ClearModules(bool delete_locations)
Definition Target.cpp:1659
void RemoveNameFromBreakpoint(lldb::BreakpointSP &bp_sp, llvm::StringRef name)
Definition Target.cpp:924
BreakpointNameMap m_breakpoint_names
Definition Target.h:2132
bool RemoveBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:1212
llvm::MapVector< uint32_t, ScriptedFrameProviderDescriptor > m_frame_provider_descriptors
Map of scripted frame provider descriptors for this target.
Definition Target.h:2156
static bool ResetSignalFromDummy(lldb::UnixSignalsSP signals_sp, const DummySignalElement &element)
Definition Target.cpp:4122
Architecture * GetArchitecturePlugin() const
Definition Target.h:1360
lldb::ModuleSP GetOrCreateModule(const ModuleSpec &module_spec, bool notify, Status *error_ptr=nullptr, bool invoke_symbol_locators=true)
Find a binary on the system and return its Module, or return an existing Module that is already in th...
Definition Target.cpp:2470
llvm::json::Value ReportStatistics(const lldb_private::StatisticsOptions &options)
Get metrics associated with this target in JSON format.
Definition Target.cpp:6113
friend class TargetList
Definition Target.h:601
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:2862
TargetStats & GetStatistics()
Definition Target.h:2220
void EnableAllBreakpoints(bool internal_also=false)
Definition Target.cpp:1195
Status Launch(ProcessLaunchInfo &launch_info, Stream *stream)
Definition Target.cpp:3612
bool DisableBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:1232
lldb::BreakpointSP CreateBreakpointAtUserEntry(Status &error)
Definition Target.cpp:451
std::map< lldb::user_id_t, StopHookSP > StopHookCollection
Definition Target.h:2165
llvm::Expected< lldb::TraceSP > CreateTrace()
Create a Trace object for the current target using the using the default supported tracing technology...
Definition Target.cpp:3784
lldb::TraceSP m_trace_sp
An optional lldb_private::Trace object containing processor trace information of this target.
Definition Target.h:2187
lldb::user_id_t GetGloballyUniqueID() const
Get the globally unique ID for this target.
Definition Target.h:702
bool RemoveAllWatchpoints(bool end_to_end=true)
Definition Target.cpp:1432
bool ReadPointerFromMemory(const Address &addr, Status &error, Address &pointer_addr, bool force_live_memory=false)
Definition Target.cpp:2440
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:3197
WatchpointList m_watchpoint_list
Definition Target.h:2141
BreakpointList m_breakpoint_list
Definition Target.h:2129
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:991
lldb::SourceManagerUP m_source_manager_up
Definition Target.h:2163
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:2138
bool RemoveWatchpointByID(lldb::watch_id_t watch_id)
Definition Target.cpp:1598
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, uint32_t stop_id=SectionLoadHistory::eStopIDNow, bool allow_section_end=false)
Definition Target.cpp:3507
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:2338
HookSP GetHookByID(lldb::user_id_t uid)
Definition Target.cpp:4844
void NotifyWillClearList(const ModuleList &module_list) override
Definition Target.cpp:1923
bool SetArchitecture(const ArchSpec &arch_spec, bool set_platform=false, bool merge=true)
Set the architecture for this target.
Definition Target.cpp:1807
void ClearBreakpointResolverOverrides()
Definition Target.h:1095
bool RemoveBreakpointResolverOverride(lldb::user_id_t override_id)
Definition Target.h:1090
void NotifyModuleAdded(const ModuleList &module_list, const lldb::ModuleSP &module_sp) override
Implementing of ModuleList::Notifier.
Definition Target.cpp:1925
llvm::Expected< lldb::TypeSystemSP > GetScratchTypeSystemForLanguage(lldb::LanguageType language, bool create_on_demand=true)
Definition Target.cpp:2737
void ConfigureBreakpointName(BreakpointName &bp_name, const BreakpointOptions &options, const BreakpointName::Permissions &permissions)
Definition Target.cpp:929
lldb_private::SummaryStatisticsSP GetSummaryStatisticsSPForProviderName(lldb_private::TypeSummaryImpl &summary_provider)
Definition Target.cpp:3591
lldb::SearchFilterSP GetSearchFilterForModuleAndCUList(const FileSpecList *containingModules, const FileSpecList *containingSourceFiles)
Definition Target.cpp:728
lldb::ModuleSP GetExecutableModule()
Gets the module for the main executable.
Definition Target.cpp:1630
bool SetStopHookActiveStateByID(lldb::user_id_t uid, bool active_state)
Definition Target.cpp:3221
const lldb::ProcessSP & CreateProcess(lldb::ListenerSP listener_sp, llvm::StringRef plugin_name, const FileSpec *crash_file, bool can_connect)
Definition Target.cpp:318
void SetAllStopHooksActiveState(bool active_state)
Definition Target.cpp:3232
std::vector< StopHookSP > m_internal_stop_hooks
Definition Target.h:2168
lldb::ExpressionVariableSP GetPersistentVariable(ConstString name)
Definition Target.cpp:3041
void NotifyModulesRemoved(lldb_private::ModuleList &module_list) override
Definition Target.cpp:1957
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:3175
size_t ReadCStringFromMemory(const Address &addr, std::string &out_str, Status &error, bool force_live_memory=false)
Definition Target.cpp:2248
void SetAllHooksEnabledState(bool enabled)
Definition Target.cpp:4867
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:2113
std::recursive_mutex m_frame_provider_descriptors_mutex
Definition Target.h:2157
lldb::user_id_t m_target_unique_id
The globally unique ID assigned to this target.
Definition Target.h:2179
void ModulesDidUnload(ModuleList &module_list, bool delete_locations)
Definition Target.cpp:2005
void CalculateExecutionContext(ExecutionContext &exe_ctx) override
Reconstruct the object's execution context into sc.
Definition Target.cpp:2719
llvm::Expected< lldb::DisassemblerSP > ReadInstructions(const Address &start_addr, uint32_t count, const char *flavor_string=nullptr)
Definition Target.cpp:3135
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:3809
void NotifyModuleUpdated(const ModuleList &module_list, const lldb::ModuleSP &old_module_sp, const lldb::ModuleSP &new_module_sp) override
Definition Target.cpp:1945
SummaryStatisticsCache m_summary_statistics_cache
Definition Target.h:2127
Target(const Target &)=delete
void RegisterInternalStopHooks()
Status SerializeBreakpointsToFile(const FileSpec &file, const BreakpointIDList &bp_ids, bool append)
Definition Target.cpp:1273
void DidExec()
Called as the last function in Process::DidExec().
Definition Target.cpp:1667
void SaveScriptedLaunchInfo(lldb_private::ProcessInfo &process_info)
Definition Target.cpp:3601
bool GetSuppressStopHooks()
Definition Target.h:1990
std::string m_label
Definition Target.h:2122
lldb::user_id_t m_stop_hook_next_id
Definition Target.h:2167
static FileSpecList GetDefaultExecutableSearchPaths()
Definition Target.cpp:2923
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:765
void NotifyBreakpointChanged(Breakpoint &bp, lldb::BreakpointEventType event_kind)
Sends a breakpoint notification event.
Definition Target.cpp:6131
lldb::SearchFilterSP GetSearchFilterForModule(const FileSpec *containingModule)
Definition Target.cpp:693
llvm::StringMapEntry< DummySignalValues > DummySignalElement
Definition Target.h:2052
static llvm::StringRef GetStaticBroadcasterClass()
Definition Target.cpp:177
static FileSpecList GetDefaultDebugFileSearchPaths()
Definition Target.cpp:2927
void EnableAllowedBreakpoints()
Definition Target.cpp:1205
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:2112
llvm::Error SetLabel(llvm::StringRef label)
Set a label for a target.
Definition Target.cpp:2942
uint32_t m_latest_stop_hook_id
Definition Target.h:2169
void RunModuleHooks(bool is_load)
Definition Target.cpp:4872
std::map< lldb::user_id_t, BreakpointResolverOverrideUP > m_breakpoint_overrides
Definition Target.h:2135
StackFrameRecognizerManager & GetFrameRecognizerManager()
Definition Target.h:2028
void RemoveAllowedBreakpoints()
Definition Target.cpp:1157
bool DisableAllWatchpoints(bool end_to_end=true)
Definition Target.cpp:1461
bool RunStopHooks(bool at_initial_stop=false)
Definition Target.cpp:3256
void ClearSectionLoadList()
Definition Target.cpp:6125
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:2325
lldb::PlatformSP m_platform_sp
The platform for this target.
Definition Target.h:2112
void UndoCreateHook(lldb::user_id_t uid)
Removes the most recently created hook.
Definition Target.cpp:4830
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:2892
FileSpecList GetSafeAutoLoadPaths() const
Get the list of paths that LLDB will consider automatically loading scripting resources from.
Definition Target.cpp:6147
static TargetProperties & GetGlobalProperties()
Definition Target.cpp:3471
Status Install(ProcessLaunchInfo *launch_info)
Definition Target.cpp:3479
HookSP GetHookAtIndex(size_t index)
Definition Target.cpp:4851
lldb::PlatformSP GetPlatform()
Definition Target.h:2004
void NotifyModuleRemoved(const ModuleList &module_list, const lldb::ModuleSP &module_sp) override
Definition Target.cpp:1935
lldb::BreakpointSP CreateAddressInModuleBreakpoint(lldb::addr_t file_addr, bool internal, const FileSpec &file_spec, bool request_hardware)
Definition Target.cpp:599
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:510
void RemoveAllBreakpoints(bool internal_also=false)
Definition Target.cpp:1166
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:493
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:2931
void ResetBreakpointHitCounts()
Resets the hit count of all breakpoints.
Definition Target.cpp:1269
std::unique_ptr< BreakpointResolverOverride > BreakpointResolverOverrideUP
Definition Target.h:1049
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition Target.h:1279
const ArchSpec & GetArchitecture() const
Definition Target.h:1321
WatchpointList & GetWatchpointList()
Definition Target.h:985
@ eBroadcastBitWatchpointChanged
Definition Target.h:610
@ eBroadcastBitBreakpointChanged
Definition Target.h:607
@ eBroadcastBitNewTargetCreated
Definition Target.h:613
unsigned m_next_persistent_variable_index
Definition Target.h:2178
bool EnableBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:1250
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:2429
void InvalidateThreadFrameProviders()
Invalidate all potentially cached frame providers for all threads and trigger a stack changed event f...
Definition Target.cpp:3974
TargetStats m_stats
Definition Target.h:2203
bool IgnoreAllWatchpoints(uint32_t ignore_count)
Definition Target.cpp:1543
void AddBreakpoint(lldb::BreakpointSP breakpoint_sp, bool internal)
Definition Target.cpp:836
std::string m_target_session_name
The target session name for this target, used to name debugging sessions in DAP.
Definition Target.h:2182
TypeSystemMap m_scratch_type_system_map
Definition Target.h:2149
void AddBreakpointName(std::unique_ptr< BreakpointName > bp_name)
Definition Target.cpp:886
void SetTargetSessionName(llvm::StringRef target_session_name)
Set the target session name for this target.
Definition Target.h:735
SectionLoadHistory m_section_load_history
Definition Target.h:2128
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:1029
void GetBreakpointNames(std::vector< std::string > &names)
Definition Target.cpp:951
bool IsDummyTarget() const
Definition Target.h:691
Target(Debugger &debugger, const ArchSpec &target_arch, const lldb::PlatformSP &platform_sp, bool is_dummy_target)
Construct with optional file and arch.
Definition Target.cpp:182
size_t UnloadModuleSections(const lldb::ModuleSP &module_sp)
Definition Target.cpp:3548
llvm::StringRef GetTargetSessionName()
Get the target session name for this target.
Definition Target.h:723
const std::string & GetLabel() const
Definition Target.h:704
std::map< lldb::user_id_t, HookSP > HookCollection
Definition Target.h:2175
bool m_valid
This records the last natural stop at which we ran a stop-hook.
Definition Target.h:2171
bool DisableWatchpointByID(lldb::watch_id_t watch_id)
Definition Target.cpp:1560
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:4080
void ClearScriptedFrameProviderDescriptors()
Clear all scripted frame provider descriptors for this target.
Definition Target.cpp:3956
void RebuildModuleListWithExecutable(lldb::ModuleSP &module_sp, LoadDependentFiles load_dependent_files=eLoadDependentsDefault)
Clear the module list and rebuild it around a new main executable.
Definition Target.cpp:1673
lldb::WatchpointSP m_last_created_watchpoint
Definition Target.h:2142
Status CreateBreakpointsFromFile(const FileSpec &file, BreakpointIDList &new_bps)
Definition Target.cpp:1365
Debugger & m_debugger
Definition Target.h:2111
void SetREPL(lldb::LanguageType language, lldb::REPLSP repl_sp)
Definition Target.cpp:383
lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules, const FileSpecList *containingSourceFiles, const char *func_names[], size_t num_names, lldb::FunctionNameType func_name_type_mask, lldb::LanguageType language, lldb::addr_t offset, LazyBool skip_prologue, bool internal, bool request_hardware)
lldb::StackFrameRecognizerManagerUP m_frame_recognizer_manager_up
Stores the frame recognizers of this target.
Definition Target.h:2189
HookCollection m_hooks
Definition Target.h:2176
lldb::REPLSP GetREPL(Status &err, lldb::LanguageType language, const char *repl_options, bool can_create)
Definition Target.cpp:332
std::shared_ptr< Hook > HookSP
Definition Target.h:1945
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:2829
ModuleList m_images
The list of images for this process (shared libraries and anything dynamically loaded).
Definition Target.h:2123
lldb::ProcessSP CalculateProcess() override
Definition Target.cpp:2713
void PrintDummySignals(Stream &strm, Args &signals)
Print all the signals set in this target.
Definition Target.cpp:4174
void SetPlatform(const lldb::PlatformSP &platform_sp)
Definition Target.h:2006
bool SetSectionLoadAddress(const lldb::SectionSP &section, lldb::addr_t load_addr, bool warn_multiple=false)
Definition Target.cpp:3518
BreakpointName * FindBreakpointName(llvm::StringRef name, bool can_create, Status &error)
Definition Target.cpp:891
Status Attach(ProcessAttachInfo &attach_info, Stream *stream)
Definition Target.cpp:3815
std::map< lldb::LanguageType, lldb::REPLSP > REPLMap
Definition Target.h:2160
static void SetDefaultArchitecture(const ArchSpec &arch)
Definition Target.cpp:2935
lldb::BreakpointSP m_last_created_breakpoint
Definition Target.h:2140
lldb::WatchpointSP GetLastCreatedWatchpoint()
Definition Target.h:981
bool RemoveStopHookByID(lldb::user_id_t uid)
Definition Target.cpp:3204
friend class Debugger
Definition Target.h:602
lldb::BreakpointSP GetLastCreatedBreakpoint()
Definition Target.h:873
static void SettingsInitialize()
Definition Target.cpp:2919
~Target() override
Definition Target.cpp:221
bool EnableAllWatchpoints(bool end_to_end=true)
Definition Target.cpp:1488
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:2120
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:2973
bool MergeArchitecture(const ArchSpec &arch_spec)
Definition Target.cpp:1898
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:4920
@ 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
BreakpointConditionMode
Modes for evaluating breakpoint conditions.
ExpressionEvaluationPhase
Expression Evaluation Stages.
std::shared_ptr< lldb_private::Trace > TraceSP
std::shared_ptr< lldb_private::ScriptedHookInterface > ScriptedHookInterfaceSP
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::SearchFilter > SearchFilterSP
std::shared_ptr< lldb_private::BreakpointResolver > BreakpointResolverSP
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
std::unique_ptr< lldb_private::StackFrameRecognizerManager > StackFrameRecognizerManagerUP
std::weak_ptr< lldb_private::Module > ModuleWP
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::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:2048
UserID(lldb::user_id_t uid=LLDB_INVALID_UID)
Construct with optional user ID.
Definition UserID.h:33