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"
42#include "lldb/lldb-public.h"
43#include "llvm/ADT/StringRef.h"
44
45namespace lldb_private {
46
48
54
60
66
72
79
84
86public:
87 TargetProperties(Target *target);
88
90
92
93 void SetDefaultArchitecture(const ArchSpec &arch);
94
95 bool GetMoveToNearestCode() const;
96
98
100
101 bool GetPreloadSymbols() const;
102
103 void SetPreloadSymbols(bool b);
104
105 bool GetDisableASLR() const;
106
107 void SetDisableASLR(bool b);
108
109 bool GetInheritTCC() const;
110
111 void SetInheritTCC(bool b);
112
113 bool GetDetachOnError() const;
114
115 void SetDetachOnError(bool b);
116
117 bool GetDisableSTDIO() const;
118
119 void SetDisableSTDIO(bool b);
120
121 llvm::StringRef GetLaunchWorkingDirectory() const;
122
123 bool GetParallelModuleLoad() const;
124
125 const char *GetDisassemblyFlavor() const;
126
127 const char *GetDisassemblyCPU() const;
128
129 const char *GetDisassemblyFeatures() const;
130
132
134
135 llvm::StringRef GetArg0() const;
136
137 void SetArg0(llvm::StringRef arg);
138
139 bool GetRunArguments(Args &args) const;
140
141 void SetRunArguments(const Args &args);
142
143 // Get the whole environment including the platform inherited environment and
144 // the target specific environment, excluding the unset environment variables.
146 // Get the platform inherited environment, excluding the unset environment
147 // variables.
149 // Get the target specific environment only, without the platform inherited
150 // environment.
152 // Set the target specific environment.
153 void SetEnvironment(Environment env);
154
155 bool GetSkipPrologue() const;
156
158
160
161 bool GetAutoSourceMapRelative() const;
162
164
166
168
170
172
174
176
177 bool GetEnableAutoApplyFixIts() const;
178
179 uint64_t GetNumberOfRetriesWithFixits() const;
180
181 bool GetEnableNotifyAboutFixIts() const;
182
184
185 bool GetEnableSyntheticValue() const;
186
188
189 uint32_t GetMaxZeroPaddingInFloatFormat() const;
190
192
193 /// Get the max depth value, augmented with a bool to indicate whether the
194 /// depth is the default.
195 ///
196 /// When the user has customized the max depth, the bool will be false.
197 ///
198 /// \returns the max depth, and true if the max depth is the system default,
199 /// otherwise false.
200 std::pair<uint32_t, bool> GetMaximumDepthOfChildrenToDisplay() const;
201
202 uint32_t GetMaximumSizeOfStringSummary() const;
203
204 uint32_t GetMaximumMemReadSize() const;
205
209
210 void SetStandardInputPath(llvm::StringRef path);
211 void SetStandardOutputPath(llvm::StringRef path);
212 void SetStandardErrorPath(llvm::StringRef path);
213
214 void SetStandardInputPath(const char *path) = delete;
215 void SetStandardOutputPath(const char *path) = delete;
216 void SetStandardErrorPath(const char *path) = delete;
217
219
221
222 llvm::StringRef GetExpressionPrefixContents();
223
224 uint64_t GetExprErrorLimit() const;
225
226 uint64_t GetExprAllocAddress() const;
227
228 uint64_t GetExprAllocSize() const;
229
230 uint64_t GetExprAllocAlign() const;
231
232 bool GetUseHexImmediates() const;
233
234 bool GetUseFastStepping() const;
235
237
239
241
243
245
246 bool GetUserSpecifiedTrapHandlerNames(Args &args) const;
247
248 void SetUserSpecifiedTrapHandlerNames(const Args &args);
249
251
253
255
257
259
260 void SetProcessLaunchInfo(const ProcessLaunchInfo &launch_info);
261
262 bool GetInjectLocalVariables(ExecutionContext *exe_ctx) const;
263
264 bool GetUseDIL(ExecutionContext *exe_ctx) const;
265
266 void SetUseDIL(ExecutionContext *exe_ctx, bool b);
267
269
271
272 bool GetAutoInstallMainExecutable() const;
273
275
276 void SetDebugUtilityExpression(bool debug);
277
278 bool GetDebugUtilityExpression() const;
279
280private:
281 std::optional<bool>
282 GetExperimentalPropertyValue(size_t prop_idx,
283 ExecutionContext *exe_ctx = nullptr) const;
284
285 // Callbacks for m_launch_info.
296
297 // Settings checker for target.jit-save-objects-dir:
298 void CheckJITObjectsDir();
299
301
302 // Member variables.
304 std::unique_ptr<TargetExperimentalProperties> m_experimental_properties_up;
306};
307
309public:
310// MSVC has a bug here that reports C4268: 'const' static/global data
311// initialized with compiler generated default constructor fills the object
312// with zeros. Confirmed that MSVC is *not* zero-initializing, it's just a
313// bogus warning.
314#if defined(_MSC_VER)
315#pragma warning(push)
316#pragma warning(disable : 4268)
317#endif
318 static constexpr std::chrono::milliseconds default_timeout{500};
319#if defined(_MSC_VER)
320#pragma warning(pop)
321#endif
322
325
327
329
333
335
336 void SetLanguage(lldb::LanguageType language_type) {
337 m_language = SourceLanguage(language_type);
338 }
339
341 m_preferred_lookup_contexts = std::move(contexts);
342 }
343
347
348 /// Set the language using a pair of language code and version as
349 /// defined by the DWARF 6 specification.
350 /// WARNING: These codes may change until DWARF 6 is finalized.
351 void SetLanguage(uint16_t name, uint32_t version) {
352 m_language = SourceLanguage(name, version);
353 }
354
355 bool DoesCoerceToId() const { return m_coerce_to_id; }
356
357 const char *GetPrefix() const {
358 return (m_prefix.empty() ? nullptr : m_prefix.c_str());
359 }
360
361 void SetPrefix(const char *prefix) {
362 if (prefix && prefix[0])
363 m_prefix = prefix;
364 else
365 m_prefix.clear();
366 }
367
368 void SetCoerceToId(bool coerce = true) { m_coerce_to_id = coerce; }
369
370 bool DoesUnwindOnError() const { return m_unwind_on_error; }
371
372 void SetUnwindOnError(bool unwind = false) { m_unwind_on_error = unwind; }
373
375
376 void SetIgnoreBreakpoints(bool ignore = false) {
377 m_ignore_breakpoints = ignore;
378 }
379
380 bool DoesKeepInMemory() const { return m_keep_in_memory; }
381
382 void SetKeepInMemory(bool keep = true) { m_keep_in_memory = keep; }
383
385
386 void
390
391 const Timeout<std::micro> &GetTimeout() const { return m_timeout; }
392
393 void SetTimeout(const Timeout<std::micro> &timeout) { m_timeout = timeout; }
394
398
400 m_one_thread_timeout = timeout;
401 }
402
403 bool GetTryAllThreads() const { return m_try_others; }
404
405 void SetTryAllThreads(bool try_others = true) { m_try_others = try_others; }
406
407 bool GetStopOthers() const { return m_stop_others; }
408
409 void SetStopOthers(bool stop_others = true) { m_stop_others = stop_others; }
410
411 bool GetDebug() const { return m_debug; }
412
413 void SetDebug(bool b) {
414 m_debug = b;
415 if (m_debug)
417 }
418
420
422
423 bool GetColorizeErrors() const { return m_ansi_color_errors; }
424
426
427 bool GetTrapExceptions() const { return m_trap_exceptions; }
428
430
431 bool GetREPLEnabled() const { return m_repl; }
432
433 void SetREPLEnabled(bool b) { m_repl = b; }
434
437 m_cancel_callback = callback;
438 }
439
441 return ((m_cancel_callback != nullptr)
443 : false);
444 }
445
446 // Allows the expression contents to be remapped to point to the specified
447 // file and line using #line directives.
448 void SetPoundLine(const char *path, uint32_t line) const {
449 if (path && path[0]) {
450 m_pound_line_file = path;
451 m_pound_line_line = line;
452 } else {
453 m_pound_line_file.clear();
455 }
456 }
457
458 const char *GetPoundLineFilePath() const {
459 return (m_pound_line_file.empty() ? nullptr : m_pound_line_file.c_str());
460 }
461
462 uint32_t GetPoundLineLine() const { return m_pound_line_line; }
463
465
469
471
473
474 void SetRetriesWithFixIts(uint64_t number_of_retries) {
475 m_retries_with_fixits = number_of_retries;
476 }
477
478 uint64_t GetRetriesWithFixIts() const { return m_retries_with_fixits; }
479
481
483
484private:
487 std::string m_prefix;
488 bool m_coerce_to_id = false;
489 bool m_unwind_on_error = true;
491 bool m_keep_in_memory = false;
492 bool m_try_others = true;
493 bool m_stop_others = true;
494 bool m_debug = false;
495 bool m_trap_exceptions = true;
496 bool m_repl = false;
502 /// True if the executed code should be treated as utility code that is only
503 /// used by LLDB internally.
505
510 void *m_cancel_callback_baton = nullptr;
511 // If m_pound_line_file is not empty and m_pound_line_line is non-zero, use
512 // #line %u "%s" before the expression content to remap where the source
513 // originates
514 mutable std::string m_pound_line_file;
515 mutable uint32_t m_pound_line_line = 0;
516
517 /// During expression evaluation, any SymbolContext in this list will be
518 /// used for symbol/function lookup before any other context (except for
519 /// the module corresponding to the current frame).
521};
522
523// Target
524class Target : public std::enable_shared_from_this<Target>,
525 public TargetProperties,
526 public Broadcaster,
528 public ModuleList::Notifier {
529public:
530 friend class TargetList;
531 friend class Debugger;
532
533 /// Broadcaster event bits definitions.
534 enum {
542 };
543
544 // These two functions fill out the Broadcaster interface:
545
546 static llvm::StringRef GetStaticBroadcasterClass();
547
548 llvm::StringRef GetBroadcasterClass() const override {
550 }
551
552 // This event data class is for use by the TargetList to broadcast new target
553 // notifications.
554 class TargetEventData : public EventData {
555 public:
556 TargetEventData(const lldb::TargetSP &target_sp);
557
558 TargetEventData(const lldb::TargetSP &target_sp,
559 const ModuleList &module_list);
560
561 // Constructor for eBroadcastBitNewTargetCreated events. For this event
562 // type:
563 // - target_sp is the parent target (the subject/broadcaster of the event)
564 // - created_target_sp is the newly created target
565 TargetEventData(const lldb::TargetSP &target_sp,
566 const lldb::TargetSP &created_target_sp);
567
569
570 static llvm::StringRef GetFlavorString();
571
572 llvm::StringRef GetFlavor() const override {
574 }
575
576 void Dump(Stream *s) const override;
577
578 static const TargetEventData *GetEventDataFromEvent(const Event *event_ptr);
579
580 static lldb::TargetSP GetTargetFromEvent(const Event *event_ptr);
581
582 // For eBroadcastBitNewTargetCreated events, returns the newly created
583 // target. For other event types, returns an invalid target.
584 static lldb::TargetSP GetCreatedTargetFromEvent(const Event *event_ptr);
585
586 static ModuleList GetModuleListFromEvent(const Event *event_ptr);
587
588 const lldb::TargetSP &GetTarget() const { return m_target_sp; }
589
591 return m_created_target_sp;
592 }
593
594 const ModuleList &GetModuleList() const { return m_module_list; }
595
596 private:
600
602 const TargetEventData &operator=(const TargetEventData &) = delete;
603 };
604
605 ~Target() override;
606
607 static void SettingsInitialize();
608
609 static void SettingsTerminate();
610
612
614
616
617 static void SetDefaultArchitecture(const ArchSpec &arch);
618
619 bool IsDummyTarget() const { return m_is_dummy_target; }
620
621 /// Get the globally unique ID for this target.
622 ///
623 /// This ID is unique across all debugger instances and all targets,
624 /// within the same lldb process. The ID is assigned
625 /// during target construction and remains constant for the target's lifetime.
626 /// The first target created (typically the dummy target) gets ID 1.
627 ///
628 /// \return
629 /// The globally unique ID for this target.
631
632 const std::string &GetLabel() const { return m_label; }
633
634 /// Set a label for a target.
635 ///
636 /// The label cannot be used by another target or be only integral.
637 ///
638 /// \return
639 /// The label for this target or an error if the label didn't match the
640 /// requirements.
641 llvm::Error SetLabel(llvm::StringRef label);
642
643 /// Get the target session name for this target.
644 ///
645 /// Provides a meaningful name for IDEs or tools to display for dynamically
646 /// created targets. Defaults to "Session {ID}" based on the globally unique
647 /// ID.
648 ///
649 /// \return
650 /// The target session name for this target.
651 llvm::StringRef GetTargetSessionName() { return m_target_session_name; }
652
653 /// Set the target session name for this target.
654 ///
655 /// This should typically be set along with the event
656 /// eBroadcastBitNewTargetCreated. Useful for scripts or triggers that
657 /// automatically create targets and want to provide meaningful names that
658 /// IDEs or other tools can display to help users identify the origin and
659 /// purpose of each target.
660 ///
661 /// \param[in] target_session_name
662 /// The target session name to set for this target.
663 void SetTargetSessionName(llvm::StringRef target_session_name) {
664 m_target_session_name = target_session_name.str();
665 }
666
667 /// Find a binary on the system and return its Module,
668 /// or return an existing Module that is already in the Target.
669 ///
670 /// Given a ModuleSpec, find a binary satisifying that specification,
671 /// or identify a matching Module already present in the Target,
672 /// and return a shared pointer to it.
673 ///
674 /// Note that this function previously also preloaded the module's symbols
675 /// depending on a setting. This function no longer does any module
676 /// preloading because that can potentially cause deadlocks when called in
677 /// parallel with this function.
678 ///
679 /// \param[in] module_spec
680 /// The criteria that must be matched for the binary being loaded.
681 /// e.g. UUID, architecture, file path.
682 ///
683 /// \param[in] notify
684 /// If notify is true, and the Module is new to this Target,
685 /// Target::ModulesDidLoad will be called. See note in
686 /// Target::ModulesDidLoad about thread-safety with
687 /// Target::GetOrCreateModule.
688 /// If notify is false, it is assumed that the caller is adding
689 /// multiple Modules and will call ModulesDidLoad with the
690 /// full list at the end.
691 /// ModulesDidLoad must be called when a Module/Modules have
692 /// been added to the target, one way or the other.
693 ///
694 /// \param[out] error_ptr
695 /// Optional argument, pointing to a Status object to fill in
696 /// with any results / messages while attempting to find/load
697 /// this binary. Many callers will be internal functions that
698 /// will handle / summarize the failures in a custom way and
699 /// don't use these messages.
700 ///
701 /// \return
702 /// An empty ModuleSP will be returned if no matching file
703 /// was found. If error_ptr was non-nullptr, an error message
704 /// will likely be provided.
705 lldb::ModuleSP GetOrCreateModule(const ModuleSpec &module_spec, bool notify,
706 Status *error_ptr = nullptr);
707
708 // Settings accessors
709
711
712 std::recursive_mutex &GetAPIMutex();
713
715
716 void CleanupProcess();
717
718 /// Dump a description of this object to a Stream.
719 ///
720 /// Dump a description of the contents of this object to the
721 /// supplied stream \a s. The dumped content will be only what has
722 /// been loaded or parsed up to this point at which this function
723 /// is called, so this is a good way to see what has been parsed
724 /// in a target.
725 ///
726 /// \param[in] s
727 /// The stream to which to dump the object description.
728 void Dump(Stream *s, lldb::DescriptionLevel description_level);
729
730 // If listener_sp is null, the listener of the owning Debugger object will be
731 // used.
733 llvm::StringRef plugin_name,
734 const FileSpec *crash_file,
735 bool can_connect);
736
737 const lldb::ProcessSP &GetProcessSP() const;
738
739 bool IsValid() { return m_valid; }
740
741 void Destroy();
742
743 Status Launch(ProcessLaunchInfo &launch_info,
744 Stream *stream); // Optional stream to receive first stop info
745
746 Status Attach(ProcessAttachInfo &attach_info,
747 Stream *stream); // Optional stream to receive first stop info
748
749 /// Add or update a scripted frame provider descriptor for this target.
750 /// All new threads in this target will check if they match any descriptors
751 /// to create their frame providers.
752 ///
753 /// \param[in] descriptor
754 /// The descriptor to add or update.
755 ///
756 /// \return
757 /// The descriptor identifier if the registration succeeded, otherwise an
758 /// llvm::Error.
759 llvm::Expected<uint32_t> AddScriptedFrameProviderDescriptor(
760 const ScriptedFrameProviderDescriptor &descriptor);
761
762 /// Remove a scripted frame provider descriptor by id.
763 ///
764 /// \param[in] id
765 /// The id of the descriptor to remove.
766 ///
767 /// \return
768 /// True if a descriptor was removed, false if no descriptor with that
769 /// id existed.
771
772 /// Clear all scripted frame provider descriptors for this target.
774
775 /// Get all scripted frame provider descriptors for this target.
776 const llvm::DenseMap<uint32_t, ScriptedFrameProviderDescriptor> &
778
779 // This part handles the breakpoints.
780
781 BreakpointList &GetBreakpointList(bool internal = false);
782
783 const BreakpointList &GetBreakpointList(bool internal = false) const;
784
788
790
792
793 // Use this to create a file and line breakpoint to a given module or all
794 // module it is nullptr
795 lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules,
796 const FileSpec &file, uint32_t line_no,
797 uint32_t column, lldb::addr_t offset,
798 LazyBool check_inlines,
799 LazyBool skip_prologue, bool internal,
800 bool request_hardware,
801 LazyBool move_to_nearest_code);
802
803 // Use this to create breakpoint that matches regex against the source lines
804 // in files given in source_file_list: If function_names is non-empty, also
805 // filter by function after the matches are made.
807 const FileSpecList *containingModules,
808 const FileSpecList *source_file_list,
809 const std::unordered_set<std::string> &function_names,
810 RegularExpression source_regex, bool internal, bool request_hardware,
811 LazyBool move_to_nearest_code);
812
813 // Use this to create a breakpoint from a load address
814 lldb::BreakpointSP CreateBreakpoint(lldb::addr_t load_addr, bool internal,
815 bool request_hardware);
816
817 // Use this to create a breakpoint from a file address and a module file spec
819 bool internal,
820 const FileSpec &file_spec,
821 bool request_hardware);
822
823 // Use this to create Address breakpoints:
824 lldb::BreakpointSP CreateBreakpoint(const Address &addr, bool internal,
825 bool request_hardware);
826
827 // Use this to create a function breakpoint by regexp in
828 // containingModule/containingSourceFiles, or all modules if it is nullptr
829 // When "skip_prologue is set to eLazyBoolCalculate, we use the current
830 // target setting, else we use the values passed in
832 const FileSpecList *containingModules,
833 const FileSpecList *containingSourceFiles, RegularExpression func_regexp,
834 lldb::LanguageType requested_language, LazyBool skip_prologue,
835 bool internal, bool request_hardware);
836
837 // Use this to create a function breakpoint by name in containingModule, or
838 // all modules if it is nullptr When "skip_prologue is set to
839 // eLazyBoolCalculate, we use the current target setting, else we use the
840 // values passed in. func_name_type_mask is or'ed values from the
841 // FunctionNameType enum.
843 const FileSpecList *containingModules,
844 const FileSpecList *containingSourceFiles, const char *func_name,
845 lldb::FunctionNameType func_name_type_mask, lldb::LanguageType language,
846 lldb::addr_t offset, bool offset_is_insn_count, LazyBool skip_prologue,
847 bool internal, bool request_hardware);
848
850 CreateExceptionBreakpoint(enum lldb::LanguageType language, bool catch_bp,
851 bool throw_bp, bool internal,
852 Args *additional_args = nullptr,
853 Status *additional_args_error = nullptr);
854
856 const llvm::StringRef class_name, const FileSpecList *containingModules,
857 const FileSpecList *containingSourceFiles, bool internal,
858 bool request_hardware, StructuredData::ObjectSP extra_args_sp,
859 Status *creation_error = nullptr);
860
861 // This is the same as the func_name breakpoint except that you can specify a
862 // vector of names. This is cheaper than a regular expression breakpoint in
863 // the case where you just want to set a breakpoint on a set of names you
864 // already know. func_name_type_mask is or'ed values from the
865 // FunctionNameType enum.
867 const FileSpecList *containingModules,
868 const FileSpecList *containingSourceFiles, const char *func_names[],
869 size_t num_names, lldb::FunctionNameType func_name_type_mask,
870 lldb::LanguageType language, lldb::addr_t offset, LazyBool skip_prologue,
871 bool internal, bool request_hardware);
872
874 CreateBreakpoint(const FileSpecList *containingModules,
875 const FileSpecList *containingSourceFiles,
876 const std::vector<std::string> &func_names,
877 lldb::FunctionNameType func_name_type_mask,
878 lldb::LanguageType language, lldb::addr_t m_offset,
879 LazyBool skip_prologue, bool internal,
880 bool request_hardware);
881
882 // Use this to create a general breakpoint:
884 lldb::BreakpointResolverSP &resolver_sp,
885 bool internal, bool request_hardware,
886 bool resolve_indirect_symbols);
887
888 // Use this to create a watchpoint:
890 const CompilerType *type, uint32_t kind,
891 Status &error);
892
896
898
899 // Manages breakpoint names:
900 void AddNameToBreakpoint(BreakpointID &id, llvm::StringRef name,
901 Status &error);
902
903 void AddNameToBreakpoint(lldb::BreakpointSP &bp_sp, llvm::StringRef name,
904 Status &error);
905
907
908 BreakpointName *FindBreakpointName(ConstString name, bool can_create,
909 Status &error);
910
912
914 const BreakpointOptions &options,
915 const BreakpointName::Permissions &permissions);
917
918 void AddBreakpointName(std::unique_ptr<BreakpointName> bp_name);
919
920 void GetBreakpointNames(std::vector<std::string> &names);
921
922 // This call removes ALL breakpoints regardless of permission.
923 void RemoveAllBreakpoints(bool internal_also = false);
924
925 // This removes all the breakpoints, but obeys the ePermDelete on them.
927
928 void DisableAllBreakpoints(bool internal_also = false);
929
931
932 void EnableAllBreakpoints(bool internal_also = false);
933
935
937
939
941
942 /// Resets the hit count of all breakpoints.
944
945 // The flag 'end_to_end', default to true, signifies that the operation is
946 // performed end to end, for both the debugger and the debuggee.
947
948 bool RemoveAllWatchpoints(bool end_to_end = true);
949
950 bool DisableAllWatchpoints(bool end_to_end = true);
951
952 bool EnableAllWatchpoints(bool end_to_end = true);
953
955
957
958 bool IgnoreAllWatchpoints(uint32_t ignore_count);
959
961
963
965
966 bool IgnoreWatchpointByID(lldb::watch_id_t watch_id, uint32_t ignore_count);
967
969 const BreakpointIDList &bp_ids,
970 bool append);
971
973 BreakpointIDList &new_bps);
974
976 std::vector<std::string> &names,
977 BreakpointIDList &new_bps);
978
979 /// Get \a load_addr as a callable code load address for this target
980 ///
981 /// Take \a load_addr and potentially add any address bits that are
982 /// needed to make the address callable. For ARM this can set bit
983 /// zero (if it already isn't) if \a load_addr is a thumb function.
984 /// If \a addr_class is set to AddressClass::eInvalid, then the address
985 /// adjustment will always happen. If it is set to an address class
986 /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
987 /// returned.
989 lldb::addr_t load_addr,
990 AddressClass addr_class = AddressClass::eInvalid) const;
991
992 /// Get \a load_addr as an opcode for this target.
993 ///
994 /// Take \a load_addr and potentially strip any address bits that are
995 /// needed to make the address point to an opcode. For ARM this can
996 /// clear bit zero (if it already isn't) if \a load_addr is a
997 /// thumb function and load_addr is in code.
998 /// If \a addr_class is set to AddressClass::eInvalid, then the address
999 /// adjustment will always happen. If it is set to an address class
1000 /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
1001 /// returned.
1004 AddressClass addr_class = AddressClass::eInvalid) const;
1005
1006 // Get load_addr as breakable load address for this target. Take a addr and
1007 // check if for any reason there is a better address than this to put a
1008 // breakpoint on. If there is then return that address. For MIPS, if
1009 // instruction at addr is a delay slot instruction then this method will find
1010 // the address of its previous instruction and return that address.
1012
1013 /// This call may preload module symbols, and may do so in parallel depending
1014 /// on the following target settings:
1015 /// - TargetProperties::GetPreloadSymbols()
1016 /// - TargetProperties::GetParallelModuleLoad()
1017 ///
1018 /// Warning: if preloading is active and this is called in parallel with
1019 /// Target::GetOrCreateModule, this may result in a ABBA deadlock situation.
1020 void ModulesDidLoad(ModuleList &module_list);
1021
1022 void ModulesDidUnload(ModuleList &module_list, bool delete_locations);
1023
1024 void SymbolsDidLoad(ModuleList &module_list);
1025
1026 void ClearModules(bool delete_locations);
1027
1028 /// Called as the last function in Process::DidExec().
1029 ///
1030 /// Process::DidExec() will clear a lot of state in the process,
1031 /// then try to reload a dynamic loader plugin to discover what
1032 /// binaries are currently available and then this function should
1033 /// be called to allow the target to do any cleanup after everything
1034 /// has been figured out. It can remove breakpoints that no longer
1035 /// make sense as the exec might have changed the target
1036 /// architecture, and unloaded some modules that might get deleted.
1037 void DidExec();
1038
1039 /// Gets the module for the main executable.
1040 ///
1041 /// Each process has a notion of a main executable that is the file
1042 /// that will be executed or attached to. Executable files can have
1043 /// dependent modules that are discovered from the object files, or
1044 /// discovered at runtime as things are dynamically loaded.
1045 ///
1046 /// \return
1047 /// The shared pointer to the executable module which can
1048 /// contains a nullptr Module object if no executable has been
1049 /// set.
1050 ///
1051 /// \see DynamicLoader
1052 /// \see ObjectFile::GetDependentModules (FileSpecList&)
1053 /// \see Process::SetExecutableModule(lldb::ModuleSP&)
1055
1057
1058 /// Set the main executable module.
1059 ///
1060 /// Each process has a notion of a main executable that is the file
1061 /// that will be executed or attached to. Executable files can have
1062 /// dependent modules that are discovered from the object files, or
1063 /// discovered at runtime as things are dynamically loaded.
1064 ///
1065 /// Setting the executable causes any of the current dependent
1066 /// image information to be cleared and replaced with the static
1067 /// dependent image information found by calling
1068 /// ObjectFile::GetDependentModules (FileSpecList&) on the main
1069 /// executable and any modules on which it depends. Calling
1070 /// Process::GetImages() will return the newly found images that
1071 /// were obtained from all of the object files.
1072 ///
1073 /// \param[in] module_sp
1074 /// A shared pointer reference to the module that will become
1075 /// the main executable for this process.
1076 ///
1077 /// \param[in] load_dependent_files
1078 /// If \b true then ask the object files to track down any
1079 /// known dependent files.
1080 ///
1081 /// \see ObjectFile::GetDependentModules (FileSpecList&)
1082 /// \see Process::GetImages()
1084 lldb::ModuleSP &module_sp,
1085 LoadDependentFiles load_dependent_files = eLoadDependentsDefault);
1086
1087 bool LoadScriptingResources(std::list<Status> &errors,
1088 Stream &feedback_stream,
1089 bool continue_on_error = true) {
1090 return m_images.LoadScriptingResourcesInTarget(
1091 this, errors, feedback_stream, continue_on_error);
1092 }
1093
1094 /// Get accessor for the images for this process.
1095 ///
1096 /// Each process has a notion of a main executable that is the file
1097 /// that will be executed or attached to. Executable files can have
1098 /// dependent modules that are discovered from the object files, or
1099 /// discovered at runtime as things are dynamically loaded. After
1100 /// a main executable has been set, the images will contain a list
1101 /// of all the files that the executable depends upon as far as the
1102 /// object files know. These images will usually contain valid file
1103 /// virtual addresses only. When the process is launched or attached
1104 /// to, the DynamicLoader plug-in will discover where these images
1105 /// were loaded in memory and will resolve the load virtual
1106 /// addresses is each image, and also in images that are loaded by
1107 /// code.
1108 ///
1109 /// \return
1110 /// A list of Module objects in a module list.
1111 const ModuleList &GetImages() const { return m_images; }
1112
1114
1115 /// Return whether this FileSpec corresponds to a module that should be
1116 /// considered for general searches.
1117 ///
1118 /// This API will be consulted by the SearchFilterForUnconstrainedSearches
1119 /// and any module that returns \b true will not be searched. Note the
1120 /// SearchFilterForUnconstrainedSearches is the search filter that
1121 /// gets used in the CreateBreakpoint calls when no modules is provided.
1122 ///
1123 /// The target call at present just consults the Platform's call of the
1124 /// same name.
1125 ///
1126 /// \param[in] module_spec
1127 /// Path to the module.
1128 ///
1129 /// \return \b true if the module should be excluded, \b false otherwise.
1130 bool ModuleIsExcludedForUnconstrainedSearches(const FileSpec &module_spec);
1131
1132 /// Return whether this module should be considered for general searches.
1133 ///
1134 /// This API will be consulted by the SearchFilterForUnconstrainedSearches
1135 /// and any module that returns \b true will not be searched. Note the
1136 /// SearchFilterForUnconstrainedSearches is the search filter that
1137 /// gets used in the CreateBreakpoint calls when no modules is provided.
1138 ///
1139 /// The target call at present just consults the Platform's call of the
1140 /// same name.
1141 ///
1142 /// FIXME: When we get time we should add a way for the user to set modules
1143 /// that they
1144 /// don't want searched, in addition to or instead of the platform ones.
1145 ///
1146 /// \param[in] module_sp
1147 /// A shared pointer reference to the module that checked.
1148 ///
1149 /// \return \b true if the module should be excluded, \b false otherwise.
1150 bool
1152
1153 const ArchSpec &GetArchitecture() const { return m_arch.GetSpec(); }
1154
1155 /// Returns the name of the target's ABI plugin.
1156 llvm::StringRef GetABIName() const;
1157
1158 /// Set the architecture for this target.
1159 ///
1160 /// If the current target has no Images read in, then this just sets the
1161 /// architecture, which will be used to select the architecture of the
1162 /// ExecutableModule when that is set. If the current target has an
1163 /// ExecutableModule, then calling SetArchitecture with a different
1164 /// architecture from the currently selected one will reset the
1165 /// ExecutableModule to that slice of the file backing the ExecutableModule.
1166 /// If the file backing the ExecutableModule does not contain a fork of this
1167 /// architecture, then this code will return false, and the architecture
1168 /// won't be changed. If the input arch_spec is the same as the already set
1169 /// architecture, this is a no-op.
1170 ///
1171 /// \param[in] arch_spec
1172 /// The new architecture.
1173 ///
1174 /// \param[in] set_platform
1175 /// If \b true, then the platform will be adjusted if the currently
1176 /// selected platform is not compatible with the architecture being set.
1177 /// If \b false, then just the architecture will be set even if the
1178 /// currently selected platform isn't compatible (in case it might be
1179 /// manually set following this function call).
1180 ///
1181 /// \param[in] merged
1182 /// If true, arch_spec is merged with the current
1183 /// architecture. Otherwise it's replaced.
1184 ///
1185 /// \return
1186 /// \b true if the architecture was successfully set, \b false otherwise.
1187 bool SetArchitecture(const ArchSpec &arch_spec, bool set_platform = false,
1188 bool merge = true);
1189
1190 bool MergeArchitecture(const ArchSpec &arch_spec);
1191
1192 Architecture *GetArchitecturePlugin() const { return m_arch.GetPlugin(); }
1193
1194 Debugger &GetDebugger() const { return m_debugger; }
1195
1196 size_t ReadMemoryFromFileCache(const Address &addr, void *dst, size_t dst_len,
1197 Status &error);
1198
1199 // Reading memory through the target allows us to skip going to the process
1200 // for reading memory if possible and it allows us to try and read from any
1201 // constant sections in our object files on disk. If you always want live
1202 // program memory, read straight from the process. If you possibly want to
1203 // read from const sections in object files, read from the target. This
1204 // version of ReadMemory will try and read memory from the process if the
1205 // process is alive. The order is:
1206 // 1 - if (force_live_memory == false) and the address falls in a read-only
1207 // section, then read from the file cache
1208 // 2 - if there is a process, then read from memory
1209 // 3 - if there is no process, then read from the file cache
1210 //
1211 // If did_read_live_memory is provided, will indicate if the read was from
1212 // live memory, or from file contents. A caller which needs to treat these two
1213 // sources differently should use this argument to disambiguate where the data
1214 // was read from.
1215 //
1216 // The method is virtual for mocking in the unit tests.
1217 virtual size_t ReadMemory(const Address &addr, void *dst, size_t dst_len,
1218 Status &error, bool force_live_memory = false,
1219 lldb::addr_t *load_addr_ptr = nullptr,
1220 bool *did_read_live_memory = nullptr);
1221
1222 size_t ReadCStringFromMemory(const Address &addr, std::string &out_str,
1223 Status &error, bool force_live_memory = false);
1224
1225 size_t ReadCStringFromMemory(const Address &addr, char *dst,
1226 size_t dst_max_len, Status &result_error,
1227 bool force_live_memory = false);
1228
1229 /// Read a NULL terminated string from memory
1230 ///
1231 /// This function will read a cache page at a time until a NULL string
1232 /// terminator is found. It will stop reading if an aligned sequence of NULL
1233 /// termination \a type_width bytes is not found before reading \a
1234 /// cstr_max_len bytes. The results are always guaranteed to be NULL
1235 /// terminated, and that no more than (max_bytes - type_width) bytes will be
1236 /// read.
1237 ///
1238 /// \param[in] addr
1239 /// The address to start the memory read.
1240 ///
1241 /// \param[in] dst
1242 /// A character buffer containing at least max_bytes.
1243 ///
1244 /// \param[in] max_bytes
1245 /// The maximum number of bytes to read.
1246 ///
1247 /// \param[in] error
1248 /// The error status of the read operation.
1249 ///
1250 /// \param[in] type_width
1251 /// The size of the null terminator (1 to 4 bytes per
1252 /// character). Defaults to 1.
1253 ///
1254 /// \return
1255 /// The error status or the number of bytes prior to the null terminator.
1256 size_t ReadStringFromMemory(const Address &addr, char *dst, size_t max_bytes,
1257 Status &error, size_t type_width,
1258 bool force_live_memory = true);
1259
1260 size_t ReadScalarIntegerFromMemory(const Address &addr, uint32_t byte_size,
1261 bool is_signed, Scalar &scalar,
1262 Status &error,
1263 bool force_live_memory = false);
1264
1265 int64_t ReadSignedIntegerFromMemory(const Address &addr,
1266 size_t integer_byte_size,
1267 int64_t fail_value, Status &error,
1268 bool force_live_memory = false);
1269
1270 uint64_t ReadUnsignedIntegerFromMemory(const Address &addr,
1271 size_t integer_byte_size,
1272 uint64_t fail_value, Status &error,
1273 bool force_live_memory = false);
1274
1275 bool ReadPointerFromMemory(const Address &addr, Status &error,
1276 Address &pointer_addr,
1277 bool force_live_memory = false);
1278
1279 bool HasLoadedSections();
1280
1282
1283 void ClearSectionLoadList();
1284
1285 void DumpSectionLoadList(Stream &s);
1286
1287 static Target *GetTargetFromContexts(const ExecutionContext *exe_ctx_ptr,
1288 const SymbolContext *sc_ptr);
1289
1290 // lldb::ExecutionContextScope pure virtual functions
1292
1294
1296
1298
1299 void CalculateExecutionContext(ExecutionContext &exe_ctx) override;
1300
1302
1303 llvm::Expected<lldb::TypeSystemSP>
1305 bool create_on_demand = true);
1306
1307 std::vector<lldb::TypeSystemSP>
1308 GetScratchTypeSystems(bool create_on_demand = true);
1309
1312
1313 // Creates a UserExpression for the given language, the rest of the
1314 // parameters have the same meaning as for the UserExpression constructor.
1315 // Returns a new-ed object which the caller owns.
1316
1318 GetUserExpressionForLanguage(llvm::StringRef expr, llvm::StringRef prefix,
1319 SourceLanguage language,
1320 Expression::ResultType desired_type,
1321 const EvaluateExpressionOptions &options,
1322 ValueObject *ctx_obj, Status &error);
1323
1324 // Creates a FunctionCaller for the given language, the rest of the
1325 // parameters have the same meaning as for the FunctionCaller constructor.
1326 // Since a FunctionCaller can't be
1327 // IR Interpreted, it makes no sense to call this with an
1328 // ExecutionContextScope that lacks
1329 // a Process.
1330 // Returns a new-ed object which the caller owns.
1331
1333 const CompilerType &return_type,
1334 const Address &function_address,
1335 const ValueList &arg_value_list,
1336 const char *name, Status &error);
1337
1338 /// Creates and installs a UtilityFunction for the given language.
1339 llvm::Expected<std::unique_ptr<UtilityFunction>>
1340 CreateUtilityFunction(std::string expression, std::string name,
1341 lldb::LanguageType language, ExecutionContext &exe_ctx);
1342
1343 // Install any files through the platform that need be to installed prior to
1344 // launching or attaching.
1345 Status Install(ProcessLaunchInfo *launch_info);
1346
1347 bool ResolveFileAddress(lldb::addr_t load_addr, Address &so_addr);
1348
1349 bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr,
1350 uint32_t stop_id = SectionLoadHistory::eStopIDNow,
1351 bool allow_section_end = false);
1352
1353 bool SetSectionLoadAddress(const lldb::SectionSP &section,
1354 lldb::addr_t load_addr,
1355 bool warn_multiple = false);
1356
1357 size_t UnloadModuleSections(const lldb::ModuleSP &module_sp);
1358
1359 size_t UnloadModuleSections(const ModuleList &module_list);
1360
1361 bool SetSectionUnloaded(const lldb::SectionSP &section_sp);
1362
1363 bool SetSectionUnloaded(const lldb::SectionSP &section_sp,
1364 lldb::addr_t load_addr);
1365
1367
1369 lldb_private::TypeSummaryImpl &summary_provider);
1371
1372 /// Set the \a Trace object containing processor trace information of this
1373 /// target.
1374 ///
1375 /// \param[in] trace_sp
1376 /// The trace object.
1377 void SetTrace(const lldb::TraceSP &trace_sp);
1378
1379 /// Get the \a Trace object containing processor trace information of this
1380 /// target.
1381 ///
1382 /// \return
1383 /// The trace object. It might be undefined.
1385
1386 /// Create a \a Trace object for the current target using the using the
1387 /// default supported tracing technology for this process.
1388 ///
1389 /// \return
1390 /// The new \a Trace or an \a llvm::Error if a \a Trace already exists or
1391 /// the trace couldn't be created.
1392 llvm::Expected<lldb::TraceSP> CreateTrace();
1393
1394 /// If a \a Trace object is present, this returns it, otherwise a new Trace is
1395 /// created with \a Trace::CreateTrace.
1396 llvm::Expected<lldb::TraceSP> GetTraceOrCreate();
1397
1398 // Since expressions results can persist beyond the lifetime of a process,
1399 // and the const expression results are available after a process is gone, we
1400 // provide a way for expressions to be evaluated from the Target itself. If
1401 // an expression is going to be run, then it should have a frame filled in in
1402 // the execution context.
1404 llvm::StringRef expression, ExecutionContextScope *exe_scope,
1405 lldb::ValueObjectSP &result_valobj_sp,
1407 std::string *fixed_expression = nullptr, ValueObject *ctx_obj = nullptr);
1408
1410
1412
1413 /// This method will return the address of the starting function for
1414 /// this binary, e.g. main() or its equivalent. This can be used as
1415 /// an address of a function that is not called once a binary has
1416 /// started running - e.g. as a return address for inferior function
1417 /// calls that are unambiguous completion of the function call, not
1418 /// called during the course of the inferior function code running.
1419 ///
1420 /// If no entry point can be found, an invalid address is returned.
1421 ///
1422 /// \param [out] err
1423 /// This object will be set to failure if no entry address could
1424 /// be found, and may contain a helpful error message.
1425 //
1426 /// \return
1427 /// Returns the entry address for this program, or an error
1428 /// if none can be found.
1429 llvm::Expected<lldb_private::Address> GetEntryPointAddress();
1430
1431 CompilerType GetRegisterType(const std::string &name,
1432 const lldb_private::RegisterFlags &flags,
1433 uint32_t byte_size);
1434
1435 /// Sends a breakpoint notification event.
1437 lldb::BreakpointEventType event_kind);
1438 /// Sends a breakpoint notification event.
1440 const lldb::EventDataSP &breakpoint_data_sp);
1441
1442 llvm::Expected<lldb::DisassemblerSP>
1443 ReadInstructions(const Address &start_addr, uint32_t count,
1444 const char *flavor_string = nullptr);
1445
1446 // Target Stop Hooks
1447 class StopHook : public UserID {
1448 public:
1449 StopHook(const StopHook &rhs);
1450 virtual ~StopHook() = default;
1451
1452 enum class StopHookKind : uint32_t {
1456 };
1463
1465
1466 // Set the specifier. The stop hook will own the specifier, and is
1467 // responsible for deleting it when we're done.
1468 void SetSpecifier(SymbolContextSpecifier *specifier);
1469
1471
1472 bool ExecutionContextPasses(const ExecutionContext &exe_ctx);
1473
1474 // Called on stop, this gets passed the ExecutionContext for each "stop
1475 // with a reason" thread. It should add to the stream whatever text it
1476 // wants to show the user, and return False to indicate it wants the target
1477 // not to stop.
1479 lldb::StreamSP output) = 0;
1480
1481 // Set the Thread Specifier. The stop hook will own the thread specifier,
1482 // and is responsible for deleting it when we're done.
1483 void SetThreadSpecifier(ThreadSpec *specifier);
1484
1486
1487 bool IsActive() { return m_active; }
1488
1489 void SetIsActive(bool is_active) { m_active = is_active; }
1490
1491 void SetAutoContinue(bool auto_continue) {
1492 m_auto_continue = auto_continue;
1493 }
1494
1495 bool GetAutoContinue() const { return m_auto_continue; }
1496
1497 void SetRunAtInitialStop(bool at_initial_stop) {
1498 m_at_initial_stop = at_initial_stop;
1499 }
1500
1502
1503 void SetSuppressOutput(bool suppress_output) {
1504 m_suppress_output = suppress_output;
1505 }
1506
1507 bool GetSuppressOutput() const { return m_suppress_output; }
1508
1509 void GetDescription(Stream &s, lldb::DescriptionLevel level) const;
1511 lldb::DescriptionLevel level) const = 0;
1512
1513 protected:
1516 std::unique_ptr<ThreadSpec> m_thread_spec_up;
1517 bool m_active = true;
1518 bool m_auto_continue = false;
1520 bool m_suppress_output = false;
1521
1522 StopHook(lldb::TargetSP target_sp, lldb::user_id_t uid);
1523 };
1524
1526 public:
1527 ~StopHookCommandLine() override = default;
1528
1530 void SetActionFromString(const std::string &strings);
1531 void SetActionFromStrings(const std::vector<std::string> &strings);
1532
1534 lldb::StreamSP output_sp) override;
1536 lldb::DescriptionLevel level) const override;
1537
1538 private:
1540 // Use CreateStopHook to make a new empty stop hook. Use SetActionFromString
1541 // to fill it with commands, and SetSpecifier to set the specifier shared
1542 // pointer (can be null, that will match anything.)
1544 : StopHook(target_sp, uid) {}
1545 friend class Target;
1546 };
1547
1549 public:
1550 ~StopHookScripted() override = default;
1552 lldb::StreamSP output) override;
1553
1554 Status SetScriptCallback(std::string class_name,
1555 StructuredData::ObjectSP extra_args_sp);
1556
1558 lldb::DescriptionLevel level) const override;
1559
1560 private:
1561 std::string m_class_name;
1562 /// This holds the dictionary of keys & values that can be used to
1563 /// parametrize any given callback's behavior.
1566
1567 /// Use CreateStopHook to make a new empty stop hook. Use SetScriptCallback
1568 /// to set the script to execute, and SetSpecifier to set the specifier
1569 /// shared pointer (can be null, that will match anything.)
1571 : StopHook(target_sp, uid) {}
1572 friend class Target;
1573 };
1574
1575 class StopHookCoded : public StopHook {
1576 public:
1577 ~StopHookCoded() override = default;
1578
1580 lldb::StreamSP output);
1581
1582 void SetCallback(llvm::StringRef name, HandleStopCallback *callback) {
1583 m_name = name;
1584 m_callback = callback;
1585 }
1586
1588 lldb::StreamSP output) override {
1589 return m_callback(exc_ctx, output);
1590 }
1591
1593 lldb::DescriptionLevel level) const override {
1594 s.Indent();
1595 s.Printf("%s (built-in)\n", m_name.c_str());
1596 }
1597
1598 private:
1599 std::string m_name;
1601
1602 /// Use CreateStopHook to make a new empty stop hook. Use SetCallback to set
1603 /// the callback to execute, and SetSpecifier to set the specifier shared
1604 /// pointer (can be null, that will match anything.)
1606 : StopHook(target_sp, uid) {}
1607 friend class Target;
1608 };
1609
1611
1612 typedef std::shared_ptr<StopHook> StopHookSP;
1613
1614 /// Add an empty stop hook to the Target's stop hook list, and returns a
1615 /// shared pointer to the new hook.
1616 StopHookSP CreateStopHook(StopHook::StopHookKind kind, bool internal = false);
1617
1618 /// If you tried to create a stop hook, and that failed, call this to
1619 /// remove the stop hook, as it will also reset the stop hook counter.
1621
1622 // Runs the stop hooks that have been registered for this target.
1623 // Returns true if the stop hooks cause the target to resume.
1624 // Pass at_initial_stop if this is the stop where lldb gains
1625 // control over the process for the first time.
1626 bool RunStopHooks(bool at_initial_stop = false);
1627
1628 bool SetSuppresStopHooks(bool suppress) {
1629 bool old_value = m_suppress_stop_hooks;
1630 m_suppress_stop_hooks = suppress;
1631 return old_value;
1632 }
1633
1635
1637
1638 void RemoveAllStopHooks();
1639
1640 StopHookSP GetStopHookByID(lldb::user_id_t uid);
1641
1642 bool SetStopHookActiveStateByID(lldb::user_id_t uid, bool active_state);
1643
1644 void SetAllStopHooksActiveState(bool active_state);
1645
1646 const std::vector<StopHookSP> GetStopHooks(bool internal = false) const;
1647
1649
1650 void SetPlatform(const lldb::PlatformSP &platform_sp) {
1651 m_platform_sp = platform_sp;
1652 }
1653
1655
1656 // Methods.
1658 GetSearchFilterForModule(const FileSpec *containingModule);
1659
1661 GetSearchFilterForModuleList(const FileSpecList *containingModuleList);
1662
1664 GetSearchFilterForModuleAndCUList(const FileSpecList *containingModules,
1665 const FileSpecList *containingSourceFiles);
1666
1668 const char *repl_options, bool can_create);
1669
1670 void SetREPL(lldb::LanguageType language, lldb::REPLSP repl_sp);
1671
1675
1677
1678 /// Add a signal for the target. This will get copied over to the process
1679 /// if the signal exists on that target. Only the values with Yes and No are
1680 /// set, Calculate values will be ignored.
1681protected:
1690 using DummySignalElement = llvm::StringMapEntry<DummySignalValues>;
1691 static bool UpdateSignalFromDummy(lldb::UnixSignalsSP signals_sp,
1692 const DummySignalElement &element);
1693 static bool ResetSignalFromDummy(lldb::UnixSignalsSP signals_sp,
1694 const DummySignalElement &element);
1695
1696public:
1697 /// Add a signal to the Target's list of stored signals/actions. These
1698 /// values will get copied into any processes launched from
1699 /// this target.
1700 void AddDummySignal(llvm::StringRef name, LazyBool pass, LazyBool print,
1701 LazyBool stop);
1702 /// Updates the signals in signals_sp using the stored dummy signals.
1703 /// If warning_stream_sp is not null, if any stored signals are not found in
1704 /// the current process, a warning will be emitted here.
1706 lldb::StreamSP warning_stream_sp);
1707 /// Clear the dummy signals in signal_names from the target, or all signals
1708 /// if signal_names is empty. Also remove the behaviors they set from the
1709 /// process's signals if it exists.
1710 void ClearDummySignals(Args &signal_names);
1711 /// Print all the signals set in this target.
1712 void PrintDummySignals(Stream &strm, Args &signals);
1713
1714protected:
1715 /// Implementing of ModuleList::Notifier.
1716
1717 void NotifyModuleAdded(const ModuleList &module_list,
1718 const lldb::ModuleSP &module_sp) override;
1719
1720 void NotifyModuleRemoved(const ModuleList &module_list,
1721 const lldb::ModuleSP &module_sp) override;
1722
1723 void NotifyModuleUpdated(const ModuleList &module_list,
1724 const lldb::ModuleSP &old_module_sp,
1725 const lldb::ModuleSP &new_module_sp) override;
1726
1727 void NotifyWillClearList(const ModuleList &module_list) override;
1728
1729 void NotifyModulesRemoved(lldb_private::ModuleList &module_list) override;
1730
1731 class Arch {
1732 public:
1733 explicit Arch(const ArchSpec &spec);
1734 const Arch &operator=(const ArchSpec &spec);
1735
1736 const ArchSpec &GetSpec() const { return m_spec; }
1737 Architecture *GetPlugin() const { return m_plugin_up.get(); }
1738
1739 private:
1741 std::unique_ptr<Architecture> m_plugin_up;
1742 };
1743
1744 // Member variables.
1746 lldb::PlatformSP m_platform_sp; ///< The platform for this target.
1747 std::recursive_mutex m_mutex; ///< An API mutex that is used by the lldb::SB*
1748 /// classes make the SB interface thread safe
1749 /// When the private state thread calls SB API's - usually because it is
1750 /// running OS plugin or Python ThreadPlan code - it should not block on the
1751 /// API mutex that is held by the code that kicked off the sequence of events
1752 /// that led us to run the code. We hand out this mutex instead when we
1753 /// detect that code is running on the private state thread.
1754 std::recursive_mutex m_private_mutex;
1756 std::string m_label;
1757 ModuleList m_images; ///< The list of images for this process (shared
1758 /// libraries and anything dynamically loaded).
1764 std::map<ConstString, std::unique_ptr<BreakpointName>>;
1766
1770 // We want to tightly control the process destruction process so we can
1771 // correctly tear down everything that we need to, so the only class that
1772 // knows about the process lifespan is this target class.
1777
1778 /// Map of scripted frame provider descriptors for this target.
1779 /// Keys are the provider descriptors ids, values are the descriptors.
1780 /// Used to initialize frame providers for new threads.
1781 llvm::DenseMap<uint32_t, ScriptedFrameProviderDescriptor>
1783 mutable std::recursive_mutex m_frame_provider_descriptors_mutex;
1784
1785 typedef std::map<lldb::LanguageType, lldb::REPLSP> REPLMap;
1787
1789
1790 typedef std::map<lldb::user_id_t, StopHookSP> StopHookCollection;
1793 std::vector<StopHookSP> m_internal_stop_hooks;
1794 uint32_t m_latest_stop_hook_id; /// This records the last natural stop at
1795 /// which we ran a stop-hook.
1797 bool m_suppress_stop_hooks; /// Used to not run stop hooks for expressions
1801 LLDB_INVALID_GLOBALLY_UNIQUE_TARGET_ID; ///< The globally unique ID
1802 /// assigned to this target
1803 std::string m_target_session_name; ///< The target session name for this
1804 /// target, used to name debugging
1805 /// sessions in DAP.
1806 /// An optional \a lldb_private::Trace object containing processor trace
1807 /// information of this target.
1809 /// Stores the frame recognizers of this target.
1811 /// These are used to set the signal state when you don't have a process and
1812 /// more usefully in the Dummy target where you can't know exactly what
1813 /// signals you will have.
1814 llvm::StringMap<DummySignalValues> m_dummy_signals;
1815
1816 static void ImageSearchPathsChanged(const PathMappingList &path_list,
1817 void *baton);
1818
1819 // Utilities for `statistics` command.
1820private:
1821 // Target metrics storage.
1823
1824public:
1825 /// Get metrics associated with this target in JSON format.
1826 ///
1827 /// Target metrics help measure timings and information that is contained in
1828 /// a target. These are designed to help measure performance of a debug
1829 /// session as well as represent the current state of the target, like
1830 /// information on the currently modules, currently set breakpoints and more.
1831 ///
1832 /// \return
1833 /// Returns a JSON value that contains all target metrics.
1834 llvm::json::Value
1836
1837 void ResetStatistics();
1838
1840
1841protected:
1842 /// Construct with optional file and arch.
1843 ///
1844 /// This member is private. Clients must use
1845 /// TargetList::CreateTarget(const FileSpec*, const ArchSpec*)
1846 /// so all targets can be tracked from the central target list.
1847 ///
1848 /// \see TargetList::CreateTarget(const FileSpec*, const ArchSpec*)
1849 Target(Debugger &debugger, const ArchSpec &target_arch,
1850 const lldb::PlatformSP &platform_sp, bool is_dummy_target);
1851
1852 // Helper function.
1853 bool ProcessIsValid();
1854
1855 // Copy breakpoints, stop hooks and so forth from the dummy target:
1856 void PrimeFromDummyTarget(Target &target);
1857
1858 void AddBreakpoint(lldb::BreakpointSP breakpoint_sp, bool internal);
1859
1861
1862 /// Return a recommended size for memory reads at \a addr, optimizing for
1863 /// cache usage.
1865
1866 Target(const Target &) = delete;
1867 const Target &operator=(const Target &) = delete;
1868
1870 return m_section_load_history.GetCurrentSectionLoadList();
1871 }
1872};
1873
1874} // namespace lldb_private
1875
1876#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:31
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:80
void SetPreferredSymbolContexts(SymbolContextList contexts)
Definition Target.h:340
void SetOneThreadTimeout(const Timeout< std::micro > &timeout)
Definition Target.h:399
void SetUnwindOnError(bool unwind=false)
Definition Target.h:372
SourceLanguage GetLanguage() const
Definition Target.h:334
const char * GetPoundLineFilePath() const
Definition Target.h:458
lldb::DynamicValueType m_use_dynamic
Definition Target.h:506
void SetExecutionPolicy(ExecutionPolicy policy=eExecutionPolicyAlways)
Definition Target.h:330
Timeout< std::micro > m_one_thread_timeout
Definition Target.h:508
bool InvokeCancelCallback(lldb::ExpressionEvaluationPhase phase) const
Definition Target.h:440
lldb::DynamicValueType GetUseDynamic() const
Definition Target.h:384
void SetKeepInMemory(bool keep=true)
Definition Target.h:382
void SetCoerceToId(bool coerce=true)
Definition Target.h:368
void SetLanguage(lldb::LanguageType language_type)
Definition Target.h:336
ExecutionPolicy GetExecutionPolicy() const
Definition Target.h:328
Timeout< std::micro > m_timeout
Definition Target.h:507
void SetPrefix(const char *prefix)
Definition Target.h:361
void SetTryAllThreads(bool try_others=true)
Definition Target.h:405
static constexpr std::chrono::milliseconds default_timeout
Definition Target.h:318
void SetPoundLine(const char *path, uint32_t line) const
Definition Target.h:448
void SetRetriesWithFixIts(uint64_t number_of_retries)
Definition Target.h:474
SymbolContextList m_preferred_lookup_contexts
During expression evaluation, any SymbolContext in this list will be used for symbol/function lookup ...
Definition Target.h:520
void SetTimeout(const Timeout< std::micro > &timeout)
Definition Target.h:393
static constexpr ExecutionPolicy default_execution_policy
Definition Target.h:323
void SetStopOthers(bool stop_others=true)
Definition Target.h:409
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:504
void SetCancelCallback(lldb::ExpressionCancelCallback callback, void *baton)
Definition Target.h:435
const Timeout< std::micro > & GetTimeout() const
Definition Target.h:391
const SymbolContextList & GetPreferredSymbolContexts() const
Definition Target.h:344
void SetIgnoreBreakpoints(bool ignore=false)
Definition Target.h:376
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:351
void SetUseDynamic(lldb::DynamicValueType dynamic=lldb::eDynamicCanRunTarget)
Definition Target.h:387
lldb::ExpressionCancelCallback m_cancel_callback
Definition Target.h:509
const Timeout< std::micro > & GetOneThreadTimeout() const
Definition Target.h:395
"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:104
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:157
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition Stream.cpp:134
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:4966
FileSpecList GetDebugFileSearchPaths()
Definition Target.cpp:4847
llvm::StringRef GetLaunchWorkingDirectory() const
Definition Target.cpp:4653
bool GetDisplayRecognizedArguments() const
Definition Target.cpp:5124
ImportStdModule GetImportStdModule() const
Definition Target.cpp:4863
void AppendExecutableSearchPaths(const FileSpec &)
Definition Target.cpp:4834
bool GetEnableSyntheticValue() const
Definition Target.cpp:4933
void SetStandardInputPath(const char *path)=delete
ProcessLaunchInfo m_launch_info
Definition Target.h:303
uint64_t GetExprAllocAlign() const
Definition Target.cpp:5045
MemoryModuleLoadLevel GetMemoryModuleLoadLevel() const
Definition Target.cpp:5096
llvm::StringRef GetArg0() const
Definition Target.cpp:4706
uint32_t GetMaximumMemReadSize() const
Definition Target.cpp:4972
void SetRunArguments(const Args &args)
Definition Target.cpp:4723
FileSpec GetStandardErrorPath() const
Definition Target.cpp:4998
bool GetEnableNotifyAboutFixIts() const
Definition Target.cpp:4889
bool SetPreferDynamicValue(lldb::DynamicValueType d)
Definition Target.cpp:4590
void SetDisplayRecognizedArguments(bool b)
Definition Target.cpp:5130
std::optional< bool > GetExperimentalPropertyValue(size_t prop_idx, ExecutionContext *exe_ctx=nullptr) const
Definition Target.cpp:4529
const ProcessLaunchInfo & GetProcessLaunchInfo() const
Definition Target.cpp:5135
Environment ComputeEnvironment() const
Definition Target.cpp:4729
void SetStandardOutputPath(const char *path)=delete
bool GetUserSpecifiedTrapHandlerNames(Args &args) const
Definition Target.cpp:5103
uint64_t GetExprErrorLimit() const
Definition Target.cpp:5027
bool GetEnableAutoImportClangModules() const
Definition Target.cpp:4857
bool GetDebugUtilityExpression() const
Definition Target.cpp:5241
DynamicClassInfoHelper GetDynamicClassInfoHelper() const
Definition Target.cpp:4870
FileSpec GetStandardOutputPath() const
Definition Target.cpp:4988
void SetDisplayRuntimeSupportValues(bool b)
Definition Target.cpp:5119
uint32_t GetMaximumNumberOfChildrenToDisplay() const
Definition Target.cpp:4951
void SetRequireHardwareBreakpoints(bool b)
Definition Target.cpp:5173
bool GetAutoInstallMainExecutable() const
Definition Target.cpp:5178
const char * GetDisassemblyFeatures() const
Definition Target.cpp:4685
RealpathPrefixes GetSourceRealpathPrefixes() const
Definition Target.cpp:4701
uint64_t GetNumberOfRetriesWithFixits() const
Definition Target.cpp:4883
uint64_t GetExprAllocSize() const
Definition Target.cpp:5039
llvm::StringRef GetExpressionPrefixContents()
Definition Target.cpp:5013
PathMappingList & GetObjectPathMap() const
Definition Target.cpp:4820
const char * GetDisassemblyFlavor() const
Definition Target.cpp:4665
FileSpec GetStandardInputPath() const
Definition Target.cpp:4978
lldb::DynamicValueType GetPreferDynamicValue() const
Definition Target.cpp:4583
InlineStrategy GetInlineStrategy() const
Definition Target.cpp:4692
Environment GetTargetEnvironment() const
Definition Target.cpp:4789
bool GetDisplayRuntimeSupportValues() const
Definition Target.cpp:5113
void SetUserSpecifiedTrapHandlerNames(const Args &args)
Definition Target.cpp:5108
uint32_t GetMaxZeroPaddingInFloatFormat() const
Definition Target.cpp:4945
uint64_t GetExprAllocAddress() const
Definition Target.cpp:5033
LoadCWDlldbinitFile GetLoadCWDlldbinitFile() const
Definition Target.cpp:5082
Environment GetInheritedEnvironment() const
Definition Target.cpp:4761
void SetArg0(llvm::StringRef arg)
Definition Target.cpp:4712
bool GetInjectLocalVariables(ExecutionContext *exe_ctx) const
Definition Target.cpp:4540
void SetStandardErrorPath(const char *path)=delete
bool ShowHexVariableValuesWithLeadingZeroes() const
Definition Target.cpp:4939
SourceLanguage GetLanguage() const
Definition Target.cpp:5008
Environment GetEnvironment() const
Definition Target.cpp:4757
void SetProcessLaunchInfo(const ProcessLaunchInfo &launch_info)
Definition Target.cpp:5139
FileSpec GetSaveJITObjectsDir() const
Definition Target.cpp:4895
void SetEnvironment(Environment env)
Definition Target.cpp:4800
LoadScriptFromSymFile GetLoadScriptFromSymbolFile() const
Definition Target.cpp:5075
const char * GetDisassemblyCPU() const
Definition Target.cpp:4678
void SetStandardErrorPath(llvm::StringRef path)
Definition Target.cpp:5003
bool GetRunArguments(Args &args) const
Definition Target.cpp:4718
FileSpecList GetExecutableSearchPaths()
Definition Target.cpp:4842
ArchSpec GetDefaultArchitecture() const
Definition Target.cpp:4567
Disassembler::HexImmediateStyle GetHexImmediateStyle() const
Definition Target.cpp:5089
void SetUseDIL(ExecutionContext *exe_ctx, bool b)
Definition Target.cpp:4558
std::unique_ptr< TargetExperimentalProperties > m_experimental_properties_up
Definition Target.h:304
FileSpecList GetClangModuleSearchPaths()
Definition Target.cpp:4852
void SetStandardOutputPath(llvm::StringRef path)
Definition Target.cpp:4993
bool GetRequireHardwareBreakpoints() const
Definition Target.cpp:5167
PathMappingList & GetSourcePathMap() const
Definition Target.cpp:4812
bool GetAutoSourceMapRelative() const
Definition Target.cpp:4828
bool GetUseDIL(ExecutionContext *exe_ctx) const
Definition Target.cpp:4546
void SetDefaultArchitecture(const ArchSpec &arch)
Definition Target.cpp:4572
void SetStandardInputPath(llvm::StringRef path)
Definition Target.cpp:4983
TargetProperties(Target *target)
Definition Target.cpp:4453
bool GetDisplayExpressionsInCrashlogs() const
Definition Target.cpp:5069
bool GetEnableAutoApplyFixIts() const
Definition Target.cpp:4877
void SetDebugUtilityExpression(bool debug)
Definition Target.cpp:5247
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:4958
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:1741
const ArchSpec & GetSpec() const
Definition Target.h:1736
const Arch & operator=(const ArchSpec &spec)
Definition Target.cpp:163
Arch(const ArchSpec &spec)
Definition Target.cpp:159
Architecture * GetPlugin() const
Definition Target.h:1737
void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.h:1592
HandleStopCallback * m_callback
Definition Target.h:1600
StopHookResult HandleStop(ExecutionContext &exc_ctx, lldb::StreamSP output) override
Definition Target.h:1587
StopHookCoded(lldb::TargetSP target_sp, lldb::user_id_t uid)
Use CreateStopHook to make a new empty stop hook.
Definition Target.h:1605
void SetCallback(llvm::StringRef name, HandleStopCallback *callback)
Definition Target.h:1582
StopHookResult(ExecutionContext &exc_ctx, lldb::StreamSP output) HandleStopCallback
Definition Target.h:1579
void SetActionFromString(const std::string &strings)
Definition Target.cpp:4074
StopHookCommandLine(lldb::TargetSP target_sp, lldb::user_id_t uid)
Definition Target.h:1543
void SetActionFromStrings(const std::vector< std::string > &strings)
Definition Target.cpp:4078
StopHookResult HandleStop(ExecutionContext &exc_ctx, lldb::StreamSP output_sp) override
Definition Target.cpp:4085
void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.cpp:4056
Status SetScriptCallback(std::string class_name, StructuredData::ObjectSP extra_args_sp)
Definition Target.cpp:4119
StopHookResult HandleStop(ExecutionContext &exc_ctx, lldb::StreamSP output) override
Definition Target.cpp:4159
StopHookScripted(lldb::TargetSP target_sp, lldb::user_id_t uid)
Use CreateStopHook to make a new empty stop hook.
Definition Target.h:1570
void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const override
Definition Target.cpp:4178
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:1564
lldb::ScriptedStopHookInterfaceSP m_interface_sp
Definition Target.h:1565
bool GetRunAtInitialStop() const
Definition Target.h:1501
SymbolContextSpecifier * GetSpecifier()
Definition Target.h:1470
void SetSpecifier(SymbolContextSpecifier *specifier)
Definition Target.cpp:3994
virtual StopHookResult HandleStop(ExecutionContext &exe_ctx, lldb::StreamSP output)=0
std::unique_ptr< ThreadSpec > m_thread_spec_up
Definition Target.h:1516
void SetIsActive(bool is_active)
Definition Target.h:1489
void SetSuppressOutput(bool suppress_output)
Definition Target.h:1503
void SetThreadSpecifier(ThreadSpec *specifier)
Definition Target.cpp:3998
ThreadSpec * GetThreadSpecifier()
Definition Target.h:1485
StopHook(const StopHook &rhs)
Definition Target.cpp:3986
bool ExecutionContextPasses(const ExecutionContext &exe_ctx)
Definition Target.cpp:4002
lldb::TargetSP & GetTarget()
Definition Target.h:1464
void SetRunAtInitialStop(bool at_initial_stop)
Definition Target.h:1497
lldb::SymbolContextSpecifierSP m_specifier_sp
Definition Target.h:1515
virtual void GetSubclassDescription(Stream &s, lldb::DescriptionLevel level) const =0
void GetDescription(Stream &s, lldb::DescriptionLevel level) const
Definition Target.cpp:4018
void SetAutoContinue(bool auto_continue)
Definition Target.h:1491
const ModuleList & GetModuleList() const
Definition Target.h:594
void Dump(Stream *s) const override
Definition Target.cpp:5272
static llvm::StringRef GetFlavorString()
Definition Target.cpp:5268
static lldb::TargetSP GetCreatedTargetFromEvent(const Event *event_ptr)
Definition Target.cpp:5301
static ModuleList GetModuleListFromEvent(const Event *event_ptr)
Definition Target.cpp:5310
static const TargetEventData * GetEventDataFromEvent(const Event *event_ptr)
Definition Target.cpp:5282
llvm::StringRef GetFlavor() const override
Definition Target.h:572
const lldb::TargetSP & GetTarget() const
Definition Target.h:588
TargetEventData(const lldb::TargetSP &target_sp)
Definition Target.cpp:5254
TargetEventData(const TargetEventData &)=delete
const lldb::TargetSP & GetCreatedTarget() const
Definition Target.h:590
const TargetEventData & operator=(const TargetEventData &)=delete
static lldb::TargetSP GetTargetFromEvent(const Event *event_ptr)
Definition Target.cpp:5292
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:1858
lldb::ThreadSP CalculateThread() override
Definition Target.cpp:2592
llvm::Expected< uint32_t > AddScriptedFrameProviderDescriptor(const ScriptedFrameProviderDescriptor &descriptor)
Add or update a scripted frame provider descriptor for this target.
Definition Target.cpp:3723
StopHookCollection m_stop_hooks
Definition Target.h:1791
Module * GetExecutableModulePointer()
Definition Target.cpp:1540
void Dump(Stream *s, lldb::DescriptionLevel description_level)
Dump a description of this object to a Stream.
Definition Target.cpp:243
void DisableAllBreakpoints(bool internal_also=false)
Definition Target.cpp:1072
lldb::WatchpointSP CreateWatchpoint(lldb::addr_t addr, size_t size, const CompilerType *type, uint32_t kind, Status &error)
Definition Target.cpp:954
void ApplyNameToBreakpoints(BreakpointName &bp_name)
Definition Target.cpp:908
lldb::TraceSP GetTrace()
Get the Trace object containing processor trace information of this target.
Definition Target.cpp:3598
PathMappingList & GetImageSearchPathList()
Definition Target.cpp:2601
void FinalizeFileActions(ProcessLaunchInfo &info)
Definition Target.cpp:3778
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:2991
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:2999
ModuleList & GetImages()
Definition Target.h:1113
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:760
static Target * GetTargetFromContexts(const ExecutionContext *exe_ctx_ptr, const SymbolContext *sc_ptr)
Definition Target.cpp:2836
lldb::addr_t GetBreakableLoadAddress(lldb::addr_t addr)
Definition Target.cpp:3006
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:3926
bool SetSuppresStopHooks(bool suppress)
Definition Target.h:1628
static void ImageSearchPathsChanged(const PathMappingList &path_list, void *baton)
Definition Target.cpp:2605
llvm::Expected< lldb_private::Address > GetEntryPointAddress()
This method will return the address of the starting function for this binary, e.g.
Definition Target.cpp:2957
bool IgnoreWatchpointByID(lldb::watch_id_t watch_id, uint32_t ignore_count)
Definition Target.cpp:1508
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:726
lldb::BreakpointSP GetBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:421
std::shared_ptr< StopHook > StopHookSP
Definition Target.h:1612
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:548
void SymbolsDidLoad(ModuleList &module_list)
Definition Target.cpp:1881
bool ClearAllWatchpointHistoricValues()
Definition Target.cpp:1422
const std::vector< StopHookSP > GetStopHooks(bool internal=false) const
Definition Target.cpp:3119
void SetTrace(const lldb::TraceSP &trace_sp)
Set the Trace object containing processor trace information of this target.
Definition Target.cpp:3596
BreakpointList & GetBreakpointList(bool internal=false)
Definition Target.cpp:407
CompilerType GetRegisterType(const std::string &name, const lldb_private::RegisterFlags &flags, uint32_t byte_size)
Definition Target.cpp:2640
BreakpointNameList m_breakpoint_names
Definition Target.h:1765
lldb_private::SummaryStatisticsCache & GetSummaryStatisticsCache()
Definition Target.cpp:3413
lldb::addr_t GetSectionLoadAddress(const lldb::SectionSP &section_sp)
Definition Target.cpp:5335
llvm::StringRef GetABIName() const
Returns the name of the target's ABI plugin.
Definition Target.cpp:396
SourceManager & GetSourceManager()
Definition Target.cpp:3043
lldb::SearchFilterSP GetSearchFilterForModuleList(const FileSpecList *containingModuleList)
Definition Target.cpp:689
StopHookSP GetStopHookByID(lldb::user_id_t uid)
Definition Target.cpp:3085
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:1814
lldb::ProcessSP m_process_sp
Definition Target.h:1773
Debugger & GetDebugger() const
Definition Target.h:1194
lldb::SearchFilterSP m_search_filter_sp
Definition Target.h:1774
PersistentExpressionState * GetPersistentExpressionStateForLanguage(lldb::LanguageType language)
Definition Target.cpp:2683
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:3914
bool m_is_dummy_target
Used to not run stop hooks for expressions.
Definition Target.h:1798
static bool UpdateSignalFromDummy(lldb::UnixSignalsSP signals_sp, const DummySignalElement &element)
Definition Target.cpp:3872
PathMappingList m_image_search_paths
Definition Target.h:1775
bool ModuleIsExcludedForUnconstrainedSearches(const FileSpec &module_spec)
Return whether this FileSpec corresponds to a module that should be considered for general searches.
Definition Target.cpp:1937
lldb::StackFrameSP CalculateStackFrame() override
Definition Target.cpp:2594
SectionLoadList & GetSectionLoadList()
Definition Target.h:1869
lldb::addr_t GetPersistentSymbol(ConstString name)
Definition Target.cpp:2937
void PrimeFromDummyTarget(Target &target)
Definition Target.cpp:219
bool RemoveScriptedFrameProviderDescriptor(uint32_t id)
Remove a scripted frame provider descriptor by id.
Definition Target.cpp:3747
static void SettingsTerminate()
Definition Target.cpp:2795
bool EnableWatchpointByID(lldb::watch_id_t watch_id)
Definition Target.cpp:1473
bool ResolveFileAddress(lldb::addr_t load_addr, Address &so_addr)
Definition Target.cpp:3329
bool ClearAllWatchpointHitCounts()
Definition Target.cpp:1408
size_t ReadMemoryFromFileCache(const Address &addr, void *dst, size_t dst_len, Status &error)
Definition Target.cpp:1969
void ClearAllLoadedSections()
Definition Target.cpp:3405
std::vector< lldb::TypeSystemSP > GetScratchTypeSystems(bool create_on_demand=true)
Definition Target.cpp:2649
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:2268
void AddNameToBreakpoint(BreakpointID &id, llvm::StringRef name, Status &error)
Definition Target.cpp:828
bool LoadScriptingResources(std::list< Status > &errors, Stream &feedback_stream, bool continue_on_error=true)
Definition Target.h:1087
void DumpSectionLoadList(Stream &s)
Definition Target.cpp:5341
void DeleteCurrentProcess()
Definition Target.cpp:278
BreakpointList m_internal_breakpoint_list
Definition Target.h:1762
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:2299
void DisableAllowedBreakpoints()
Definition Target.cpp:1082
bool SetSectionUnloaded(const lldb::SectionSP &section_sp)
Definition Target.cpp:3383
lldb::TargetSP CalculateTarget() override
Definition Target.cpp:2588
const lldb::ProcessSP & GetProcessSP() const
Definition Target.cpp:312
void ClearModules(bool delete_locations)
Definition Target.cpp:1562
bool RemoveBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:1106
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:2351
static bool ResetSignalFromDummy(lldb::UnixSignalsSP signals_sp, const DummySignalElement &element)
Definition Target.cpp:3899
Architecture * GetArchitecturePlugin() const
Definition Target.h:1192
llvm::json::Value ReportStatistics(const lldb_private::StatisticsOptions &options)
Get metrics associated with this target in JSON format.
Definition Target.cpp:5327
friend class TargetList
Definition Target.h:530
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:2736
TargetStats & GetStatistics()
Definition Target.h:1839
void EnableAllBreakpoints(bool internal_also=false)
Definition Target.cpp:1089
Status Launch(ProcessLaunchInfo &launch_info, Stream *stream)
Definition Target.cpp:3428
bool DisableBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:1126
lldb::BreakpointSP CreateBreakpointAtUserEntry(Status &error)
Definition Target.cpp:433
BreakpointName * FindBreakpointName(ConstString name, bool can_create, Status &error)
Definition Target.cpp:860
std::map< lldb::user_id_t, StopHookSP > StopHookCollection
Definition Target.h:1790
llvm::Expected< lldb::TraceSP > CreateTrace()
Create a Trace object for the current target using the using the default supported tracing technology...
Definition Target.cpp:3600
lldb::TraceSP m_trace_sp
An optional lldb_private::Trace object containing processor trace information of this target.
Definition Target.h:1808
lldb::user_id_t GetGloballyUniqueID() const
Get the globally unique ID for this target.
Definition Target.h:630
bool RemoveAllWatchpoints(bool end_to_end=true)
Definition Target.cpp:1326
bool ReadPointerFromMemory(const Address &addr, Status &error, Address &pointer_addr, bool force_live_memory=false)
Definition Target.cpp:2321
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:3071
WatchpointList m_watchpoint_list
Definition Target.h:1768
BreakpointList m_breakpoint_list
Definition Target.h:1761
lldb::SourceManagerUP m_source_manager_up
Definition Target.h:1788
bool RemoveWatchpointByID(lldb::watch_id_t watch_id)
Definition Target.cpp:1492
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, uint32_t stop_id=SectionLoadHistory::eStopIDNow, bool allow_section_end=false)
Definition Target.cpp:3323
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:2219
const llvm::DenseMap< uint32_t, ScriptedFrameProviderDescriptor > & GetScriptedFrameProviderDescriptors() const
Get all scripted frame provider descriptors for this target.
Definition Target.cpp:3772
void DeleteBreakpointName(ConstString name)
Definition Target.cpp:884
void NotifyWillClearList(const ModuleList &module_list) override
Definition Target.cpp:1820
bool SetArchitecture(const ArchSpec &arch_spec, bool set_platform=false, bool merge=true)
Set the architecture for this target.
Definition Target.cpp:1704
void NotifyModuleAdded(const ModuleList &module_list, const lldb::ModuleSP &module_sp) override
Implementing of ModuleList::Notifier.
Definition Target.cpp:1822
llvm::Expected< lldb::TypeSystemSP > GetScratchTypeSystemForLanguage(lldb::LanguageType language, bool create_on_demand=true)
Definition Target.cpp:2614
void ConfigureBreakpointName(BreakpointName &bp_name, const BreakpointOptions &options, const BreakpointName::Permissions &permissions)
Definition Target.cpp:900
lldb_private::SummaryStatisticsSP GetSummaryStatisticsSPForProviderName(lldb_private::TypeSummaryImpl &summary_provider)
Definition Target.cpp:3407
lldb::SearchFilterSP GetSearchFilterForModuleAndCUList(const FileSpecList *containingModules, const FileSpecList *containingSourceFiles)
Definition Target.cpp:706
lldb::ModuleSP GetExecutableModule()
Gets the module for the main executable.
Definition Target.cpp:1524
bool SetStopHookActiveStateByID(lldb::user_id_t uid, bool active_state)
Definition Target.cpp:3095
const lldb::ProcessSP & CreateProcess(lldb::ListenerSP listener_sp, llvm::StringRef plugin_name, const FileSpec *crash_file, bool can_connect)
Definition Target.cpp:300
void SetAllStopHooksActiveState(bool active_state)
Definition Target.cpp:3106
std::vector< StopHookSP > m_internal_stop_hooks
Definition Target.h:1793
lldb::ExpressionVariableSP GetPersistentVariable(ConstString name)
Definition Target.cpp:2918
void NotifyModulesRemoved(lldb_private::ModuleList &module_list) override
Definition Target.cpp:1854
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:3049
size_t ReadCStringFromMemory(const Address &addr, std::string &out_str, Status &error, bool force_live_memory=false)
Definition Target.cpp:2129
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:1747
std::recursive_mutex m_frame_provider_descriptors_mutex
Definition Target.h:1783
lldb::user_id_t m_target_unique_id
The globally unique ID assigned to this target.
Definition Target.h:1800
void ModulesDidUnload(ModuleList &module_list, bool delete_locations)
Definition Target.cpp:1897
void CalculateExecutionContext(ExecutionContext &exe_ctx) override
Reconstruct the object's execution context into sc.
Definition Target.cpp:2596
llvm::Expected< lldb::DisassemblerSP > ReadInstructions(const Address &start_addr, uint32_t count, const char *flavor_string=nullptr)
Definition Target.cpp:3012
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:3625
void NotifyModuleUpdated(const ModuleList &module_list, const lldb::ModuleSP &old_module_sp, const lldb::ModuleSP &new_module_sp) override
Definition Target.cpp:1842
SummaryStatisticsCache m_summary_statistics_cache
Definition Target.h:1759
Target(const Target &)=delete
void RegisterInternalStopHooks()
Status SerializeBreakpointsToFile(const FileSpec &file, const BreakpointIDList &bp_ids, bool append)
Definition Target.cpp:1167
void DidExec()
Called as the last function in Process::DidExec().
Definition Target.cpp:1569
void SaveScriptedLaunchInfo(lldb_private::ProcessInfo &process_info)
Definition Target.cpp:3417
bool GetSuppressStopHooks()
Definition Target.h:1634
std::string m_label
Definition Target.h:1756
lldb::user_id_t m_stop_hook_next_id
Definition Target.h:1792
static FileSpecList GetDefaultExecutableSearchPaths()
Definition Target.cpp:2797
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:743
void NotifyBreakpointChanged(Breakpoint &bp, lldb::BreakpointEventType event_kind)
Sends a breakpoint notification event.
Definition Target.cpp:5345
lldb::SearchFilterSP GetSearchFilterForModule(const FileSpec *containingModule)
Definition Target.cpp:671
llvm::StringMapEntry< DummySignalValues > DummySignalElement
Definition Target.h:1690
std::recursive_mutex & GetAPIMutex()
Definition Target.cpp:5318
static llvm::StringRef GetStaticBroadcasterClass()
Definition Target.cpp:169
static FileSpecList GetDefaultDebugFileSearchPaths()
Definition Target.cpp:2801
void EnableAllowedBreakpoints()
Definition Target.cpp:1099
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:2003
llvm::Error SetLabel(llvm::StringRef label)
Set a label for a target.
Definition Target.cpp:2816
uint32_t m_latest_stop_hook_id
Definition Target.h:1794
StackFrameRecognizerManager & GetFrameRecognizerManager()
Definition Target.h:1672
void RemoveAllowedBreakpoints()
Definition Target.cpp:1051
bool DisableAllWatchpoints(bool end_to_end=true)
Definition Target.cpp:1355
bool RunStopHooks(bool at_initial_stop=false)
Definition Target.cpp:3130
void ClearSectionLoadList()
Definition Target.cpp:5339
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:2206
lldb::PlatformSP m_platform_sp
The platform for this target.
Definition Target.h:1746
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:2766
static TargetProperties & GetGlobalProperties()
Definition Target.cpp:3287
Status Install(ProcessLaunchInfo *launch_info)
Definition Target.cpp:3295
lldb::PlatformSP GetPlatform()
Definition Target.h:1648
void NotifyModuleRemoved(const ModuleList &module_list, const lldb::ModuleSP &module_sp) override
Definition Target.cpp:1832
lldb::BreakpointSP CreateAddressInModuleBreakpoint(lldb::addr_t file_addr, bool internal, const FileSpec &file_spec, bool request_hardware)
Definition Target.cpp:577
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:488
void RemoveAllBreakpoints(bool internal_also=false)
Definition Target.cpp:1060
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:471
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:2805
void ResetBreakpointHitCounts()
Resets the hit count of all breakpoints.
Definition Target.cpp:1163
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition Target.h:1111
const ArchSpec & GetArchitecture() const
Definition Target.h:1153
WatchpointList & GetWatchpointList()
Definition Target.h:897
@ eBroadcastBitWatchpointChanged
Definition Target.h:538
@ eBroadcastBitBreakpointChanged
Definition Target.h:535
@ eBroadcastBitNewTargetCreated
Definition Target.h:541
unsigned m_next_persistent_variable_index
Definition Target.h:1799
bool EnableBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:1144
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:2310
TargetStats m_stats
Definition Target.h:1822
bool IgnoreAllWatchpoints(uint32_t ignore_count)
Definition Target.cpp:1437
void AddBreakpoint(lldb::BreakpointSP breakpoint_sp, bool internal)
Definition Target.cpp:805
std::string m_target_session_name
The target session name for this target, used to name debugging sessions in DAP.
Definition Target.h:1803
TypeSystemMap m_scratch_type_system_map
Definition Target.h:1776
void AddBreakpointName(std::unique_ptr< BreakpointName > bp_name)
Definition Target.cpp:855
void SetTargetSessionName(llvm::StringRef target_session_name)
Set the target session name for this target.
Definition Target.h:663
SectionLoadHistory m_section_load_history
Definition Target.h:1760
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:922
bool IsDummyTarget() const
Definition Target.h:619
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:174
size_t UnloadModuleSections(const lldb::ModuleSP &module_sp)
Definition Target.cpp:3364
llvm::StringRef GetTargetSessionName()
Get the target session name for this target.
Definition Target.h:651
llvm::DenseMap< uint32_t, ScriptedFrameProviderDescriptor > m_frame_provider_descriptors
Map of scripted frame provider descriptors for this target.
Definition Target.h:1782
const std::string & GetLabel() const
Definition Target.h:632
bool m_valid
This records the last natural stop at which we ran a stop-hook.
Definition Target.h:1796
bool DisableWatchpointByID(lldb::watch_id_t watch_id)
Definition Target.cpp:1454
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:3857
void ClearScriptedFrameProviderDescriptors()
Clear all scripted frame provider descriptors for this target.
Definition Target.cpp:3760
std::map< ConstString, std::unique_ptr< BreakpointName > > BreakpointNameList
Definition Target.h:1763
lldb::WatchpointSP m_last_created_watchpoint
Definition Target.h:1769
Status CreateBreakpointsFromFile(const FileSpec &file, BreakpointIDList &new_bps)
Definition Target.cpp:1259
Debugger & m_debugger
Definition Target.h:1745
void SetREPL(lldb::LanguageType language, lldb::REPLSP repl_sp)
Definition Target.cpp:365
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:1575
lldb::StackFrameRecognizerManagerUP m_frame_recognizer_manager_up
Stores the frame recognizers of this target.
Definition Target.h:1810
lldb::REPLSP GetREPL(Status &err, lldb::LanguageType language, const char *repl_options, bool can_create)
Definition Target.cpp:314
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:2703
ModuleList m_images
The list of images for this process (shared libraries and anything dynamically loaded).
Definition Target.h:1757
lldb::ProcessSP CalculateProcess() override
Definition Target.cpp:2590
void PrintDummySignals(Stream &strm, Args &signals)
Print all the signals set in this target.
Definition Target.cpp:3951
void SetPlatform(const lldb::PlatformSP &platform_sp)
Definition Target.h:1650
bool SetSectionLoadAddress(const lldb::SectionSP &section, lldb::addr_t load_addr, bool warn_multiple=false)
Definition Target.cpp:3334
Status Attach(ProcessAttachInfo &attach_info, Stream *stream)
Definition Target.cpp:3631
std::map< lldb::LanguageType, lldb::REPLSP > REPLMap
Definition Target.h:1785
static void SetDefaultArchitecture(const ArchSpec &arch)
Definition Target.cpp:2809
lldb::BreakpointSP m_last_created_breakpoint
Definition Target.h:1767
lldb::WatchpointSP GetLastCreatedWatchpoint()
Definition Target.h:893
void RemoveNameFromBreakpoint(lldb::BreakpointSP &bp_sp, ConstString name)
Definition Target.cpp:895
bool RemoveStopHookByID(lldb::user_id_t uid)
Definition Target.cpp:3078
friend class Debugger
Definition Target.h:531
lldb::BreakpointSP GetLastCreatedBreakpoint()
Definition Target.h:785
static void SettingsInitialize()
Definition Target.cpp:2793
~Target() override
Definition Target.cpp:213
bool EnableAllWatchpoints(bool end_to_end=true)
Definition Target.cpp:1382
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:1754
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:2850
bool MergeArchitecture(const ArchSpec &arch_spec)
Definition Target.cpp:1795
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:55
@ eLoadScriptFromSymFileTrue
Definition Target.h:56
@ eLoadScriptFromSymFileFalse
Definition Target.h:57
@ eLoadScriptFromSymFileWarn
Definition Target.h:58
ExecutionPolicy
Expression execution policies.
DynamicClassInfoHelper
Definition Target.h:73
@ eDynamicClassInfoHelperCopyRealizedClassList
Definition Target.h:76
@ eDynamicClassInfoHelperGetRealizedClassList
Definition Target.h:77
@ eDynamicClassInfoHelperAuto
Definition Target.h:74
@ eDynamicClassInfoHelperRealizedClassesStruct
Definition Target.h:75
OptionEnumValues GetDynamicValueTypes()
Definition Target.cpp:4236
@ eImportStdModuleFalse
Definition Target.h:68
@ eImportStdModuleFallback
Definition Target.h:69
@ eImportStdModuleTrue
Definition Target.h:70
LoadCWDlldbinitFile
Definition Target.h:61
@ eLoadCWDlldbinitTrue
Definition Target.h:62
@ eLoadCWDlldbinitFalse
Definition Target.h:63
@ eLoadCWDlldbinitWarn
Definition Target.h:64
llvm::ArrayRef< OptionEnumValueElement > OptionEnumValues
@ eInlineBreakpointsNever
Definition Target.h:50
@ eInlineBreakpointsAlways
Definition Target.h:52
@ eInlineBreakpointsHeaders
Definition Target.h:51
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
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:86
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:87
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:1686
UserID(lldb::user_id_t uid=LLDB_INVALID_UID)
Construct with optional user ID.
Definition UserID.h:33