aboutsummaryrefslogtreecommitdiff
path: root/include/lldb/Target/Target.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lldb/Target/Target.h')
-rw-r--r--include/lldb/Target/Target.h223
1 files changed, 153 insertions, 70 deletions
diff --git a/include/lldb/Target/Target.h b/include/lldb/Target/Target.h
index a33734fd5b63..427f68e4c5d4 100644
--- a/include/lldb/Target/Target.h
+++ b/include/lldb/Target/Target.h
@@ -18,24 +18,15 @@
// Project includes
#include "lldb/lldb-public.h"
#include "lldb/Breakpoint/BreakpointList.h"
-#include "lldb/Breakpoint/BreakpointLocationCollection.h"
#include "lldb/Breakpoint/WatchpointList.h"
#include "lldb/Core/ArchSpec.h"
#include "lldb/Core/Broadcaster.h"
#include "lldb/Core/Disassembler.h"
-#include "lldb/Core/Event.h"
#include "lldb/Core/ModuleList.h"
#include "lldb/Core/UserSettingsController.h"
-#include "lldb/Expression/ClangModulesDeclVendor.h"
-#include "lldb/Expression/ClangPersistentVariables.h"
-#include "lldb/Interpreter/Args.h"
-#include "lldb/Interpreter/OptionValueBoolean.h"
-#include "lldb/Interpreter/OptionValueEnumeration.h"
-#include "lldb/Interpreter/OptionValueFileSpec.h"
-#include "lldb/Symbol/SymbolContext.h"
-#include "lldb/Target/ABI.h"
#include "lldb/Target/ExecutionContextScope.h"
#include "lldb/Target/PathMappingList.h"
+#include "lldb/Target/ProcessLaunchInfo.h"
#include "lldb/Target/SectionLoadHistory.h"
namespace lldb_private {
@@ -73,9 +64,15 @@ public:
void
SetDefaultArchitecture (const ArchSpec& arch);
+ bool
+ GetMoveToNearestCode () const;
+
lldb::DynamicValueType
GetPreferDynamicValue() const;
-
+
+ bool
+ SetPreferDynamicValue (lldb::DynamicValueType d);
+
bool
GetDisableASLR () const;
@@ -117,7 +114,10 @@ public:
size_t
GetEnvironmentAsArgs (Args &env) const;
-
+
+ void
+ SetEnvironmentFromArgs (const Args &env);
+
bool
GetSkipPrologue() const;
@@ -130,6 +130,12 @@ public:
FileSpecList &
GetDebugFileSearchPaths ();
+ FileSpecList &
+ GetClangModuleSearchPaths ();
+
+ bool
+ GetEnableAutoImportClangModules () const;
+
bool
GetEnableSyntheticValue () const;
@@ -189,9 +195,46 @@ public:
void
SetUserSpecifiedTrapHandlerNames (const Args &args);
-};
-typedef std::shared_ptr<TargetProperties> TargetPropertiesSP;
+ bool
+ GetNonStopModeEnabled () const;
+
+ void
+ SetNonStopModeEnabled (bool b);
+
+ bool
+ GetDisplayRuntimeSupportValues () const;
+
+ void
+ SetDisplayRuntimeSupportValues (bool b);
+
+ const ProcessLaunchInfo &
+ GetProcessLaunchInfo();
+
+ void
+ SetProcessLaunchInfo(const ProcessLaunchInfo &launch_info);
+
+private:
+ //------------------------------------------------------------------
+ // Callbacks for m_launch_info.
+ //------------------------------------------------------------------
+ static void Arg0ValueChangedCallback(void *target_property_ptr, OptionValue *);
+ static void RunArgsValueChangedCallback(void *target_property_ptr, OptionValue *);
+ static void EnvVarsValueChangedCallback(void *target_property_ptr, OptionValue *);
+ static void InheritEnvValueChangedCallback(void *target_property_ptr, OptionValue *);
+ static void InputPathValueChangedCallback(void *target_property_ptr, OptionValue *);
+ static void OutputPathValueChangedCallback(void *target_property_ptr, OptionValue *);
+ static void ErrorPathValueChangedCallback(void *target_property_ptr, OptionValue *);
+ static void DetachOnErrorValueChangedCallback(void *target_property_ptr, OptionValue *);
+ static void DisableASLRValueChangedCallback(void *target_property_ptr, OptionValue *);
+ static void DisableSTDIOValueChangedCallback(void *target_property_ptr, OptionValue *);
+
+private:
+ //------------------------------------------------------------------
+ // Member variables.
+ //------------------------------------------------------------------
+ ProcessLaunchInfo m_launch_info;
+};
class EvaluateExpressionOptions
{
@@ -200,19 +243,20 @@ public:
EvaluateExpressionOptions() :
m_execution_policy(eExecutionPolicyOnlyWhenNeeded),
m_language (lldb::eLanguageTypeUnknown),
- m_coerce_to_id(false),
- m_unwind_on_error(true),
+ m_prefix (), // A prefix specific to this expression that is added after the prefix from the settings (if any)
+ m_coerce_to_id (false),
+ m_unwind_on_error (true),
m_ignore_breakpoints (false),
- m_keep_in_memory(false),
- m_try_others(true),
- m_stop_others(true),
- m_debug(false),
- m_trap_exceptions(true),
- m_generate_debug_info(false),
- m_result_is_internal(false),
- m_use_dynamic(lldb::eNoDynamicValues),
- m_timeout_usec(default_timeout),
- m_one_thread_timeout_usec(0),
+ m_keep_in_memory (false),
+ m_try_others (true),
+ m_stop_others (true),
+ m_debug (false),
+ m_trap_exceptions (true),
+ m_generate_debug_info (false),
+ m_result_is_internal (false),
+ m_use_dynamic (lldb::eNoDynamicValues),
+ m_timeout_usec (default_timeout),
+ m_one_thread_timeout_usec (0),
m_cancel_callback (nullptr),
m_cancel_callback_baton (nullptr)
{
@@ -247,7 +291,24 @@ public:
{
return m_coerce_to_id;
}
-
+
+ const char *
+ GetPrefix () const
+ {
+ if (m_prefix.empty())
+ return NULL;
+ return m_prefix.c_str();
+ }
+
+ void
+ SetPrefix (const char *prefix)
+ {
+ if (prefix && prefix[0])
+ m_prefix = prefix;
+ else
+ m_prefix.clear();
+ }
+
void
SetCoerceToId (bool coerce = true)
{
@@ -419,6 +480,7 @@ public:
private:
ExecutionPolicy m_execution_policy;
lldb::LanguageType m_language;
+ std::string m_prefix;
bool m_coerce_to_id;
bool m_unwind_on_error;
bool m_ignore_breakpoints;
@@ -474,35 +536,49 @@ public:
class TargetEventData : public EventData
{
public:
+ TargetEventData (const lldb::TargetSP &target_sp);
+
+ TargetEventData (const lldb::TargetSP &target_sp, const ModuleList &module_list);
+
+ virtual
+ ~TargetEventData();
static const ConstString &
GetFlavorString ();
virtual const ConstString &
- GetFlavor () const;
-
- TargetEventData (const lldb::TargetSP &new_target_sp);
-
- lldb::TargetSP &
- GetTarget()
+ GetFlavor () const
{
- return m_target_sp;
+ return TargetEventData::GetFlavorString ();
}
- virtual
- ~TargetEventData();
-
virtual void
Dump (Stream *s) const;
- static const lldb::TargetSP
- GetTargetFromEvent (const lldb::EventSP &event_sp);
-
static const TargetEventData *
- GetEventDataFromEvent (const Event *event_sp);
+ GetEventDataFromEvent (const Event *event_ptr);
+
+ static lldb::TargetSP
+ GetTargetFromEvent (const Event *event_ptr);
+
+ static ModuleList
+ GetModuleListFromEvent (const Event *event_ptr);
+
+ const lldb::TargetSP &
+ GetTarget() const
+ {
+ return m_target_sp;
+ }
+
+ const ModuleList &
+ GetModuleList() const
+ {
+ return m_module_list;
+ }
private:
lldb::TargetSP m_target_sp;
+ ModuleList m_module_list;
DISALLOW_COPY_AND_ASSIGN (TargetEventData);
};
@@ -513,14 +589,14 @@ public:
static void
SettingsTerminate ();
-// static lldb::UserSettingsControllerSP &
-// GetSettingsController ();
-
static FileSpecList
GetDefaultExecutableSearchPaths ();
static FileSpecList
GetDefaultDebugFileSearchPaths ();
+
+ static FileSpecList
+ GetDefaultClangModuleSearchPaths ();
static ArchSpec
GetDefaultArchitecture ();
@@ -539,7 +615,7 @@ public:
// Settings accessors
//----------------------------------------------------------------------
- static const TargetPropertiesSP &
+ static const lldb::TargetPropertiesSP &
GetGlobalProperties();
@@ -617,7 +693,11 @@ public:
Error
Launch (ProcessLaunchInfo &launch_info,
- Stream *stream); // Optional stream to receive first stop info
+ Stream *stream); // Optional stream to receive first stop info
+
+ Error
+ Attach (ProcessAttachInfo &attach_info,
+ Stream *stream); // Optional stream to receive first stop info
//------------------------------------------------------------------
// This part handles the breakpoints.
@@ -646,7 +726,8 @@ public:
LazyBool check_inlines,
LazyBool skip_prologue,
bool internal,
- bool request_hardware);
+ bool request_hardware,
+ LazyBool move_to_nearest_code);
// Use this to create breakpoint that matches regex against the source lines in files given in source_file_list:
lldb::BreakpointSP
@@ -654,7 +735,8 @@ public:
const FileSpecList *source_file_list,
RegularExpression &source_regex,
bool internal,
- bool request_hardware);
+ bool request_hardware,
+ LazyBool move_to_nearest_code);
// Use this to create a breakpoint from a load address
lldb::BreakpointSP
@@ -681,7 +763,8 @@ public:
// Use this to create a function breakpoint by name in containingModule, or all modules if it is NULL
// When "skip_prologue is set to eLazyBoolCalculate, we use the current target
- // setting, else we use the values passed in
+ // 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,
@@ -692,11 +775,17 @@ public:
bool request_hardware);
lldb::BreakpointSP
- CreateExceptionBreakpoint (enum lldb::LanguageType language, bool catch_bp, bool throw_bp, bool internal);
+ CreateExceptionBreakpoint (enum lldb::LanguageType language,
+ bool catch_bp,
+ bool throw_bp,
+ bool internal,
+ Args *additional_args = nullptr,
+ Error *additional_args_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,
@@ -779,6 +868,9 @@ public:
ClearAllWatchpointHitCounts ();
bool
+ ClearAllWatchpointHistoricValues ();
+
+ bool
IgnoreAllWatchpoints (uint32_t ignore_count);
bool
@@ -1001,12 +1093,6 @@ public:
bool
ModuleIsExcludedForUnconstrainedSearches (const lldb::ModuleSP &module_sp);
- ArchSpec &
- GetArchitecture ()
- {
- return m_arch;
- }
-
const ArchSpec &
GetArchitecture () const
{
@@ -1034,6 +1120,9 @@ public:
bool
SetArchitecture (const ArchSpec &arch_spec);
+ bool
+ MergeArchitecture (const ArchSpec &arch_spec);
+
Debugger &
GetDebugger ()
{
@@ -1182,10 +1271,7 @@ public:
const EvaluateExpressionOptions& options = EvaluateExpressionOptions());
ClangPersistentVariables &
- GetPersistentVariables()
- {
- return m_persistent_variables;
- }
+ GetPersistentVariables();
//------------------------------------------------------------------
// Target Stop Hooks
@@ -1223,10 +1309,7 @@ public:
// Set the specifier. The stop hook will own the specifier, and is responsible for deleting it when we're done.
void
- SetSpecifier (SymbolContextSpecifier *specifier)
- {
- m_specifier_sp.reset (specifier);
- }
+ SetSpecifier (SymbolContextSpecifier *specifier);
SymbolContextSpecifier *
GetSpecifier ()
@@ -1387,13 +1470,13 @@ protected:
lldb::ProcessSP m_process_sp;
lldb::SearchFilterSP m_search_filter_sp;
PathMappingList m_image_search_paths;
- std::unique_ptr<ClangASTContext> m_scratch_ast_context_ap;
- std::unique_ptr<ClangASTSource> m_scratch_ast_source_ap;
- std::unique_ptr<ClangASTImporter> m_ast_importer_ap;
- std::unique_ptr<ClangModulesDeclVendor> m_clang_modules_decl_vendor_ap;
- ClangPersistentVariables m_persistent_variables; ///< These are the persistent variables associated with this process for the expression parser.
+ lldb::ClangASTContextUP m_scratch_ast_context_ap;
+ lldb::ClangASTSourceUP m_scratch_ast_source_ap;
+ lldb::ClangASTImporterUP m_ast_importer_ap;
+ lldb::ClangModulesDeclVendorUP m_clang_modules_decl_vendor_ap;
+ lldb::ClangPersistentVariablesUP m_persistent_variables; ///< These are the persistent variables associated with this process for the expression parser.
- std::unique_ptr<SourceManager> m_source_manager_ap;
+ lldb::SourceManagerUP m_source_manager_ap;
typedef std::map<lldb::user_id_t, StopHookSP> StopHookCollection;
StopHookCollection m_stop_hooks;