Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
source/Target/Target.cpp
Show First 20 Lines • Show All 3,034 Lines • ▼ Show 20 Lines | protected: | ||||
Target *m_target; | Target *m_target; | ||||
mutable bool m_got_host_env; | mutable bool m_got_host_env; | ||||
}; | }; | ||||
//---------------------------------------------------------------------- | //---------------------------------------------------------------------- | ||||
// TargetProperties | // TargetProperties | ||||
//---------------------------------------------------------------------- | //---------------------------------------------------------------------- | ||||
TargetProperties::TargetProperties (Target *target) : | TargetProperties::TargetProperties (Target *target) : | ||||
Properties () | Properties (), | ||||
m_launch_info () | |||||
{ | { | ||||
if (target) | if (target) | ||||
{ | { | ||||
m_collection_sp.reset (new TargetOptionValueProperties(target, Target::GetGlobalProperties())); | m_collection_sp.reset (new TargetOptionValueProperties(target, Target::GetGlobalProperties())); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
m_collection_sp.reset (new TargetOptionValueProperties(ConstString("target"))); | m_collection_sp.reset (new TargetOptionValueProperties(ConstString("target"))); | ||||
m_collection_sp->Initialize(g_properties); | m_collection_sp->Initialize(g_properties); | ||||
m_collection_sp->AppendProperty(ConstString("process"), | m_collection_sp->AppendProperty(ConstString("process"), | ||||
ConstString("Settings specify to processes."), | ConstString("Settings specify to processes."), | ||||
true, | true, | ||||
Process::GetGlobalProperties()->GetValueProperties()); | Process::GetGlobalProperties()->GetValueProperties()); | ||||
} | } | ||||
m_collection_sp->SetValueChangedCallback(ePropertyRunArgs, TargetProperties::RunArgumentsValueChangedCallback, this); | |||||
RunArgumentsValueChangedCallback(this, NULL); // update m_launch_info | |||||
} | } | ||||
TargetProperties::~TargetProperties () | TargetProperties::~TargetProperties () | ||||
ki.stfu: here | |||||
{ | { | ||||
} | } | ||||
ArchSpec | ArchSpec | ||||
TargetProperties::GetDefaultArchitecture () const | TargetProperties::GetDefaultArchitecture () const | ||||
{ | { | ||||
Not Done ReplyInline ActionsI can't set more than 1 callback. ki.stfu: I can't set more than 1 callback. | |||||
Not Done ReplyInline ActionsEither get each option value and set the callback on each indivdual one, or make just one callback and in that callback extract the name from the "OptionValue *" using OptionValue::GetName() and then decoding which value it comes from. clayborg: Either get each option value and set the callback on each indivdual one, or make just one… | |||||
OptionValueArch *value = m_collection_sp->GetPropertyAtIndexAsOptionValueArch (NULL, ePropertyDefaultArch); | OptionValueArch *value = m_collection_sp->GetPropertyAtIndexAsOptionValueArch (NULL, ePropertyDefaultArch); | ||||
if (value) | if (value) | ||||
return value->GetCurrentValue(); | return value->GetCurrentValue(); | ||||
return ArchSpec(); | return ArchSpec(); | ||||
} | } | ||||
void | void | ||||
TargetProperties::SetDefaultArchitecture (const ArchSpec& arch) | TargetProperties::SetDefaultArchitecture (const ArchSpec& arch) | ||||
▲ Show 20 Lines • Show All 296 Lines • ▼ Show 20 Lines | |||||
void | void | ||||
TargetProperties::SetDisplayRuntimeSupportValues (bool b) | TargetProperties::SetDisplayRuntimeSupportValues (bool b) | ||||
{ | { | ||||
const uint32_t idx = ePropertyDisplayRuntimeSupportValues; | const uint32_t idx = ePropertyDisplayRuntimeSupportValues; | ||||
m_collection_sp->SetPropertyAtIndexAsBoolean (NULL, idx, b); | m_collection_sp->SetPropertyAtIndexAsBoolean (NULL, idx, b); | ||||
} | } | ||||
ProcessLaunchInfo | |||||
TargetProperties::GetProcessLaunchInfo () const | |||||
{ | |||||
return m_launch_info; | |||||
} | |||||
void | |||||
TargetProperties::SetProcessLaunchInfo(const ProcessLaunchInfo &launch_info) | |||||
{ | |||||
m_launch_info = launch_info; | |||||
SetRunArguments(launch_info.GetArguments()); | |||||
} | |||||
void | |||||
TargetProperties::RunArgumentsValueChangedCallback(void *target_property_ptr, OptionValue *) | |||||
{ | |||||
TargetProperties *this_ = reinterpret_cast<TargetProperties *>(target_property_ptr); | |||||
Args args; | |||||
if (this_->GetRunArguments(args)) | |||||
this_->m_launch_info.SetArguments(args, false); | |||||
} | |||||
//---------------------------------------------------------------------- | //---------------------------------------------------------------------- | ||||
// Target::TargetEventData | // Target::TargetEventData | ||||
//---------------------------------------------------------------------- | //---------------------------------------------------------------------- | ||||
const ConstString & | const ConstString & | ||||
Target::TargetEventData::GetFlavorString () | Target::TargetEventData::GetFlavorString () | ||||
{ | { | ||||
static ConstString g_flavor ("Target::TargetEventData"); | static ConstString g_flavor ("Target::TargetEventData"); | ||||
return g_flavor; | return g_flavor; | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |
here