LLDB mainline
Target.h
Go to the documentation of this file.
1//===-- Target.h ------------------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_TARGET_TARGET_H
10#define LLDB_TARGET_TARGET_H
11
12#include <list>
13#include <map>
14#include <memory>
15#include <string>
16#include <vector>
17
21#include "lldb/Core/Address.h"
43#include "lldb/lldb-public.h"
44#include "llvm/ADT/StringRef.h"
45
46namespace lldb_private {
47
49
55
62
68
74
81
86
88public:
89 TargetProperties(Target *target);
90
92
94
95 void SetDefaultArchitecture(const ArchSpec &arch);
96
97 bool GetMoveToNearestCode() const;
98
100
102
103 bool GetPreloadSymbols() const;
104
105 void SetPreloadSymbols(bool b);
106
107 bool GetDisableASLR() const;
108
109 void SetDisableASLR(bool b);
110
111 bool GetInheritTCC() const;
112
113 void SetInheritTCC(bool b);
114
115 bool GetDetachOnError() const;
116
117 void SetDetachOnError(bool b);
118
119 bool GetDisableSTDIO() const;
120
121 void SetDisableSTDIO(bool b);
122
123 llvm::StringRef GetLaunchWorkingDirectory() const;
124
125 bool GetParallelModuleLoad() const;
126
127 const char *GetDisassemblyFlavor() const;
128
129 const char *GetDisassemblyCPU() const;
130
131 const char *GetDisassemblyFeatures() const;
132
134
136
137 llvm::StringRef GetArg0() const;
138
139 void SetArg0(llvm::StringRef arg);
140
141 bool GetRunArguments(Args &args) const;
142
143 void SetRunArguments(const Args &args);
144
145 // Get the whole environment including the platform inherited environment and
146 // the target specific environment, excluding the unset environment variables.
148 // Get the platform inherited environment, excluding the unset environment
149 // variables.
151 // Get the target specific environment only, without the platform inherited
152 // environment.
154 // Set the target specific environment.
155 void SetEnvironment(Environment env);
156
157 bool GetSkipPrologue() const;
158
160
162
163 bool GetAutoSourceMapRelative() const;
164
166
168
170
172
174
176
178
179 bool GetEnableAutoApplyFixIts() const;
180
181 uint64_t GetNumberOfRetriesWithFixits() const;
182
183 bool GetEnableNotifyAboutFixIts() const;
184
186
187 bool GetEnableSyntheticValue() const;
188
190
191 uint32_t GetMaxZeroPaddingInFloatFormat() const;
192
194
195 /// Get the max depth value, augmented with a bool to indicate whether the
196 /// depth is the default.
197 ///
198 /// When the user has customized the max depth, the bool will be false.
199 ///
200 /// \returns the max depth, and true if the max depth is the system default,
201 /// otherwise false.
202 std::pair<uint32_t, bool> GetMaximumDepthOfChildrenToDisplay() const;
203
204 uint32_t GetMaximumSizeOfStringSummary() const;
205
206 uint32_t GetMaximumMemReadSize() const;
207
211
212 void SetStandardInputPath(llvm::StringRef path);
213 void SetStandardOutputPath(llvm::StringRef path);
214 void SetStandardErrorPath(llvm::StringRef path);
215
216 void SetStandardInputPath(const char *path) = delete;
217 void SetStandardOutputPath(const char *path) = delete;
218 void SetStandardErrorPath(const char *path) = delete;
219
221
223
224 llvm::StringRef GetExpressionPrefixContents();
225
226 uint64_t GetExprErrorLimit() const;
227
228 uint64_t GetExprAllocAddress() const;
229
230 uint64_t GetExprAllocSize() const;
231
232 uint64_t GetExprAllocAlign() const;
233
234 bool GetUseHexImmediates() const;
235
236 bool GetUseFastStepping() const;
237
239
241
243
245
247
248 bool GetUserSpecifiedTrapHandlerNames(Args &args) const;
249
250 void SetUserSpecifiedTrapHandlerNames(const Args &args);
251
253
255
257
259
261
262 void SetProcessLaunchInfo(const ProcessLaunchInfo &launch_info);
263
264 bool GetInjectLocalVariables(ExecutionContext *exe_ctx) const;
265
266 bool GetUseDIL(ExecutionContext *exe_ctx) const;
267
268 void SetUseDIL(ExecutionContext *exe_ctx, bool b);
269
271
273
274 bool GetAutoInstallMainExecutable() const;
275
277
278 void SetDebugUtilityExpression(bool debug);
279
280 bool GetDebugUtilityExpression() const;
281
282private:
283 std::optional<bool>
284 GetExperimentalPropertyValue(size_t prop_idx,
285 ExecutionContext *exe_ctx = nullptr) const;
286
287 // Callbacks for m_launch_info.
298
299 // Settings checker for target.jit-save-objects-dir:
300 void CheckJITObjectsDir();
301
303
304 // Member variables.
306 std::unique_ptr<TargetExperimentalProperties> m_experimental_properties_up;
308};
309
311public:
313
314// MSVC has a bug here that reports C4268: 'const' static/global data
315// initialized with compiler generated default constructor fills the object
316// with zeros. Confirmed that MSVC is *not* zero-initializing, it's just a
317// bogus warning.
318#if defined(_MSC_VER)
319#pragma warning(push)
320#pragma warning(disable : 4268)
321#endif
322 static constexpr std::chrono::milliseconds default_timeout{500};
323#if defined(_MSC_VER)
324#pragma warning(pop)
325#endif
326
329
331
335
337
338 void SetLanguage(lldb::LanguageType language_type) {
339 m_language = SourceLanguage(language_type);
340 }
341
343 m_preferred_lookup_contexts = std::move(contexts);
344 }
345
349
350 /// Set the language using a pair of language code and version as
351 /// defined by the DWARF 6 specification.
352 /// WARNING: These codes may change until DWARF 6 is finalized.
353 void SetLanguage(uint16_t name, uint32_t version) {
354 m_language = SourceLanguage(name, version);
355 }
356
357 bool DoesCoerceToId() const { return m_coerce_to_id; }
358
359 const char *GetPrefix() const {
360 return (m_prefix.empty() ? nullptr : m_prefix.c_str());
361 }
362
363 void SetPrefix(const char *prefix) {
364 if (prefix && prefix[0])
365 m_prefix = prefix;
366 else
367 m_prefix.clear();
368 }
369
370 void SetCoerceToId(bool coerce = true) { m_coerce_to_id = coerce; }
371
372 bool DoesUnwindOnError() const { return m_unwind_on_error; }
373
374 void SetUnwindOnError(bool unwind = false) { m_unwind_on_error = unwind; }
375
377
378 void SetIgnoreBreakpoints(bool ignore = false) {
379 m_ignore_breakpoints = ignore;
380 }
381
382 bool DoesKeepInMemory() const { return m_keep_in_memory; }
383
384 void SetKeepInMemory(bool keep = true) { m_keep_in_memory = keep; }
385
387
388 void
392
393 const Timeout<std::micro> &GetTimeout() const { return m_timeout; }
394
395 void SetTimeout(const Timeout<std::micro> &timeout) { m_timeout = timeout; }
396
400
402 m_one_thread_timeout = timeout;
403 }
404
405 bool GetTryAllThreads() const { return m_try_others; }
406
407 void SetTryAllThreads(bool try_others = true) { m_try_others = try_others; }
408
409 bool GetStopOthers() const { return m_stop_others; }
410
411 void SetStopOthers(bool stop_others = true) { m_stop_others = stop_others; }
412
413 bool GetDebug() const { return m_debug; }
414
415 void SetDebug(bool b) {
416 m_debug = b;
417 if (m_debug)
419 }
420
422
424
425 bool GetColorizeErrors() const { return m_ansi_color_errors; }
426
428
429 bool GetTrapExceptions() const { return m_trap_exceptions; }
430
432
433 bool GetREPLEnabled() const { return m_repl; }
434
435 void SetREPLEnabled(bool b) { m_repl = b; }
436
439 m_cancel_callback = callback;
440 }
441
443 return ((m_cancel_callback != nullptr)
445 : false);
446 }
447
448 // Allows the expression contents to be remapped to point to the specified
449 // file and line using #line directives.
450 void SetPoundLine(const char *path, uint32_t line) const {
451 if (path && path[0]) {
452 m_pound_line_file = path;
453 m_pound_line_line = line;
454 } else {
455 m_pound_line_file.clear();
457 }
458 }
459
460 const char *GetPoundLineFilePath() const {
461 return (m_pound_line_file.empty() ? nullptr : m_pound_line_file.c_str());
462 }
463
464 uint32_t GetPoundLineLine() const { return m_pound_line_line; }
465
467
471
473
475
476 void SetRetriesWithFixIts(uint64_t number_of_retries) {
477 m_retries_with_fixits = number_of_retries;
478 }
479
480 uint64_t GetRetriesWithFixIts() const { return m_retries_with_fixits; }
481
483
485
486 /// Set language-plugin specific option called \c option_name to
487 /// the specified boolean \c value.
488 llvm::Error SetBooleanLanguageOption(llvm::StringRef option_name, bool value);
489
490 /// Get the language-plugin specific boolean option called \c option_name.
491 ///
492 /// If the option doesn't exist or is not a boolean option, returns false.
493 /// Otherwise returns the boolean value of the option.
494 llvm::Expected<bool>
495 GetBooleanLanguageOption(llvm::StringRef option_name) const;
496
497 void SetCppIgnoreContextQualifiers(bool value);
498
500
501private:
503
505
508 std::string m_prefix;
509 bool m_coerce_to_id = false;
510 bool m_unwind_on_error = true;
512 bool m_keep_in_memory = false;
513 bool m_try_others = true;
514 bool m_stop_others = true;
515 bool m_debug = false;
516 bool m_trap_exceptions = true;
517 bool m_repl = false;
523 /// True if the executed code should be treated as utility code that is only
524 /// used by LLDB internally.
526
531 void *m_cancel_callback_baton = nullptr;
532 // If m_pound_line_file is not empty and m_pound_line_line is non-zero, use
533 // #line %u "%s" before the expression content to remap where the source
534 // originates
535 mutable std::string m_pound_line_file;
536 mutable uint32_t m_pound_line_line = 0;
537
538 /// Dictionary mapping names of language-plugin specific options
539 /// to values.
541
542 /// During expression evaluation, any SymbolContext in this list will be
543 /// used for symbol/function lookup before any other context (except for
544 /// the module corresponding to the current frame).
546};
547
548// Target
549class Target : public std::enable_shared_from_this<Target>,
550 public TargetProperties,
551 public Broadcaster,
553 public ModuleList::Notifier {
554public:
555 friend class TargetList;
556 friend class Debugger;
557
558 /// Broadcaster event bits definitions.
559 enum {
567 };
568
569 // These two functions fill out the Broadcaster interface:
570
571 static llvm::StringRef GetStaticBroadcasterClass();
572
573 llvm::StringRef GetBroadcasterClass() const override {
575 }
576
577 // This event data class is for use by the TargetList to broadcast new target
578 // notifications.
579 class TargetEventData : public EventData {
580 public:
581 TargetEventData(const lldb::TargetSP &target_sp);
582
583 TargetEventData(const lldb::TargetSP &target_sp,
584 const ModuleList &module_list);
585
586 // Constructor for eBroadcastBitNewTargetCreated events. For this event
587 // type:
588 // - target_sp is the parent target (the subject/broadcaster of the event)
589 // - created_target_sp is the newly created target
590 TargetEventData(const lldb::TargetSP &target_sp,
591 const lldb::TargetSP &created_target_sp);
592
594
595 static llvm::StringRef GetFlavorString();
596
597 llvm::StringRef GetFlavor() const override {
599 }
600
601 void Dump(Stream *s) const override;
602
603 static const TargetEventData *GetEventDataFromEvent(const Event *event_ptr);
604
605 static lldb::TargetSP GetTargetFromEvent(const Event *event_ptr);
606
607 // For eBroadcastBitNewTargetCreated events, returns the newly created
608 // target. For other event types, returns an invalid target.
609 static lldb::TargetSP GetCreatedTargetFromEvent(const Event *event_ptr);
610
611 static ModuleList GetModuleListFromEvent(const Event *event_ptr);
612
613 const lldb::TargetSP &GetTarget() const { return m_target_sp; }
614
616 return m_created_target_sp;
617 }
618
619 const ModuleList &GetModuleList() const { return m_module_list; }
620
621 private:
625
627 const TargetEventData &operator=(const TargetEventData &) = delete;
628 };
629
630 ~Target() override;
631
632 static void SettingsInitialize();
633
634 static void SettingsTerminate();
635
637
639
641
642 static void SetDefaultArchitecture(const ArchSpec &arch);
643
644 bool IsDummyTarget() const { return m_is_dummy_target; }
645
646 /// Get the globally unique ID for this target.
647 ///
648 /// This ID is unique across all debugger instances and all targets,
649 /// within the same lldb process. The ID is assigned
650 /// during target construction and remains constant for the target's lifetime.
651 /// The first target created (typically the dummy target) gets ID 1.
652 ///
653 /// \return
654 /// The globally unique ID for this target.
656
657 const std::string &GetLabel() const { return m_label; }
658
659 /// Set a label for a target.
660 ///
661 /// The label cannot be used by another target or be only integral.
662 ///
663 /// \return
664 /// The label for this target or an error if the label didn't match the
665 /// requirements.
666 llvm::Error SetLabel(llvm::StringRef label);
667
668 /// Get the target session name for this target.
669 ///
670 /// Provides a meaningful name for IDEs or tools to display for dynamically
671 /// created targets. Defaults to "Session {ID}" based on the globally unique
672 /// ID.
673 ///
674 /// \return
675 /// The target session name for this target.
676 llvm::StringRef GetTargetSessionName() { return m_target_session_name; }
677
678 /// Set the target session name for this target.
679 ///
680 /// This should typically be set along with the event
681 /// eBroadcastBitNewTargetCreated. Useful for scripts or triggers that
682 /// automatically create targets and want to provide meaningful names that
683 /// IDEs or other tools can display to help users identify the origin and
684 /// purpose of each target.
685 ///
686 /// \param[in] target_session_name
687 /// The target session name to set for this target.
688 void SetTargetSessionName(llvm::StringRef target_session_name) {
689 m_target_session_name = target_session_name.str();
690 }
691
692 /// Find a binary on the system and return its Module,
693 /// or return an existing Module that is already in the Target.
694 ///
695 /// Given a ModuleSpec, find a binary satisifying that specification,
696 /// or identify a matching Module already present in the Target,
697 /// and return a shared pointer to it.
698 ///
699 /// Note that this function previously also preloaded the module's symbols
700 /// depending on a setting. This function no longer does any module
701 /// preloading because that can potentially cause deadlocks when called in
702 /// parallel with this function.
703 ///
704 /// \param[in] module_spec
705 /// The criteria that must be matched for the binary being loaded.
706 /// e.g. UUID, architecture, file path.
707 ///
708 /// \param[in] notify
709 /// If notify is true, and the Module is new to this Target,
710 /// Target::ModulesDidLoad will be called. See note in
711 /// Target::ModulesDidLoad about thread-safety with
712 /// Target::GetOrCreateModule.
713 /// If notify is false, it is assumed that the caller is adding
714 /// multiple Modules and will call ModulesDidLoad with the
715 /// full list at the end.
716 /// ModulesDidLoad must be called when a Module/Modules have
717 /// been added to the target, one way or the other.
718 ///
719 /// \param[out] error_ptr
720 /// Optional argument, pointing to a Status object to fill in
721 /// with any results / messages while attempting to find/load
722 /// this binary. Many callers will be internal functions that
723 /// will handle / summarize the failures in a custom way and
724 /// don't use these messages.
725 ///
726 /// \return
727 /// An empty ModuleSP will be returned if no matching file
728 /// was found. If error_ptr was non-nullptr, an error message
729 /// will likely be provided.
730 lldb::ModuleSP GetOrCreateModule(const ModuleSpec &module_spec, bool notify,
731 Status *error_ptr = nullptr);
732
733 // Settings accessors
734
736
737 std::recursive_mutex &GetAPIMutex();
738
740
741 void CleanupProcess();
742
743 /// Dump a description of this object to a Stream.
744 ///
745 /// Dump a description of the contents of this object to the
746 /// supplied stream \a s. The dumped content will be only what has
747 /// been loaded or parsed up to this point at which this function
748 /// is called, so this is a good way to see what has been parsed
749 /// in a target.
750 ///
751 /// \param[in] s
752 /// The stream to which to dump the object description.
753 void Dump(Stream *s, lldb::DescriptionLevel description_level);
754
755 // If listener_sp is null, the listener of the owning Debugger object will be
756 // used.
758 llvm::StringRef plugin_name,
759 const FileSpec *crash_file,
760 bool can_connect);
761
762 const lldb::ProcessSP &GetProcessSP() const;
763
764 bool IsValid() { return m_valid; }
765
766 void Destroy();
767
768 Status Launch(ProcessLaunchInfo &launch_info,
769 Stream *stream); // Optional stream to receive first stop info
770
771 Status Attach(ProcessAttachInfo &attach_info,
772 Stream *stream); // Optional stream to receive first stop info
773
774 /// Add or update a scripted frame provider descriptor for this target.
775 /// All new threads in this target will check if they match any descriptors
776 /// to create their frame providers.
777 ///
778 /// \param[in] descriptor
779 /// The descriptor to add or update.
780 ///
781 /// \return
782 /// The descriptor identifier if the registration succeeded, otherwise an
783 /// llvm::Error.
784 llvm::Expected<uint32_t> AddScriptedFrameProviderDescriptor(
785 const ScriptedFrameProviderDescriptor &descriptor);
786
787 /// Remove a scripted frame provider descriptor by id.
788 ///
789 /// \param[in] id
790 /// The id of the descriptor to remove.
791 ///
792 /// \return
793 /// True if a descriptor was removed, false if no descriptor with that
794 /// id existed.
796
797 /// Clear all scripted frame provider descriptors for this target.
799
800 /// Get all scripted frame provider descriptors for this target.
801 const llvm::DenseMap<uint32_t, ScriptedFrameProviderDescriptor> &
803
804protected:
805 /// Invalidate all potentially cached frame providers for all threads
806 /// and trigger a stack changed event for all threads.
808
809public:
810 // This part handles the breakpoints.
811
812 BreakpointList &GetBreakpointList(bool internal = false);
813
814 const BreakpointList &GetBreakpointList(bool internal = false) const;
815
819
821
823
824 // Use this to create a file and line breakpoint to a given module or all
825 // module it is nullptr
826 lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules,
827 const FileSpec &file, uint32_t line_no,
828 uint32_t column, lldb::addr_t offset,
829 LazyBool check_inlines,
830 LazyBool skip_prologue, bool internal,
831 bool request_hardware,
832 LazyBool move_to_nearest_code);
833
834 // Use this to create breakpoint that matches regex against the source lines
835 // in files given in source_file_list: If function_names is non-empty, also
836 // filter by function after the matches are made.
838 const FileSpecList *containingModules,
839 const FileSpecList *source_file_list,
840 const std::unordered_set<std::string> &function_names,
841 RegularExpression source_regex, bool internal, bool request_hardware,
842 LazyBool move_to_nearest_code);
843
844 // Use this to create a breakpoint from a load address
845 lldb::BreakpointSP CreateBreakpoint(lldb::addr_t load_addr, bool internal,
846 bool request_hardware);
847
848 // Use this to create a breakpoint from a file address and a module file spec
850 bool internal,
851 const FileSpec &file_spec,
852 bool request_hardware);
853
854 // Use this to create Address breakpoints:
855 lldb::BreakpointSP CreateBreakpoint(const Address &addr, bool internal,
856 bool request_hardware);
857
858 // Use this to create a function breakpoint by regexp in
859 // containingModule/containingSourceFiles, or all modules if it is nullptr
860 // When "skip_prologue is set to eLazyBoolCalculate, we use the current
861 // target setting, else we use the values passed in
863 const FileSpecList *containingModules,
864 const FileSpecList *containingSourceFiles, RegularExpression func_regexp,
865 lldb::LanguageType requested_language, LazyBool skip_prologue,
866 bool internal, bool request_hardware);
867
868 // Use this to create a function breakpoint by name in containingModule, or
869 // all modules if it is nullptr When "skip_prologue is set to
870 // eLazyBoolCalculate, we use the current target setting, else we use the
871 // values passed in. func_name_type_mask is or'ed values from the
872 // FunctionNameType enum.
874 const FileSpecList *containingModules,
875 const FileSpecList *containingSourceFiles, const char *func_name,
876 lldb::FunctionNameType func_name_type_mask, lldb::LanguageType language,
877 lldb::addr_t offset, bool offset_is_insn_count, LazyBool skip_prologue,
878 bool internal, bool request_hardware);
879
881 CreateExceptionBreakpoint(enum lldb::LanguageType language, bool catch_bp,
882 bool throw_bp, bool internal,
883 Args *additional_args = nullptr,
884 Status *additional_args_error = nullptr);
885
887 const llvm::StringRef class_name, const FileSpecList *containingModules,
888 const FileSpecList *containingSourceFiles, bool internal,
889 bool request_hardware, StructuredData::ObjectSP extra_args_sp,
890 Status *creation_error = nullptr);
891
892 // This is the same as the func_name breakpoint except that you can specify a
893 // vector of names. This is cheaper than a regular expression breakpoint in
894 // the case where you just want to set a breakpoint on a set of names you
895 // already know. func_name_type_mask is or'ed values from the
896 // FunctionNameType enum.
898 const FileSpecList *containingModules,
899 const FileSpecList *containingSourceFiles, const char *func_names[],
900 size_t num_names, lldb::FunctionNameType func_name_type_mask,
901 lldb::LanguageType language, lldb::addr_t offset, LazyBool skip_prologue,
902 bool internal, bool request_hardware);
903
905 CreateBreakpoint(const FileSpecList *containingModules,
906 const FileSpecList *containingSourceFiles,
907 const std::vector<std::string> &func_names,
908 lldb::FunctionNameType func_name_type_mask,
909 lldb::LanguageType language, lldb::addr_t m_offset,
910 LazyBool skip_prologue, bool internal,
911 bool request_hardware);
912
913 // Use this to create a general breakpoint:
915 lldb::BreakpointResolverSP &resolver_sp,
916 bool internal, bool request_hardware,
917 bool resolve_indirect_symbols);
918
919 // Use this to create a watchpoint:
921 const CompilerType *type, uint32_t kind,
922 Status &error);
923
927
929
930 // Manages breakpoint names:
931 void AddNameToBreakpoint(BreakpointID &id, llvm::StringRef name,
932 Status &error);
933
934 void AddNameToBreakpoint(lldb::BreakpointSP &bp_sp, llvm::StringRef name,
935 Status &error);
936
938
939 BreakpointName *FindBreakpointName(ConstString name, bool can_create,
940 Status &error);
941
943
945 const BreakpointOptions &options,
946 const BreakpointName::Permissions &permissions);
948
949 void AddBreakpointName(std::unique_ptr<BreakpointName> bp_name);
950
951 void GetBreakpointNames(std::vector<std::string> &names);
952
953 // This call removes ALL breakpoints regardless of permission.
954 void RemoveAllBreakpoints(bool internal_also = false);
955
956 // This removes all the breakpoints, but obeys the ePermDelete on them.
958
959 void DisableAllBreakpoints(bool internal_also = false);
960
962
963 void EnableAllBreakpoints(bool internal_also = false);
964
966
968
970
972
973 /// Resets the hit count of all breakpoints.
975
976 // The flag 'end_to_end', default to true, signifies that the operation is
977 // performed end to end, for both the debugger and the debuggee.
978
979 bool RemoveAllWatchpoints(bool end_to_end = true);
980
981 bool DisableAllWatchpoints(bool end_to_end = true);
982
983 bool EnableAllWatchpoints(bool end_to_end = true);
984
986
988
989 bool IgnoreAllWatchpoints(uint32_t ignore_count);
990
992
994
996
997 bool IgnoreWatchpointByID(lldb::watch_id_t watch_id, uint32_t ignore_count);
998
1000 const BreakpointIDList &bp_ids,
1001 bool append);
1002
1004 BreakpointIDList &new_bps);
1005
1007 std::vector<std::string> &names,
1008 BreakpointIDList &new_bps);
1009
1010 /// Get \a load_addr as a callable code load address for this target
1011 ///
1012 /// Take \a load_addr and potentially add any address bits that are
1013 /// needed to make the address callable. For ARM this can set bit
1014 /// zero (if it already isn't) if \a load_addr is a thumb function.
1015 /// If \a addr_class is set to AddressClass::eInvalid, then the address
1016 /// adjustment will always happen. If it is set to an address class
1017 /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
1018 /// returned.
1020 lldb::addr_t load_addr,
1021 AddressClass addr_class = AddressClass::eInvalid) const;
1022
1023 /// Get \a load_addr as an opcode for this target.
1024 ///
1025 /// Take \a load_addr and potentially strip any address bits that are
1026 /// needed to make the address point to an opcode. For ARM this can
1027 /// clear bit zero (if it already isn't) if \a load_addr is a
1028 /// thumb function and load_addr is in code.
1029 /// If \a addr_class is set to AddressClass::eInvalid, then the address
1030 /// adjustment will always happen. If it is set to an address class
1031 /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
1032 /// returned.
1035 AddressClass addr_class = AddressClass::eInvalid) const;
1036
1037 // Get load_addr as breakable load address for this target. Take a addr and
1038 // check if for any reason there is a better address than this to put a
1039 // breakpoint on. If there is then return that address. For MIPS, if
1040 // instruction at addr is a delay slot instruction then this method will find
1041 // the address of its previous instruction and return that address.
1043
1044 /// This call may preload module symbols, and may do so in parallel depending
1045 /// on the following target settings:
1046 /// - TargetProperties::GetPreloadSymbols()
1047 /// - TargetProperties::GetParallelModuleLoad()
1048 ///
1049 /// Warning: if preloading is active and this is called in parallel with
1050 /// Target::GetOrCreateModule, this may result in a ABBA deadlock situation.
1051 void ModulesDidLoad(ModuleList &module_list);
1052
1053 void ModulesDidUnload(ModuleList &module_list, bool delete_locations);
1054
1055 void SymbolsDidLoad(ModuleList &module_list);
1056
1057 void ClearModules(bool delete_locations);
1058
1059 /// Called as the last function in Process::DidExec().
1060 ///
1061 /// Process::DidExec() will clear a lot of state in the process,
1062 /// then try to reload a dynamic loader plugin to discover what
1063 /// binaries are currently available and then this function should
1064 /// be called to allow the target to do any cleanup after everything
1065 /// has been figured out. It can remove breakpoints that no longer
1066 /// make sense as the exec might have changed the target
1067 /// architecture, and unloaded some modules that might get deleted.
1068 void DidExec();
1069
1070 /// Gets the module for the main executable.
1071 ///
1072 /// Each process has a notion of a main executable that is the file
1073 /// that will be executed or attached to. Executable files can have
1074 /// dependent modules that are discovered from the object files, or
1075 /// discovered at runtime as things are dynamically loaded.
1076 ///
1077 /// \return
1078 /// The shared pointer to the executable module which can
1079 /// contains a nullptr Module object if no executable has been
1080 /// set.
1081 ///
1082 /// \see DynamicLoader
1083 /// \see ObjectFile::GetDependentModules (FileSpecList&)
1084 /// \see Process::SetExecutableModule(lldb::ModuleSP&)
1086
1088
1089 /// Set the main executable module.
1090 ///
1091 /// Each process has a notion of a main executable that is the file
1092 /// that will be executed or attached to. Executable files can have
1093 /// dependent modules that are discovered from the object files, or
1094 /// discovered at runtime as things are dynamically loaded.
1095 ///
1096 /// Setting the executable causes any of the current dependent
1097 /// image information to be cleared and replaced with the static
1098 /// dependent image information found by calling
1099 /// ObjectFile::GetDependentModules (FileSpecList&) on the main
1100 /// executable and any modules on which it depends. Calling
1101 /// Process::GetImages() will return the newly found images that
1102 /// were obtained from all of the object files.
1103 ///
1104 /// \param[in] module_sp
1105 /// A shared pointer reference to the module that will become
1106 /// the main executable for this process.
1107 ///
1108 /// \param[in] load_dependent_files
1109 /// If \b true then ask the object files to track down any
1110 /// known dependent files.
1111 ///
1112 /// \see ObjectFile::GetDependentModules (FileSpecList&)
1113 /// \see Process::GetImages()
1115 lldb::ModuleSP &module_sp,
1116 LoadDependentFiles load_dependent_files = eLoadDependentsDefault);
1117
1118 bool LoadScriptingResources(std::list<Status> &errors,
1119 bool continue_on_error = true) {
1120 return m_images.LoadScriptingResourcesInTarget(this, errors,
1121 continue_on_error);
1122 }
1123
1124 /// Get accessor for the images for this process.
1125 ///
1126 /// Each process has a notion of a main executable that is the file
1127 /// that will be executed or attached to. Executable files can have
1128 /// dependent modules that are discovered from the object files, or
1129 /// discovered at runtime as things are dynamically loaded. After
1130 /// a main executable has been set, the images will contain a list
1131 /// of all the files that the executable depends upon as far as the
1132 /// object files know. These images will usually contain valid file
1133 /// virtual addresses only. When the process is launched or attached
1134 /// to, the DynamicLoader plug-in will discover where these images
1135 /// were loaded in memory and will resolve the load virtual
1136 /// addresses is each image, and also in images that are loaded by
1137 /// code.
1138 ///
1139 /// \return
1140 /// A list of Module objects in a module list.
1141 const ModuleList &GetImages() const { return m_images; }
1142
1144
1145 /// Return whether this FileSpec corresponds to a module that should be
1146 /// considered for general searches.
1147 ///
1148 /// This API will be consulted by the SearchFilterForUnconstrainedSearches
1149 /// and any module that returns \b true will not be searched. Note the
1150 /// SearchFilterForUnconstrainedSearches is the search filter that
1151 /// gets used in the CreateBreakpoint calls when no modules is provided.
1152 ///
1153 /// The target call at present just consults the Platform's call of the
1154 /// same name.
1155 ///
1156 /// \param[in] module_spec
1157 /// Path to the module.
1158 ///
1159 /// \return \b true if the module should be excluded, \b false otherwise.
1160 bool ModuleIsExcludedForUnconstrainedSearches(const FileSpec &module_spec);
1161
1162 /// Return whether this module should be considered for general searches.
1163 ///
1164 /// This API will be consulted by the SearchFilterForUnconstrainedSearches
1165 /// and any module that returns \b true will not be searched. Note the
1166 /// SearchFilterForUnconstrainedSearches is the search filter that
1167 /// gets used in the CreateBreakpoint calls when no modules is provided.
1168 ///
1169 /// The target call at present just consults the Platform's call of the
1170 /// same name.
1171 ///
1172 /// FIXME: When we get time we should add a way for the user to set modules
1173 /// that they
1174 /// don't want searched, in addition to or instead of the platform ones.
1175 ///
1176 /// \param[in] module_sp
1177 /// A shared pointer reference to the module that checked.
1178 ///
1179 /// \return \b true if the module should be excluded, \b false otherwise.
1180 bool
1182
1183 const ArchSpec &GetArchitecture() const { return m_arch.GetSpec(); }
1184
1185 /// Returns the name of the target's ABI plugin.
1186 llvm::StringRef GetABIName() const;
1187
1188 /// Set the architecture for this target.
1189 ///
1190 /// If the current target has no Images read in, then this just sets the
1191 /// architecture, which will be used to select the architecture of the
1192 /// ExecutableModule when that is set. If the current target has an
1193 /// ExecutableModule, then calling SetArchitecture with a different
1194 /// architecture from the currently selected one will reset the
1195 /// ExecutableModule to that slice of the file backing the ExecutableModule.
1196 /// If the file backing the ExecutableModule does not contain a fork of this
1197 /// architecture, then this code will return false, and the architecture
1198 /// won't be changed. If the input arch_spec is the same as the already set
1199 /// architecture, this is a no-op.
1200 ///
1201 /// \param[in] arch_spec
1202 /// The new architecture.
1203 ///
1204 /// \param[in] set_platform
1205 /// If \b true, then the platform will be adjusted if the currently
1206 /// selected platform is not compatible with the architecture being set.
1207 /// If \b false, then just the architecture will be set even if the
1208 /// currently selected platform isn't compatible (in case it might be
1209 /// manually set following this function call).
1210 ///
1211 /// \param[in] merged
1212 /// If true, arch_spec is merged with the current
1213 /// architecture. Otherwise it's replaced.
1214 ///
1215 /// \return
1216 /// \b true if the architecture was successfully set, \b false otherwise.
1217 bool SetArchitecture(const ArchSpec &arch_spec, bool set_platform = false,
1218 bool merge = true);
1219
1220 bool MergeArchitecture(const ArchSpec &arch_spec);
1221
1222 Architecture *GetArchitecturePlugin() const { return m_arch.GetPlugin(); }
1223
1224 Debugger &GetDebugger() const { return m_debugger; }
1225
1226 size_t ReadMemoryFromFileCache(const Address &addr, void *dst, size_t dst_len,
1227 Status &error);
1228
1229 // Reading memory through the target allows us to skip going to the process
1230 // for reading memory if possible and it allows us to try and read from any
1231 // constant sections in our object files on disk. If you always want live
1232 // program memory, read straight from the process. If you possibly want to
1233 // read from const sections in object files, read from the target. This
1234 // version of ReadMemory will try and read memory from the process if the
1235 // process is alive. The order is:
1236 // 1 - if (force_live_memory == false) and the address falls in a read-only
1237 // section, then read from the file cache
1238 // 2 - if there is a process, then read from memory
1239 // 3 - if there is no process, then read from the file cache
1240 //
1241 // If did_read_live_memory is provided, will indicate if the read was from
1242 // live memory, or from file contents. A caller which needs to treat these two
1243 // sources differently should use this argument to disambiguate where the data
1244 // was read from.
1245 //
1246 // The method is virtual for mocking in the unit tests.
1247 virtual size_t ReadMemory(const Address &addr, void *dst, size_t dst_len,
1248 Status &error, bool force_live_memory = false,
1249 lldb::addr_t *load_addr_ptr = nullptr,
1250 bool *did_read_live_memory = nullptr);
1251
1252 size_t ReadCStringFromMemory(const Address &addr, std::string &out_str,
1253 Status &error, bool force_live_memory = false);
1254
1255 size_t ReadCStringFromMemory(const Address &addr, char *dst,
1256 size_t dst_max_len, Status &result_error,
1257 bool force_live_memory = false);
1258
1259 /// Read a NULL terminated string from memory
1260 ///
1261 /// This function will read a cache page at a time until a NULL string
1262 /// terminator is found. It will stop reading if an aligned sequence of NULL
1263 /// termination \a type_width bytes is not found before reading \a
1264 /// cstr_max_len bytes. The results are always guaranteed to be NULL
1265 /// terminated, and that no more than (max_bytes - type_width) bytes will be
1266 /// read.
1267 ///
1268 /// \param[in] addr
1269 /// The address to start the memory read.
1270 ///
1271 /// \param[in] dst
1272 /// A character buffer containing at least max_bytes.
1273 ///
1274 /// \param[in] max_bytes
1275 /// The maximum number of bytes to read.
1276 ///
1277 /// \param[in] error
1278 /// The error status of the read operation.
1279 ///
1280 /// \param[in] type_width
1281 /// The size of the null terminator (1 to 4 bytes per
1282 /// character). Defaults to 1.
1283 ///
1284 /// \return
1285 /// The error status or the number of bytes prior to the null terminator.
1286 size_t ReadStringFromMemory(const Address &addr, char *dst, size_t max_bytes,
1287 Status &error, size_t type_width,
1288 bool force_live_memory = true);
1289
1290 size_t ReadScalarIntegerFromMemory(const Address &addr, uint32_t byte_size,
1291 bool is_signed, Scalar &scalar,
1292 Status &error,
1293 bool force_live_memory = false);
1294
1295 int64_t ReadSignedIntegerFromMemory(const Address &addr,
1296 size_t integer_byte_size,
1297 int64_t fail_value, Status &error,
1298 bool force_live_memory = false);
1299
1300 uint64_t ReadUnsignedIntegerFromMemory(const Address &addr,
1301 size_t integer_byte_size,
1302 uint64_t fail_value, Status &error,
1303 bool force_live_memory = false);
1304
1305 bool ReadPointerFromMemory(const Address &addr, Status &error,
1306 Address &pointer_addr,
1307 bool force_live_memory = false);
1308
1309 bool HasLoadedSections();
1310
1312
1313 void ClearSectionLoadList();
1314
1315 void DumpSectionLoadList(Stream &s);
1316
1317 static Target *GetTargetFromContexts(const ExecutionContext *exe_ctx_ptr,
1318 const SymbolContext *sc_ptr);
1319
1320 // lldb::ExecutionContextScope pure virtual functions
1322
1324
1326
1328
1329 void CalculateExecutionContext(ExecutionContext &exe_ctx) override;
1330
1332
1333 llvm::Expected<lldb::TypeSystemSP>
1335 bool create_on_demand = true);
1336
1337 std::vector<lldb::TypeSystemSP>
1338 GetScratchTypeSystems(bool create_on_demand = true);
1339
1342
1343 // Creates a UserExpression for the given language, the rest of the
1344 // parameters have the same meaning as for the UserExpression constructor.
1345 // Returns a new-ed object which the caller owns.
1346
1348 GetUserExpressionForLanguage(llvm::StringRef expr, llvm::StringRef prefix,
1349 SourceLanguage language,
1350 Expression::ResultType desired_type,
1351 const EvaluateExpressionOptions &options,
1352 ValueObject *ctx_obj, Status &error);
1353
1354 // Creates a FunctionCaller for the given language, the rest of the
1355 // parameters have the same meaning as for the FunctionCaller constructor.
1356 // Since a FunctionCaller can't be
1357 // IR Interpreted, it makes no sense to call this with an
1358 // ExecutionContextScope that lacks
1359 // a Process.
1360 // Returns a new-ed object which the caller owns.
1361
1363 const CompilerType &return_type,
1364 const Address &function_address,
1365 const ValueList &arg_value_list,
1366 const char *name, Status &error);
1367
1368 /// Creates and installs a UtilityFunction for the given language.
1369 llvm::Expected<std::unique_ptr<UtilityFunction>>
1370 CreateUtilityFunction(std::string expression, std::string name,
1371 lldb::LanguageType language, ExecutionContext &exe_ctx);
1372
1373 // Install any files through the platform that need be to installed prior to
1374 // launching or attaching.
1375 Status Install(ProcessLaunchInfo *launch_info);
1376
1377 bool ResolveFileAddress(lldb::addr_t load_addr, Address &so_addr);
1378
1379 bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr,
1380 uint32_t stop_id = SectionLoadHistory::eStopIDNow,
1381 bool allow_section_end = false);
1382
1383 bool SetSectionLoadAddress(const lldb::SectionSP &section,
1384 lldb::addr_t load_addr,
1385 bool warn_multiple = false);
1386
1387 size_t UnloadModuleSections(const lldb::ModuleSP &module_sp);
1388
1389 size_t UnloadModuleSections(const ModuleList &module_list);
1390
1391 bool SetSectionUnloaded(const lldb::SectionSP &section_sp);
1392
1393 bool SetSectionUnloaded(const lldb::SectionSP &section_sp,
1394 lldb::addr_t load_addr);
1395
1397
1399 lldb_private::TypeSummaryImpl &summary_provider);
1401
1402 /// Set the \a Trace object containing processor trace information of this
1403 /// target.
1404 ///
1405 /// \param[in] trace_sp
1406 /// The trace object.
1407 void SetTrace(const lldb::TraceSP &trace_sp);
1408
1409 /// Get the \a Trace object containing processor trace information of this
1410 /// target.
1411 ///
1412 /// \return
1413 /// The trace object. It might be undefined.
1415
1416 /// Create a \a Trace object for the current target using the using the
1417 /// default supported tracing technology for this process.
1418 ///
1419 /// \return
1420 /// The new \a Trace or an \a llvm::Error if a \a Trace already exists or
1421 /// the trace couldn't be created.
1422 llvm::Expected<lldb::TraceSP> CreateTrace();
1423
1424 /// If a \a Trace object is present, this returns it, otherwise a new Trace is
1425 /// created with \a Trace::CreateTrace.
1426 llvm::Expected<lldb::TraceSP> GetTraceOrCreate();
1427
1428 // Since expressions results can persist beyond the lifetime of a process,
1429 // and the const expression results are available after a process is gone, we
1430 // provide a way for expressions to be evaluated from the Target itself. If
1431 // an expression is going to be run, then it should have a frame filled in in
1432 // the execution context.
1434 llvm::StringRef expression, ExecutionContextScope *exe_scope,
1435 lldb::ValueObjectSP &result_valobj_sp,
1437 std::string *fixed_expression = nullptr, ValueObject *ctx_obj = nullptr);
1438
1440
1442
1443 /// This method will return the address of the starting function for
1444 /// this binary, e.g. main() or its equivalent. This can be used as
1445 /// an address of a function that is not called once a binary has
1446 /// started running - e.g. as a return address for inferior function
1447 /// calls that are unambiguous completion of the function call, not
1448 /// called during the course of the inferior function code running.
1449 ///
1450 /// If no entry point can be found, an invalid address is returned.
1451 ///
1452 /// \param [out] err
1453 /// This object will be set to failure if no entry address could
1454 /// be found, and may contain a helpful error message.
1455 //
1456 /// \return
1457 /// Returns the entry address for this program, or an error
1458 /// if none can be found.
1459 llvm::Expected<lldb_private::Address> GetEntryPointAddress();
1460
1461 CompilerType GetRegisterType(const std::string &name,
1462 const lldb_private::RegisterFlags &flags,
1463 uint32_t byte_size);
1464
1465 /// Sends a breakpoint notification event.
1467 lldb::BreakpointEventType event_kind);
1468 /// Sends a breakpoint notification event.
1470 const lldb::EventDataSP &breakpoint_data_sp);
1471
1472 llvm::Expected<lldb::DisassemblerSP>
1473 ReadInstructions(const Address &start_addr, uint32_t count,
1474 const char *flavor_string = nullptr);
1475
1476 // Target Stop Hooks
1477 class StopHook : public UserID {
1478 public:
1479 StopHook(const StopHook &rhs);
1480 virtual ~StopHook() = default;
1481
1482 enum class StopHookKind : uint32_t {
1486 };
1493
1495
1496 // Set the specifier. The stop hook will own the specifier, and is
1497 // responsible for deleting it when we're done.
1498 void SetSpecifier(SymbolContextSpecifier *specifier);
1499
1501
1502 bool ExecutionContextPasses(const ExecutionContext &exe_ctx);
1503
1504 // Called on stop, this gets passed the ExecutionContext for each "stop
1505 // with a reason" thread. It should add to the stream whatever text it
1506 // wants to show the user, and return False to indicate it wants the target
1507 // not to stop.
1509 lldb::StreamSP output) = 0;
1510
1511 // Set the Thread Specifier. The stop hook will own the thread specifier,
1512 // and is responsible for deleting it when we're done.
1513 void SetThreadSpecifier(ThreadSpec *specifier);
1514
1516
1517 bool IsActive() { return m_active; }
1518
1519 void SetIsActive(bool is_active) { m_active = is_active; }
1520
1521 void SetAutoContinue(bool auto_continue) {
1522 m_auto_continue = auto_continue;
1523 }
1524
1525 bool GetAutoContinue() const { return m_auto_continue; }
1526
1527 void SetRunAtInitialStop(bool at_initial_stop) {
1528 m_at_initial_stop = at_initial_stop;
1529 }
1530
1532
1533 void SetSuppressOutput(bool suppress_output) {
1534 m_suppress_output = suppress_output;
1535 }
1536
1537 bool GetSuppressOutput() const { return m_suppress_output; }
1538
1539 void GetDescription(Stream &s, lldb::DescriptionLevel level) const;
1541 lldb::DescriptionLevel level) const = 0;
1542
1543 protected:
1546 std::unique_ptr<ThreadSpec> m_thread_spec_up;
1547 bool m_active = true;
1548 bool m_auto_continue = false;
1550 bool m_suppress_output = false;
1551
1552 StopHook(lldb::TargetSP target_sp, lldb::user_id_t uid);
1553 };
1554
1556 public:
1557 ~StopHookCommandLine() override = default;
1558
1560 void SetActionFromString(const std::string &strings);
1561 void SetActionFromStrings(const std::vector<std::string> &strings);
1562
1564 lldb::StreamSP output_sp) override;
1566 lldb::DescriptionLevel level) const override;
1567
1568 private:
1570 // Use CreateStopHook to make a new empty stop hook. Use SetActionFromString
1571 // to fill it with commands, and SetSpecifier to set the specifier shared
1572 // pointer (can be null, that will match anything.)
1574 : StopHook(target_sp, uid) {}
1575 friend class Target;
1576 };
1577
1579 public:
1580 ~StopHookScripted() override = default;
1582 lldb::StreamSP output) override;
1583
1584 Status SetScriptCallback(std::string class_name,
1585 StructuredData::ObjectSP extra_args_sp);
1586
1588 lldb::DescriptionLevel level) const override;
1589
1590 private:
1591 std::string m_class_name;
1592 /// This holds the dictionary of keys & values that can be used to
1593 /// parametrize any given callback's behavior.
1596
1597 /// Use CreateStopHook to make a new empty stop hook. Use SetScriptCallback
1598 /// to set the script to execute, and SetSpecifier to set the specifier
1599 /// shared pointer (can be null, that will match anything.)
1601 : StopHook(target_sp, uid) {}
1602 friend class Target;
1603 };
1604
1605 class StopHookCoded : public StopHook {
1606 public:
1607 ~StopHookCoded() override = default;
1608
1610 lldb::StreamSP output);
1611
1612 void SetCallback(llvm::StringRef name, HandleStopCallback *callback) {
1613 m_name = name;
1614 m_callback = callback;
1615 }
1616
1618 lldb::StreamSP output) override {
1619 return m_callback(exc_ctx, output);
1620 }
1621
1623 lldb::DescriptionLevel level) const override {
1624 s.Indent();
1625 s.Printf("%s (built-in)\n", m_name.c_str());
1626 }
1627
1628 private:
1629 std::string m_name;
1631
1632 /// Use CreateStopHook to make a new empty stop hook. Use SetCallback to set
1633 /// the callback to execute, and SetSpecifier to set the specifier shared
1634 /// pointer (can be null, that will match anything.)
1636 : StopHook(target_sp, uid) {}
1637 friend class Target;
1638 };
1639
1641
1642 typedef std::shared_ptr<StopHook> StopHookSP;
1643
1644 /// Add an empty stop hook to the Target's stop hook list, and returns a
1645 /// shared pointer to the new hook.
1646 StopHookSP CreateStopHook(StopHook::StopHookKind kind, bool internal = false);
1647
1648 /// If you tried to create a stop hook, and that failed, call this to
1649 /// remove the stop hook, as it will also reset the stop hook counter.
1651
1652 // Runs the stop hooks that have been registered for this target.
1653 // Returns true if the stop hooks cause the target to resume.
1654 // Pass at_initial_stop if this is the stop where lldb gains
1655 // control over the process for the first time.
1656 bool RunStopHooks(bool at_initial_stop = false);
1657
1658 bool SetSuppresStopHooks(bool suppress) {
1659 bool old_value = m_suppress_stop_hooks;
1660 m_suppress_stop_hooks = suppress;
1661 return old_value;
1662 }
1663
1665
1667
1668 void RemoveAllStopHooks();
1669
1670 StopHookSP GetStopHookByID(lldb::user_id_t uid);
1671
1672 bool SetStopHookActiveStateByID(lldb::user_id_t uid, bool active_state);
1673
1674 void SetAllStopHooksActiveState(bool active_state);
1675
1676 const std::vector<StopHookSP> GetStopHooks(bool internal = false) const;
1677
1679
1680 void SetPlatform(const lldb::PlatformSP &platform_sp) {
1681 m_platform_sp = platform_sp;
1682 }
1683
1685
1686 // Methods.
1688 GetSearchFilterForModule(const FileSpec *containingModule);
1689
1691 GetSearchFilterForModuleList(const FileSpecList *containingModuleList);
1692
1694 GetSearchFilterForModuleAndCUList(const FileSpecList *containingModules,
1695 const FileSpecList *containingSourceFiles);
1696
1698 const char *repl_options, bool can_create);
1699
1700 void SetREPL(lldb::LanguageType language, lldb::REPLSP repl_sp);
1701
1705
1707
1708 /// Add a signal for the target. This will get copied over to the process
1709 /// if the signal exists on that target. Only the values with Yes and No are
1710 /// set, Calculate values will be ignored.
1711protected:
1720 using DummySignalElement = llvm::StringMapEntry<DummySignalValues>;
1721 static bool UpdateSignalFromDummy(lldb::UnixSignalsSP signals_sp,
1722 const DummySignalElement &element);
1723 static bool ResetSignalFromDummy(lldb::UnixSignalsSP signals_sp,
1724 const DummySignalElement &element);
1725
1726public:
1727 /// Add a signal to the Target's list of stored signals/actions. These
1728 /// values will get copied into any processes launched from
1729 /// this target.
1730 void AddDummySignal(llvm::StringRef name, LazyBool pass, LazyBool print,
1731 LazyBool stop);
1732 /// Updates the signals in signals_sp using the stored dummy signals.
1733 /// If warning_stream_sp is not null, if any stored signals are not found in
1734 /// the current process, a warning will be emitted here.
1736 lldb::StreamSP warning_stream_sp);
1737 /// Clear the dummy signals in signal_names from the target, or all signals
1738 /// if signal_names is empty. Also remove the behaviors they set from the
1739 /// process's signals if it exists.
1740 void ClearDummySignals(Args &signal_names);
1741 /// Print all the signals set in this target.
1742 void PrintDummySignals(Stream &strm, Args &signals);
1743
1744protected:
1745 /// Implementing of ModuleList::Notifier.
1746
1747 void NotifyModuleAdded(const ModuleList &module_list,
1748 const lldb::ModuleSP &module_sp) override;
1749
1750 void NotifyModuleRemoved(const ModuleList &module_list,
1751 const lldb::ModuleSP &module_sp) override;
1752
1753 void NotifyModuleUpdated(const ModuleList &module_list,
1754 const lldb::ModuleSP &old_module_sp,
1755 const lldb::ModuleSP &new_module_sp) override;
1756
1757 void NotifyWillClearList(const ModuleList &module_list) override;
1758
1759 void NotifyModulesRemoved(lldb_private::ModuleList &module_list) override;
1760
1761 class Arch {
1762 public:
1763 explicit Arch(const ArchSpec &spec);
1764 const Arch &operator=(const ArchSpec &spec);
1765
1766 const ArchSpec &GetSpec() const { return m_spec; }
1767 Architecture *GetPlugin() const { return m_plugin_up.get(); }
1768
1769 private:
1771 std::unique_ptr<Architecture> m_plugin_up;
1772 };
1773
1774 // Member variables.
1776 lldb::PlatformSP m_platform_sp; ///< The platform for this target.
1777 std::recursive_mutex m_mutex; ///< An API mutex that is used by the lldb::SB*
1778 /// classes make the SB interface thread safe
1779 /// When the private state thread calls SB API's - usually because it is
1780 /// running OS plugin or Python ThreadPlan code - it should not block on the
1781 /// API mutex that is held by the code that kicked off the sequence of events
1782 /// that led us to run the code. We hand out this mutex instead when we
1783 /// detect that code is running on the private state thread.
1784 std::recursive_mutex m_private_mutex;
1786 std::string m_label;
1787 ModuleList m_images; ///< The list of images for this process (shared
1788 /// libraries and anything dynamically loaded).
1794 std::map<ConstString, std::unique_ptr<BreakpointName>>;
1796
1800 // We want to tightly control the process destruction process so we can
1801 // correctly tear down everything that we need to, so the only class that
1802 // knows about the process lifespan is this target class.
1807
1808 /// Map of scripted frame provider descriptors for this target.
1809 /// Keys are the provider descriptors ids, values are the descriptors.
1810 /// Used to initialize frame providers for new threads.
1811 llvm::DenseMap<uint32_t, ScriptedFrameProviderDescriptor>
1813 mutable std::recursive_mutex m_frame_provider_descriptors_mutex;
1814
1815 typedef std::map<lldb::LanguageType, lldb::REPLSP> REPLMap;
1817
1819
1820 typedef std::map<lldb::user_id_t, StopHookSP> StopHookCollection;
1823 std::vector<StopHookSP> m_internal_stop_hooks;
1824 uint32_t m_latest_stop_hook_id; /// This records the last natural stop at
1825 /// which we ran a stop-hook.
1827 bool m_suppress_stop_hooks; /// Used to not run stop hooks for expressions
1831 LLDB_INVALID_GLOBALLY_UNIQUE_TARGET_ID; ///< The globally unique ID
1832 /// assigned to this target
1833 std::string m_target_session_name; ///< The target session name for this
1834 /// target, used to name debugging
1835 /// sessions in DAP.
1836 /// An optional \a lldb_private::Trace object containing processor trace
1837 /// information of this target.
1839 /// Stores the frame recognizers of this target.
1841 /// These are used to set the signal state when you don't have a process and
1842 /// more usefully in the Dummy target where you can't know exactly what
1843 /// signals you will have.
1844 llvm::StringMap<DummySignalValues> m_dummy_signals;
1845
1847
1848 static void ImageSearchPathsChanged(const PathMappingList &path_list,
1849 void *baton);
1850
1851 // Utilities for `statistics` command.
1852private:
1853 // Target metrics storage.
1855
1856public:
1857 /// Get metrics associated with this target in JSON format.
1858 ///
1859 /// Target metrics help measure timings and information that is contained in
1860 /// a target. These are designed to help measure performance of a debug
1861 /// session as well as represent the current state of the target, like
1862 /// information on the currently modules, currently set breakpoints and more.
1863 ///
1864 /// \return
1865 /// Returns a JSON value that contains all target metrics.
1866 llvm::json::Value
1868
1869 void ResetStatistics();
1870
1872
1873protected:
1874 /// Construct with optional file and arch.
1875 ///
1876 /// This member is private. Clients must use
1877 /// TargetList::CreateTarget(const FileSpec*, const ArchSpec*)
1878 /// so all targets can be tracked from the central target list.
1879 ///
1880 /// \see TargetList::CreateTarget(const FileSpec*, const ArchSpec*)
1881 Target(Debugger &debugger, const ArchSpec &target_arch,
1882 const lldb::PlatformSP &platform_sp, bool is_dummy_target);
1883
1884 // Helper function.
1885 bool ProcessIsValid();
1886
1887 // Copy breakpoints, stop hooks and so forth from the dummy target:
1888 void PrimeFromDummyTarget(Target &target);
1889
1890 void AddBreakpoint(lldb::BreakpointSP breakpoint_sp, bool internal);
1891
1893
1894 /// Return a recommended size for memory reads at \a addr, optimizing for
1895 /// cache usage.
1897
1898 Target(const Target &) = delete;
1899 const Target &operator=(const Target &) = delete;
1900
1902 return m_section_load_history.GetCurrentSectionLoadList();
1903 }
1904};
1905
1906} // namespace lldb_private
1907
1908#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:81
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:342
void SetOneThreadTimeout(const Timeout< std::micro > &timeout)
Definition Target.h:401
void SetUnwindOnError(bool unwind=false)
Definition Target.h:374
SourceLanguage GetLanguage() const
Definition Target.h:336
const char * GetPoundLineFilePath() const
Definition Target.h:460
lldb::DynamicValueType m_use_dynamic
Definition Target.h:527
void SetExecutionPolicy(ExecutionPolicy policy=eExecutionPolicyAlways)
Definition Target.h:332
Timeout< std::micro > m_one_thread_timeout
Definition Target.h:529
bool InvokeCancelCallback(lldb::ExpressionEvaluationPhase phase) const
Definition Target.h:442
lldb::DynamicValueType GetUseDynamic() const
Definition Target.h:386
void SetKeepInMemory(bool keep=true)
Definition Target.h:384
void SetCoerceToId(bool coerce=true)
Definition Target.h:370
void SetLanguage(lldb::LanguageType language_type)
Definition Target.h:338
ExecutionPolicy GetExecutionPolicy() const
Definition Target.h:330
Timeout< std::micro > m_timeout
Definition Target.h:528
void SetCppIgnoreContextQualifiers(bool value)
Definition Target.cpp:5447
const StructuredData::Dictionary & GetLanguageOptions() const
Definition Target.cpp:5425
llvm::Expected< bool > GetBooleanLanguageOption(llvm::StringRef option_name) const
Get the language-plugin specific boolean option called option_name.
Definition Target.cpp:5409
void SetPrefix(const char *prefix)
Definition Target.h:363
void SetTryAllThreads(bool try_others=true)
Definition Target.h:407
static constexpr std::chrono::milliseconds default_timeout
Definition Target.h:322
void SetPoundLine(const char *path, uint32_t line) const
Definition Target.h:450
void SetRetriesWithFixIts(uint64_t number_of_retries)
Definition Target.h:476
SymbolContextList m_preferred_lookup_contexts
During expression evaluation, any SymbolContext in this list will be used for symbol/function lookup ...
Definition Target.h:545
void SetTimeout(const Timeout< std::micro > &timeout)
Definition Target.h:395
static constexpr ExecutionPolicy default_execution_policy
Definition Target.h:327
void SetStopOthers(bool stop_others=true)
Definition Target.h:411
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:525
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:5392
StructuredData::DictionarySP m_language_options_sp
Dictionary mapping names of language-plugin specific options to values.
Definition Target.h:540
void SetCancelCallback(lldb::ExpressionCancelCallback callback, void *baton)
Definition Target.h:437
const Timeout< std::micro > & GetTimeout() const
Definition Target.h:393
const SymbolContextList & GetPreferredSymbolContexts() const
Definition Target.h:346
void SetIgnoreBreakpoints(bool ignore=false)
Definition Target.h:378
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:353
void SetUseDynamic(lldb::DynamicValueType dynamic=lldb::eDynamicCanRunTarget)
Definition Target.h:389
lldb::ExpressionCancelCallback m_cancel_callback
Definition Target.h:530
const Timeout< std::micro > & GetOneThreadTimeout() const
Definition Target.h:397
"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:57
Encapsulates a function that can be called.
A collection class for Module objects.
Definition ModuleList.h:125
A class that describes an executable image and its associated object and symbol files.
Definition Module.h:90
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:155
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition Stream.cpp:132
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:284
Defines a list of symbol context objects.
Defines a symbol context baton that can be handed other debug core functions.
uint32_t GetMaximumSizeOfStringSummary() const
Definition Target.cpp:4992
FileSpecList GetDebugFileSearchPaths()
Definition Target.cpp:4873
llvm::StringRef GetLaunchWorkingDirectory() const
Definition Target.cpp:4679
bool GetDisplayRecognizedArguments() const
Definition Target.cpp:5150
ImportStdModule GetImportStdModule() const
Definition Target.cpp:4889
void AppendExecutableSearchPaths(const FileSpec &)
Definition Target.cpp:4860
bool GetEnableSyntheticValue() const
Definition Target.cpp:4959
void SetStandardInputPath(const char *path)=delete
ProcessLaunchInfo m_launch_info
Definition Target.h:305
uint64_t GetExprAllocAlign() const
Definition Target.cpp:5071
MemoryModuleLoadLevel GetMemoryModuleLoadLevel() const
Definition Target.cpp:5122
llvm::StringRef GetArg0() const
Definition Target.cpp:4732
uint32_t GetMaximumMemReadSize() const
Definition Target.cpp:4998
void SetRunArguments(const Args &args)
Definition Target.cpp:4749
FileSpec GetStandardErrorPath() const
Definition Target.cpp:5024
bool GetEnableNotifyAboutFixIts() const
Definition Target.cpp:4915
bool SetPreferDynamicValue(lldb::DynamicValueType d)
Definition Target.cpp:4616
void SetDisplayRecognizedArguments(bool b)
Definition Target.cpp:5156
std::optional< bool > GetExperimentalPropertyValue(size_t prop_idx, ExecutionContext *exe_ctx=nullptr) const
Definition Target.cpp:4555
const ProcessLaunchInfo & GetProcessLaunchInfo() const
Definition Target.cpp:5161
Environment ComputeEnvironment() const
Definition Target.cpp:4755
void SetStandardOutputPath(const char *path)=delete
bool GetUserSpecifiedTrapHandlerNames(Args &args) const
Definition Target.cpp:5129
uint64_t GetExprErrorLimit() const
Definition Target.cpp:5053
bool GetEnableAutoImportClangModules() const
Definition Target.cpp:4883
bool GetDebugUtilityExpression() const
Definition Target.cpp:5267
DynamicClassInfoHelper GetDynamicClassInfoHelper() const
Definition Target.cpp:4896
FileSpec GetStandardOutputPath() const
Definition Target.cpp:5014
void SetDisplayRuntimeSupportValues(bool b)
Definition Target.cpp:5145
uint32_t GetMaximumNumberOfChildrenToDisplay() const
Definition Target.cpp:4977
void SetRequireHardwareBreakpoints(bool b)
Definition Target.cpp:5199
bool GetAutoInstallMainExecutable() const
Definition Target.cpp:5204
const char * GetDisassemblyFeatures() const
Definition Target.cpp:4711
RealpathPrefixes GetSourceRealpathPrefixes() const
Definition Target.cpp:4727
uint64_t GetNumberOfRetriesWithFixits() const
Definition Target.cpp:4909
uint64_t GetExprAllocSize() const
Definition Target.cpp:5065
llvm::StringRef GetExpressionPrefixContents()
Definition Target.cpp:5039
PathMappingList & GetObjectPathMap() const
Definition Target.cpp:4846
const char * GetDisassemblyFlavor() const
Definition Target.cpp:4691
FileSpec GetStandardInputPath() const
Definition Target.cpp:5004
lldb::DynamicValueType GetPreferDynamicValue() const
Definition Target.cpp:4609
InlineStrategy GetInlineStrategy() const
Definition Target.cpp:4718
Environment GetTargetEnvironment() const
Definition Target.cpp:4815
bool GetDisplayRuntimeSupportValues() const
Definition Target.cpp:5139
void SetUserSpecifiedTrapHandlerNames(const Args &args)
Definition Target.cpp:5134
uint32_t GetMaxZeroPaddingInFloatFormat() const
Definition Target.cpp:4971
uint64_t GetExprAllocAddress() const
Definition Target.cpp:5059
LoadCWDlldbinitFile GetLoadCWDlldbinitFile() const
Definition Target.cpp:5108
Environment GetInheritedEnvironment() const
Definition Target.cpp:4787
void SetArg0(llvm::StringRef arg)
Definition Target.cpp:4738
bool GetInjectLocalVariables(ExecutionContext *exe_ctx) const
Definition Target.cpp:4566
void SetStandardErrorPath(const char *path)=delete
bool ShowHexVariableValuesWithLeadingZeroes() const
Definition Target.cpp:4965
SourceLanguage GetLanguage() const
Definition Target.cpp:5034
Environment GetEnvironment() const
Definition Target.cpp:4783
void SetProcessLaunchInfo(const ProcessLaunchInfo &launch_info)
Definition Target.cpp:5165
FileSpec GetSaveJITObjectsDir() const
Definition Target.cpp:4921
void SetEnvironment(Environment env)
Definition Target.cpp:4826
LoadScriptFromSymFile GetLoadScriptFromSymbolFile() const
Definition Target.cpp:5101
const char * GetDisassemblyCPU() const
Definition Target.cpp:4704
void SetStandardErrorPath(llvm::StringRef path)
Definition Target.cpp:5029
bool GetRunArguments(Args &args) const
Definition Target.cpp:4744
FileSpecList GetExecutableSearchPaths()
Definition Target.cpp:4868
ArchSpec GetDefaultArchitecture() const
Definition Target.cpp:4593
Disassembler::HexImmediateStyle GetHexImmediateStyle() const
Definition Target.cpp:5115
void SetUseDIL(ExecutionContext *exe_ctx, bool b)
Definition Target.cpp:4584
std::unique_ptr< TargetExperimentalProperties > m_experimental_properties_up
Definition Target.h:306
FileSpecList GetClangModuleSearchPaths()
Definition Target.cpp:4878
void SetStandardOutputPath(llvm::StringRef path)
Definition Target.cpp:5019
bool GetRequireHardwareBreakpoints() const
Definition Target.cpp:5193
PathMappingList & GetSourcePathMap() const
Definition Target.cpp:4838
bool GetAutoSourceMapRelative() const
Definition Target.cpp:4854
bool GetUseDIL(ExecutionContext *exe_ctx) const
Definition Target.cpp:4572
void SetDefaultArchitecture(const ArchSpec &arch)
Definition Target.cpp:4598
void SetStandardInputPath(llvm::StringRef path)
Definition Target.cpp:5009
TargetProperties(Target *target)
Definition Target.cpp:4479
bool GetDisplayExpressionsInCrashlogs() const
Definition Target.cpp:5095
bool GetEnableAutoApplyFixIts() const
Definition Target.cpp:4903
void SetDebugUtilityExpression(bool debug)
Definition Target.cpp:5273
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:4984
A class that represents statistics for a since lldb_private::Target.
Definition Statistics.h:312
std::unique_ptr< Architecture > m_plugin_up
Definition Target.h:1771
const ArchSpec & GetSpec() const
Definition Target.h:1766
const Arch & operator=(const ArchSpec &spec)
Definition Target.cpp:164
Arch(const ArchSpec &spec)
Definition Target.cpp:160
Architecture * GetPlugin() const
Definition Target.h:1767
void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.h:1622
HandleStopCallback * m_callback
Definition Target.h:1630
StopHookResult HandleStop(ExecutionContext &exc_ctx, lldb::StreamSP output) override
Definition Target.h:1617
StopHookCoded(lldb::TargetSP target_sp, lldb::user_id_t uid)
Use CreateStopHook to make a new empty stop hook.
Definition Target.h:1635
void SetCallback(llvm::StringRef name, HandleStopCallback *callback)
Definition Target.h:1612
StopHookResult(ExecutionContext &exc_ctx, lldb::StreamSP output) HandleStopCallback
Definition Target.h:1609
void SetActionFromString(const std::string &strings)
Definition Target.cpp:4094
StopHookCommandLine(lldb::TargetSP target_sp, lldb::user_id_t uid)
Definition Target.h:1573
void SetActionFromStrings(const std::vector< std::string > &strings)
Definition Target.cpp:4098
StopHookResult HandleStop(ExecutionContext &exc_ctx, lldb::StreamSP output_sp) override
Definition Target.cpp:4105
void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.cpp:4076
Status SetScriptCallback(std::string class_name, StructuredData::ObjectSP extra_args_sp)
Definition Target.cpp:4139
StopHookResult HandleStop(ExecutionContext &exc_ctx, lldb::StreamSP output) override
Definition Target.cpp:4179
StopHookScripted(lldb::TargetSP target_sp, lldb::user_id_t uid)
Use CreateStopHook to make a new empty stop hook.
Definition Target.h:1600
void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.cpp:4198
StructuredDataImpl m_extra_args
This holds the dictionary of keys & values that can be used to parametrize any given callback's behav...
Definition Target.h:1594
lldb::ScriptedStopHookInterfaceSP m_interface_sp
Definition Target.h:1595
bool GetRunAtInitialStop() const
Definition Target.h:1531
SymbolContextSpecifier * GetSpecifier()
Definition Target.h:1500
void SetSpecifier(SymbolContextSpecifier *specifier)
Definition Target.cpp:4014
virtual StopHookResult HandleStop(ExecutionContext &exe_ctx, lldb::StreamSP output)=0
std::unique_ptr< ThreadSpec > m_thread_spec_up
Definition Target.h:1546
void SetIsActive(bool is_active)
Definition Target.h:1519
void SetSuppressOutput(bool suppress_output)
Definition Target.h:1533
void SetThreadSpecifier(ThreadSpec *specifier)
Definition Target.cpp:4018
ThreadSpec * GetThreadSpecifier()
Definition Target.h:1515
StopHook(const StopHook &rhs)
Definition Target.cpp:4006
bool ExecutionContextPasses(const ExecutionContext &exe_ctx)
Definition Target.cpp:4022
lldb::TargetSP & GetTarget()
Definition Target.h:1494
void SetRunAtInitialStop(bool at_initial_stop)
Definition Target.h:1527
lldb::SymbolContextSpecifierSP m_specifier_sp
Definition Target.h:1545
virtual void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const =0
void GetDescription(Stream &s, lldb::DescriptionLevel level) const
Definition Target.cpp:4038
void SetAutoContinue(bool auto_continue)
Definition Target.h:1521
const ModuleList & GetModuleList() const
Definition Target.h:619
void Dump(Stream *s) const override
Definition Target.cpp:5298
static llvm::StringRef GetFlavorString()
Definition Target.cpp:5294
static lldb::TargetSP GetCreatedTargetFromEvent(const Event *event_ptr)
Definition Target.cpp:5327
static ModuleList GetModuleListFromEvent(const Event *event_ptr)
Definition Target.cpp:5336
static const TargetEventData * GetEventDataFromEvent(const Event *event_ptr)
Definition Target.cpp:5308
llvm::StringRef GetFlavor() const override
Definition Target.h:597
const lldb::TargetSP & GetTarget() const
Definition Target.h:613
TargetEventData(const lldb::TargetSP &target_sp)
Definition Target.cpp:5280
TargetEventData(const TargetEventData &)=delete
const lldb::TargetSP & GetCreatedTarget() const
Definition Target.h:615
const TargetEventData & operator=(const TargetEventData &)=delete
static lldb::TargetSP GetTargetFromEvent(const Event *event_ptr)
Definition Target.cpp:5318
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:1841
lldb::ThreadSP CalculateThread() override
Definition Target.cpp:2579
llvm::Expected< uint32_t > AddScriptedFrameProviderDescriptor(const ScriptedFrameProviderDescriptor &descriptor)
Add or update a scripted frame provider descriptor for this target.
Definition Target.cpp:3719
StopHookCollection m_stop_hooks
Definition Target.h:1821
Module * GetExecutableModulePointer()
Definition Target.cpp:1541
void Dump(Stream *s, lldb::DescriptionLevel description_level)
Dump a description of this object to a Stream.
Definition Target.cpp:244
void DisableAllBreakpoints(bool internal_also=false)
Definition Target.cpp:1073
lldb::WatchpointSP CreateWatchpoint(lldb::addr_t addr, size_t size, const CompilerType *type, uint32_t kind, Status &error)
Definition Target.cpp:955
void ApplyNameToBreakpoints(BreakpointName &bp_name)
Definition Target.cpp:909
lldb::TraceSP GetTrace()
Get the Trace object containing processor trace information of this target.
Definition Target.cpp:3594
PathMappingList & GetImageSearchPathList()
Definition Target.cpp:2588
void FinalizeFileActions(ProcessLaunchInfo &info)
Definition Target.cpp:3787
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:2987
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:2995
ModuleList & GetImages()
Definition Target.h:1143
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:761
static Target * GetTargetFromContexts(const ExecutionContext *exe_ctx_ptr, const SymbolContext *sc_ptr)
Definition Target.cpp:2822
lldb::addr_t GetBreakableLoadAddress(lldb::addr_t addr)
Definition Target.cpp:3002
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:3946
bool SetSuppresStopHooks(bool suppress)
Definition Target.h:1658
static void ImageSearchPathsChanged(const PathMappingList &path_list, void *baton)
Definition Target.cpp:2592
llvm::Expected< lldb_private::Address > GetEntryPointAddress()
This method will return the address of the starting function for this binary, e.g.
Definition Target.cpp:2953
bool IgnoreWatchpointByID(lldb::watch_id_t watch_id, uint32_t ignore_count)
Definition Target.cpp:1509
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:727
lldb::BreakpointSP GetBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:422
std::shared_ptr< StopHook > StopHookSP
Definition Target.h:1642
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:573
void SymbolsDidLoad(ModuleList &module_list)
Definition Target.cpp:1868
bool ClearAllWatchpointHistoricValues()
Definition Target.cpp:1423
const std::vector< StopHookSP > GetStopHooks(bool internal=false) const
Definition Target.cpp:3115
void SetTrace(const lldb::TraceSP &trace_sp)
Set the Trace object containing processor trace information of this target.
Definition Target.cpp:3592
BreakpointList & GetBreakpointList(bool internal=false)
Definition Target.cpp:408
CompilerType GetRegisterType(const std::string &name, const lldb_private::RegisterFlags &flags, uint32_t byte_size)
Definition Target.cpp:2628
BreakpointNameList m_breakpoint_names
Definition Target.h:1795
lldb_private::SummaryStatisticsCache & GetSummaryStatisticsCache()
Definition Target.cpp:3409
lldb::addr_t GetSectionLoadAddress(const lldb::SectionSP &section_sp)
Definition Target.cpp:5361
llvm::StringRef GetABIName() const
Returns the name of the target's ABI plugin.
Definition Target.cpp:397
SourceManager & GetSourceManager()
Definition Target.cpp:3039
lldb::SearchFilterSP GetSearchFilterForModuleList(const FileSpecList *containingModuleList)
Definition Target.cpp:690
StopHookSP GetStopHookByID(lldb::user_id_t uid)
Definition Target.cpp:3081
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:1844
lldb::ProcessSP m_process_sp
Definition Target.h:1803
Debugger & GetDebugger() const
Definition Target.h:1224
lldb::SearchFilterSP m_search_filter_sp
Definition Target.h:1804
PersistentExpressionState * GetPersistentExpressionStateForLanguage(lldb::LanguageType language)
Definition Target.cpp:2672
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:3934
bool m_is_dummy_target
Used to not run stop hooks for expressions.
Definition Target.h:1828
static bool UpdateSignalFromDummy(lldb::UnixSignalsSP signals_sp, const DummySignalElement &element)
Definition Target.cpp:3892
PathMappingList m_image_search_paths
Definition Target.h:1805
bool ModuleIsExcludedForUnconstrainedSearches(const FileSpec &module_spec)
Return whether this FileSpec corresponds to a module that should be considered for general searches.
Definition Target.cpp:1924
lldb::StackFrameSP CalculateStackFrame() override
Definition Target.cpp:2581
SectionLoadList & GetSectionLoadList()
Definition Target.h:1901
lldb::addr_t GetPersistentSymbol(ConstString name)
Definition Target.cpp:2933
void PrimeFromDummyTarget(Target &target)
Definition Target.cpp:220
bool RemoveScriptedFrameProviderDescriptor(uint32_t id)
Remove a scripted frame provider descriptor by id.
Definition Target.cpp:3742
lldb::RegisterTypeBuilderSP m_register_type_builder_sp
Definition Target.h:1846
static void SettingsTerminate()
Definition Target.cpp:2784
bool EnableWatchpointByID(lldb::watch_id_t watch_id)
Definition Target.cpp:1474
bool ResolveFileAddress(lldb::addr_t load_addr, Address &so_addr)
Definition Target.cpp:3325
bool ClearAllWatchpointHitCounts()
Definition Target.cpp:1409
size_t ReadMemoryFromFileCache(const Address &addr, void *dst, size_t dst_len, Status &error)
Definition Target.cpp:1956
void ClearAllLoadedSections()
Definition Target.cpp:3401
std::vector< lldb::TypeSystemSP > GetScratchTypeSystems(bool create_on_demand=true)
Definition Target.cpp:2638
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:2255
void AddNameToBreakpoint(BreakpointID &id, llvm::StringRef name, Status &error)
Definition Target.cpp:829
void DumpSectionLoadList(Stream &s)
Definition Target.cpp:5367
void DeleteCurrentProcess()
Definition Target.cpp:279
BreakpointList m_internal_breakpoint_list
Definition Target.h:1792
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:2286
void DisableAllowedBreakpoints()
Definition Target.cpp:1083
bool LoadScriptingResources(std::list< Status > &errors, bool continue_on_error=true)
Definition Target.h:1118
bool SetSectionUnloaded(const lldb::SectionSP &section_sp)
Definition Target.cpp:3379
lldb::TargetSP CalculateTarget() override
Definition Target.cpp:2575
const lldb::ProcessSP & GetProcessSP() const
Definition Target.cpp:313
void ClearModules(bool delete_locations)
Definition Target.cpp:1545
bool RemoveBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:1107
lldb::ModuleSP GetOrCreateModule(const ModuleSpec &module_spec, bool notify, Status *error_ptr=nullptr)
Find a binary on the system and return its Module, or return an existing Module that is already in th...
Definition Target.cpp:2338
static bool ResetSignalFromDummy(lldb::UnixSignalsSP signals_sp, const DummySignalElement &element)
Definition Target.cpp:3919
Architecture * GetArchitecturePlugin() const
Definition Target.h:1222
llvm::json::Value ReportStatistics(const lldb_private::StatisticsOptions &options)
Get metrics associated with this target in JSON format.
Definition Target.cpp:5353
friend class TargetList
Definition Target.h:555
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:2725
TargetStats & GetStatistics()
Definition Target.h:1871
void EnableAllBreakpoints(bool internal_also=false)
Definition Target.cpp:1090
Status Launch(ProcessLaunchInfo &launch_info, Stream *stream)
Definition Target.cpp:3424
bool DisableBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:1127
lldb::BreakpointSP CreateBreakpointAtUserEntry(Status &error)
Definition Target.cpp:434
BreakpointName * FindBreakpointName(ConstString name, bool can_create, Status &error)
Definition Target.cpp:861
std::map< lldb::user_id_t, StopHookSP > StopHookCollection
Definition Target.h:1820
llvm::Expected< lldb::TraceSP > CreateTrace()
Create a Trace object for the current target using the using the default supported tracing technology...
Definition Target.cpp:3596
lldb::TraceSP m_trace_sp
An optional lldb_private::Trace object containing processor trace information of this target.
Definition Target.h:1838
lldb::user_id_t GetGloballyUniqueID() const
Get the globally unique ID for this target.
Definition Target.h:655
bool RemoveAllWatchpoints(bool end_to_end=true)
Definition Target.cpp:1327
bool ReadPointerFromMemory(const Address &addr, Status &error, Address &pointer_addr, bool force_live_memory=false)
Definition Target.cpp:2308
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:3067
WatchpointList m_watchpoint_list
Definition Target.h:1798
BreakpointList m_breakpoint_list
Definition Target.h:1791
lldb::SourceManagerUP m_source_manager_up
Definition Target.h:1818
bool RemoveWatchpointByID(lldb::watch_id_t watch_id)
Definition Target.cpp:1493
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, uint32_t stop_id=SectionLoadHistory::eStopIDNow, bool allow_section_end=false)
Definition Target.cpp:3319
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:2206
const llvm::DenseMap< uint32_t, ScriptedFrameProviderDescriptor > & GetScriptedFrameProviderDescriptors() const
Get all scripted frame provider descriptors for this target.
Definition Target.cpp:3766
void DeleteBreakpointName(ConstString name)
Definition Target.cpp:885
void NotifyWillClearList(const ModuleList &module_list) override
Definition Target.cpp:1803
bool SetArchitecture(const ArchSpec &arch_spec, bool set_platform=false, bool merge=true)
Set the architecture for this target.
Definition Target.cpp:1687
void NotifyModuleAdded(const ModuleList &module_list, const lldb::ModuleSP &module_sp) override
Implementing of ModuleList::Notifier.
Definition Target.cpp:1805
llvm::Expected< lldb::TypeSystemSP > GetScratchTypeSystemForLanguage(lldb::LanguageType language, bool create_on_demand=true)
Definition Target.cpp:2601
void ConfigureBreakpointName(BreakpointName &bp_name, const BreakpointOptions &options, const BreakpointName::Permissions &permissions)
Definition Target.cpp:901
lldb_private::SummaryStatisticsSP GetSummaryStatisticsSPForProviderName(lldb_private::TypeSummaryImpl &summary_provider)
Definition Target.cpp:3403
lldb::SearchFilterSP GetSearchFilterForModuleAndCUList(const FileSpecList *containingModules, const FileSpecList *containingSourceFiles)
Definition Target.cpp:707
lldb::ModuleSP GetExecutableModule()
Gets the module for the main executable.
Definition Target.cpp:1525
bool SetStopHookActiveStateByID(lldb::user_id_t uid, bool active_state)
Definition Target.cpp:3091
const lldb::ProcessSP & CreateProcess(lldb::ListenerSP listener_sp, llvm::StringRef plugin_name, const FileSpec *crash_file, bool can_connect)
Definition Target.cpp:301
void SetAllStopHooksActiveState(bool active_state)
Definition Target.cpp:3102
std::vector< StopHookSP > m_internal_stop_hooks
Definition Target.h:1823
lldb::ExpressionVariableSP GetPersistentVariable(ConstString name)
Definition Target.cpp:2914
void NotifyModulesRemoved(lldb_private::ModuleList &module_list) override
Definition Target.cpp:1837
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:3045
size_t ReadCStringFromMemory(const Address &addr, std::string &out_str, Status &error, bool force_live_memory=false)
Definition Target.cpp:2116
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:1777
std::recursive_mutex m_frame_provider_descriptors_mutex
Definition Target.h:1813
lldb::user_id_t m_target_unique_id
The globally unique ID assigned to this target.
Definition Target.h:1830
void ModulesDidUnload(ModuleList &module_list, bool delete_locations)
Definition Target.cpp:1884
void CalculateExecutionContext(ExecutionContext &exe_ctx) override
Reconstruct the object's execution context into sc.
Definition Target.cpp:2583
llvm::Expected< lldb::DisassemblerSP > ReadInstructions(const Address &start_addr, uint32_t count, const char *flavor_string=nullptr)
Definition Target.cpp:3008
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:3621
void NotifyModuleUpdated(const ModuleList &module_list, const lldb::ModuleSP &old_module_sp, const lldb::ModuleSP &new_module_sp) override
Definition Target.cpp:1825
SummaryStatisticsCache m_summary_statistics_cache
Definition Target.h:1789
Target(const Target &)=delete
void RegisterInternalStopHooks()
Status SerializeBreakpointsToFile(const FileSpec &file, const BreakpointIDList &bp_ids, bool append)
Definition Target.cpp:1168
void DidExec()
Called as the last function in Process::DidExec().
Definition Target.cpp:1552
void SaveScriptedLaunchInfo(lldb_private::ProcessInfo &process_info)
Definition Target.cpp:3413
bool GetSuppressStopHooks()
Definition Target.h:1664
std::string m_label
Definition Target.h:1786
lldb::user_id_t m_stop_hook_next_id
Definition Target.h:1822
static FileSpecList GetDefaultExecutableSearchPaths()
Definition Target.cpp:2786
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:744
void NotifyBreakpointChanged(Breakpoint &bp, lldb::BreakpointEventType event_kind)
Sends a breakpoint notification event.
Definition Target.cpp:5371
lldb::SearchFilterSP GetSearchFilterForModule(const FileSpec *containingModule)
Definition Target.cpp:672
llvm::StringMapEntry< DummySignalValues > DummySignalElement
Definition Target.h:1720
std::recursive_mutex & GetAPIMutex()
Definition Target.cpp:5344
static llvm::StringRef GetStaticBroadcasterClass()
Definition Target.cpp:170
static FileSpecList GetDefaultDebugFileSearchPaths()
Definition Target.cpp:2790
void EnableAllowedBreakpoints()
Definition Target.cpp:1100
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:1990
llvm::Error SetLabel(llvm::StringRef label)
Set a label for a target.
Definition Target.cpp:2805
uint32_t m_latest_stop_hook_id
Definition Target.h:1824
StackFrameRecognizerManager & GetFrameRecognizerManager()
Definition Target.h:1702
void RemoveAllowedBreakpoints()
Definition Target.cpp:1052
bool DisableAllWatchpoints(bool end_to_end=true)
Definition Target.cpp:1356
bool RunStopHooks(bool at_initial_stop=false)
Definition Target.cpp:3126
void ClearSectionLoadList()
Definition Target.cpp:5365
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:2193
lldb::PlatformSP m_platform_sp
The platform for this target.
Definition Target.h:1776
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:2755
static TargetProperties & GetGlobalProperties()
Definition Target.cpp:3283
Status Install(ProcessLaunchInfo *launch_info)
Definition Target.cpp:3291
lldb::PlatformSP GetPlatform()
Definition Target.h:1678
void NotifyModuleRemoved(const ModuleList &module_list, const lldb::ModuleSP &module_sp) override
Definition Target.cpp:1815
lldb::BreakpointSP CreateAddressInModuleBreakpoint(lldb::addr_t file_addr, bool internal, const FileSpec &file_spec, bool request_hardware)
Definition Target.cpp:578
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:489
void RemoveAllBreakpoints(bool internal_also=false)
Definition Target.cpp:1061
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:472
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:2794
void ResetBreakpointHitCounts()
Resets the hit count of all breakpoints.
Definition Target.cpp:1164
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition Target.h:1141
const ArchSpec & GetArchitecture() const
Definition Target.h:1183
WatchpointList & GetWatchpointList()
Definition Target.h:928
@ eBroadcastBitWatchpointChanged
Definition Target.h:563
@ eBroadcastBitBreakpointChanged
Definition Target.h:560
@ eBroadcastBitNewTargetCreated
Definition Target.h:566
unsigned m_next_persistent_variable_index
Definition Target.h:1829
bool EnableBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:1145
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:2297
void InvalidateThreadFrameProviders()
Invalidate all potentially cached frame providers for all threads and trigger a stack changed event f...
Definition Target.cpp:3772
TargetStats m_stats
Definition Target.h:1854
bool IgnoreAllWatchpoints(uint32_t ignore_count)
Definition Target.cpp:1438
void AddBreakpoint(lldb::BreakpointSP breakpoint_sp, bool internal)
Definition Target.cpp:806
std::string m_target_session_name
The target session name for this target, used to name debugging sessions in DAP.
Definition Target.h:1833
TypeSystemMap m_scratch_type_system_map
Definition Target.h:1806
void AddBreakpointName(std::unique_ptr< BreakpointName > bp_name)
Definition Target.cpp:856
void SetTargetSessionName(llvm::StringRef target_session_name)
Set the target session name for this target.
Definition Target.h:688
SectionLoadHistory m_section_load_history
Definition Target.h:1790
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)
void GetBreakpointNames(std::vector< std::string > &names)
Definition Target.cpp:923
bool IsDummyTarget() const
Definition Target.h:644
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:175
size_t UnloadModuleSections(const lldb::ModuleSP &module_sp)
Definition Target.cpp:3360
llvm::StringRef GetTargetSessionName()
Get the target session name for this target.
Definition Target.h:676
llvm::DenseMap< uint32_t, ScriptedFrameProviderDescriptor > m_frame_provider_descriptors
Map of scripted frame provider descriptors for this target.
Definition Target.h:1812
const std::string & GetLabel() const
Definition Target.h:657
bool m_valid
This records the last natural stop at which we ran a stop-hook.
Definition Target.h:1826
bool DisableWatchpointByID(lldb::watch_id_t watch_id)
Definition Target.cpp:1455
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:3877
void ClearScriptedFrameProviderDescriptors()
Clear all scripted frame provider descriptors for this target.
Definition Target.cpp:3755
std::map< ConstString, std::unique_ptr< BreakpointName > > BreakpointNameList
Definition Target.h:1793
lldb::WatchpointSP m_last_created_watchpoint
Definition Target.h:1799
Status CreateBreakpointsFromFile(const FileSpec &file, BreakpointIDList &new_bps)
Definition Target.cpp:1260
Debugger & m_debugger
Definition Target.h:1775
void SetREPL(lldb::LanguageType language, lldb::REPLSP repl_sp)
Definition Target.cpp:366
lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules, const FileSpecList *containingSourceFiles, const char *func_names[], size_t num_names, lldb::FunctionNameType func_name_type_mask, lldb::LanguageType language, lldb::addr_t offset, LazyBool skip_prologue, bool internal, bool request_hardware)
void SetExecutableModule(lldb::ModuleSP &module_sp, LoadDependentFiles load_dependent_files=eLoadDependentsDefault)
Set the main executable module.
Definition Target.cpp:1558
lldb::StackFrameRecognizerManagerUP m_frame_recognizer_manager_up
Stores the frame recognizers of this target.
Definition Target.h:1840
lldb::REPLSP GetREPL(Status &err, lldb::LanguageType language, const char *repl_options, bool can_create)
Definition Target.cpp:315
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:2692
ModuleList m_images
The list of images for this process (shared libraries and anything dynamically loaded).
Definition Target.h:1787
lldb::ProcessSP CalculateProcess() override
Definition Target.cpp:2577
void PrintDummySignals(Stream &strm, Args &signals)
Print all the signals set in this target.
Definition Target.cpp:3971
void SetPlatform(const lldb::PlatformSP &platform_sp)
Definition Target.h:1680
bool SetSectionLoadAddress(const lldb::SectionSP &section, lldb::addr_t load_addr, bool warn_multiple=false)
Definition Target.cpp:3330
Status Attach(ProcessAttachInfo &attach_info, Stream *stream)
Definition Target.cpp:3627
std::map< lldb::LanguageType, lldb::REPLSP > REPLMap
Definition Target.h:1815
static void SetDefaultArchitecture(const ArchSpec &arch)
Definition Target.cpp:2798
lldb::BreakpointSP m_last_created_breakpoint
Definition Target.h:1797
lldb::WatchpointSP GetLastCreatedWatchpoint()
Definition Target.h:924
void RemoveNameFromBreakpoint(lldb::BreakpointSP &bp_sp, ConstString name)
Definition Target.cpp:896
bool RemoveStopHookByID(lldb::user_id_t uid)
Definition Target.cpp:3074
friend class Debugger
Definition Target.h:556
lldb::BreakpointSP GetLastCreatedBreakpoint()
Definition Target.h:816
static void SettingsInitialize()
Definition Target.cpp:2782
~Target() override
Definition Target.cpp:214
bool EnableAllWatchpoints(bool end_to_end=true)
Definition Target.cpp:1383
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:1784
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:2836
bool MergeArchitecture(const ArchSpec &arch_spec)
Definition Target.cpp:1778
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:56
@ eLoadScriptFromSymFileTrue
Definition Target.h:57
@ eLoadScriptFromSymFileTrusted
Definition Target.h:60
@ eLoadScriptFromSymFileFalse
Definition Target.h:58
@ eLoadScriptFromSymFileWarn
Definition Target.h:59
ExecutionPolicy
Expression execution policies.
DynamicClassInfoHelper
Definition Target.h:75
@ eDynamicClassInfoHelperCopyRealizedClassList
Definition Target.h:78
@ eDynamicClassInfoHelperGetRealizedClassList
Definition Target.h:79
@ eDynamicClassInfoHelperAuto
Definition Target.h:76
@ eDynamicClassInfoHelperRealizedClassesStruct
Definition Target.h:77
OptionEnumValues GetDynamicValueTypes()
Definition Target.cpp:4256
@ eImportStdModuleFalse
Definition Target.h:70
@ eImportStdModuleFallback
Definition Target.h:71
@ eImportStdModuleTrue
Definition Target.h:72
LoadCWDlldbinitFile
Definition Target.h:63
@ eLoadCWDlldbinitTrue
Definition Target.h:64
@ eLoadCWDlldbinitFalse
Definition Target.h:65
@ eLoadCWDlldbinitWarn
Definition Target.h:66
llvm::ArrayRef< OptionEnumValueElement > OptionEnumValues
@ eInlineBreakpointsNever
Definition Target.h:51
@ eInlineBreakpointsAlways
Definition Target.h:53
@ eInlineBreakpointsHeaders
Definition Target.h:52
ExpressionEvaluationPhase
Expression Evaluation Stages.
std::shared_ptr< lldb_private::Trace > TraceSP
std::shared_ptr< lldb_private::ScriptedStopHookInterface > ScriptedStopHookInterfaceSP
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::SearchFilter > SearchFilterSP
std::shared_ptr< lldb_private::BreakpointResolver > BreakpointResolverSP
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
std::unique_ptr< lldb_private::StackFrameRecognizerManager > StackFrameRecognizerManagerUP
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::ExpressionVariable > ExpressionVariableSP
std::shared_ptr< lldb_private::UnixSignals > UnixSignalsSP
std::shared_ptr< lldb_private::Platform > PlatformSP
std::shared_ptr< lldb_private::RegisterTypeBuilder > RegisterTypeBuilderSP
LanguageType
Programming language type.
std::shared_ptr< lldb_private::Stream > StreamSP
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
ExpressionResults
The results of expression evaluation.
int32_t break_id_t
Definition lldb-types.h:87
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:88
uint64_t user_id_t
Definition lldb-types.h:82
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
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:1716
UserID(lldb::user_id_t uid=LLDB_INVALID_UID)
Construct with optional user ID.
Definition UserID.h:33