diff options
Diffstat (limited to 'include/lldb/Target/Target.h')
| -rw-r--r-- | include/lldb/Target/Target.h | 122 |
1 files changed, 77 insertions, 45 deletions
diff --git a/include/lldb/Target/Target.h b/include/lldb/Target/Target.h index 75af8e80d2e5..90df1f4929b7 100644 --- a/include/lldb/Target/Target.h +++ b/include/lldb/Target/Target.h @@ -10,21 +10,16 @@ #ifndef liblldb_Target_h_ #define liblldb_Target_h_ -// C Includes -// C++ Includes #include <list> #include <map> #include <memory> #include <string> #include <vector> -// Other libraries and framework includes -// Project includes #include "lldb/Breakpoint/BreakpointList.h" #include "lldb/Breakpoint/BreakpointName.h" #include "lldb/Breakpoint/WatchpointList.h" #include "lldb/Core/Architecture.h" -#include "lldb/Core/Broadcaster.h" #include "lldb/Core/Disassembler.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/UserSettingsController.h" @@ -35,13 +30,14 @@ #include "lldb/Target/ProcessLaunchInfo.h" #include "lldb/Target/SectionLoadHistory.h" #include "lldb/Utility/ArchSpec.h" +#include "lldb/Utility/Broadcaster.h" #include "lldb/Utility/LLDBAssert.h" #include "lldb/Utility/Timeout.h" #include "lldb/lldb-public.h" namespace lldb_private { -extern OptionEnumValueElement g_dynamic_value_types[]; +OptionEnumValues GetDynamicValueTypes(); typedef enum InlineStrategy { eInlineBreakpointsNever = 0, @@ -61,6 +57,12 @@ typedef enum LoadCWDlldbinitFile { eLoadCWDlldbinitWarn } LoadCWDlldbinitFile; +typedef enum LoadDependentFiles { + eLoadDependentsDefault, + eLoadDependentsYes, + eLoadDependentsNo, +} LoadDependentFiles; + //---------------------------------------------------------------------- // TargetProperties //---------------------------------------------------------------------- @@ -186,6 +188,10 @@ public: void SetDisplayRuntimeSupportValues(bool b); + bool GetDisplayRecognizedArguments() const; + + void SetDisplayRecognizedArguments(bool b); + const ProcessLaunchInfo &GetProcessLaunchInfo(); void SetProcessLaunchInfo(const ProcessLaunchInfo &launch_info); @@ -196,6 +202,10 @@ public: bool GetUseModernTypeLookup() const; + void SetRequireHardwareBreakpoints(bool b); + + bool GetRequireHardwareBreakpoints() const; + private: //------------------------------------------------------------------ // Callbacks for m_launch_info. @@ -375,6 +385,10 @@ public: bool GetAutoApplyFixIts() const { return m_auto_apply_fixits; } + bool IsForUtilityExpr() const { return m_running_utility_expression; } + + void SetIsForUtilityExpr(bool b) { m_running_utility_expression = b; } + private: ExecutionPolicy m_execution_policy = default_execution_policy; lldb::LanguageType m_language = lldb::eLanguageTypeUnknown; @@ -392,6 +406,10 @@ private: bool m_ansi_color_errors = false; bool m_result_is_internal = false; bool m_auto_apply_fixits = true; + /// True if the executed code should be treated as utility code that is only + /// used by LLDB internally. + bool m_running_utility_expression = false; + lldb::DynamicValueType m_use_dynamic = lldb::eNoDynamicValues; Timeout<std::micro> m_timeout = default_timeout; Timeout<std::micro> m_one_thread_timeout = llvm::None; @@ -515,7 +533,9 @@ public: //------------------------------------------------------------------ void Dump(Stream *s, lldb::DescriptionLevel description_level); - const lldb::ProcessSP &CreateProcess(lldb::ListenerSP listener, + // If listener_sp is null, the listener of the owning Debugger object will be + // used. + const lldb::ProcessSP &CreateProcess(lldb::ListenerSP listener_sp, llvm::StringRef plugin_name, const FileSpec *crash_file); @@ -549,7 +569,7 @@ public: // module it is nullptr lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules, const FileSpec &file, uint32_t line_no, - lldb::addr_t offset, + uint32_t column, lldb::addr_t offset, LazyBool check_inlines, LazyBool skip_prologue, bool internal, bool request_hardware, @@ -594,14 +614,12 @@ public: // eLazyBoolCalculate, we use the current target setting, else we use the // values passed in. func_name_type_mask is or'ed values from the // FunctionNameType enum. - lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules, - const FileSpecList *containingSourceFiles, - const char *func_name, - uint32_t func_name_type_mask, - lldb::LanguageType language, - lldb::addr_t offset, - LazyBool skip_prologue, bool internal, - bool request_hardware); + 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, LazyBool skip_prologue, bool internal, + bool request_hardware); lldb::BreakpointSP CreateExceptionBreakpoint(enum lldb::LanguageType language, bool catch_bp, @@ -609,25 +627,34 @@ public: Args *additional_args = nullptr, Status *additional_args_error = nullptr); + 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); + // This is the same as the func_name breakpoint except that you can specify a // vector of names. This is cheaper than a regular expression breakpoint in // the case where you just want to set a breakpoint on a set of names you // already know. func_name_type_mask is or'ed values from the // FunctionNameType enum. - lldb::BreakpointSP - CreateBreakpoint(const FileSpecList *containingModules, - const FileSpecList *containingSourceFiles, - const char *func_names[], size_t num_names, - uint32_t func_name_type_mask, lldb::LanguageType language, - lldb::addr_t offset, LazyBool skip_prologue, bool internal, - bool request_hardware); + lldb::BreakpointSP CreateBreakpoint( + const FileSpecList *containingModules, + const FileSpecList *containingSourceFiles, const char *func_names[], + size_t num_names, lldb::FunctionNameType func_name_type_mask, + lldb::LanguageType language, lldb::addr_t offset, LazyBool skip_prologue, + bool internal, bool request_hardware); lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules, const FileSpecList *containingSourceFiles, const std::vector<std::string> &func_names, - uint32_t func_name_type_mask, lldb::LanguageType language, - lldb::addr_t m_offset, LazyBool skip_prologue, bool internal, + lldb::FunctionNameType func_name_type_mask, + lldb::LanguageType language, lldb::addr_t m_offset, + LazyBool skip_prologue, bool internal, bool request_hardware); // Use this to create a general breakpoint: @@ -665,7 +692,6 @@ public: const BreakpointOptions &options, const BreakpointName::Permissions &permissions); void ApplyNameToBreakpoints(BreakpointName &bp_name); - // This takes ownership of the name obj passed in. void AddBreakpointName(BreakpointName *bp_name); @@ -753,9 +779,9 @@ public: /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be /// returned. //------------------------------------------------------------------ - lldb::addr_t GetOpcodeLoadAddress( - lldb::addr_t load_addr, - AddressClass addr_class = AddressClass::eInvalid) const; + lldb::addr_t + GetOpcodeLoadAddress(lldb::addr_t load_addr, + AddressClass addr_class = AddressClass::eInvalid) const; // Get load_addr as breakable load address for this target. Take a addr and // check if for any reason there is a better address than this to put a @@ -826,14 +852,16 @@ public: /// A shared pointer reference to the module that will become /// the main executable for this process. /// - /// @param[in] get_dependent_files + /// @param[in] load_dependent_files /// If \b true then ask the object files to track down any /// known dependent files. /// /// @see ObjectFile::GetDependentModules (FileSpecList&) /// @see Process::GetImages() //------------------------------------------------------------------ - void SetExecutableModule(lldb::ModuleSP &module_sp, bool get_dependent_files); + void SetExecutableModule( + lldb::ModuleSP &module_sp, + LoadDependentFiles load_dependent_files = eLoadDependentsDefault); bool LoadScriptingResources(std::list<Status> &errors, Stream *feedback_stream = nullptr, @@ -913,28 +941,30 @@ public: /// Set the architecture for this target. /// /// If the current target has no Images read in, then this just sets the - /// architecture, which will - /// be used to select the architecture of the ExecutableModule when that is - /// set. - /// If the current target has an ExecutableModule, then calling - /// SetArchitecture with a different + /// architecture, which will be used to select the architecture of the + /// ExecutableModule when that is set. If the current target has an + /// ExecutableModule, then calling SetArchitecture with a different /// architecture from the currently selected one will reset the - /// ExecutableModule to that slice - /// of the file backing the ExecutableModule. If the file backing the - /// ExecutableModule does not - /// contain a fork of this architecture, then this code will return false, and - /// the architecture - /// won't be changed. - /// If the input arch_spec is the same as the already set architecture, this - /// is a no-op. + /// ExecutableModule to that slice of the file backing the ExecutableModule. + /// If the file backing the ExecutableModule does not contain a fork of this + /// architecture, then this code will return false, and the architecture + /// won't be changed. If the input arch_spec is the same as the already set + /// architecture, this is a no-op. /// /// @param[in] arch_spec /// The new architecture. /// + /// @param[in] set_platform + /// If \b true, then the platform will be adjusted if the currently + /// selected platform is not compatible with the archicture being set. + /// If \b false, then just the architecture will be set even if the + /// currently selected platform isn't compatible (in case it might be + /// manually set following this function call). + /// /// @return /// \b true if the architecture was successfully set, \bfalse otherwise. //------------------------------------------------------------------ - bool SetArchitecture(const ArchSpec &arch_spec); + bool SetArchitecture(const ArchSpec &arch_spec, bool set_platform = false); bool MergeArchitecture(const ArchSpec &arch_spec); @@ -1324,6 +1354,8 @@ private: void AddBreakpoint(lldb::BreakpointSP breakpoint_sp, bool internal); + void FinalizeFileActions(ProcessLaunchInfo &info); + DISALLOW_COPY_AND_ASSIGN(Target); }; |
