Skip to content

Commit a1ea86e

Browse files
committed
Support selecting the lldb platform
1 parent 475707b commit a1ea86e

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

core/adapters/lldbadapter.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,5 +1166,18 @@ Ref<Metadata> LldbAdapter::GetProperty(const std::string &name)
11661166

11671167
bool LldbAdapter::SetProperty(const std::string &name, const Ref<Metadata> &value)
11681168
{
1169+
if (name == "current_platform")
1170+
{
1171+
if (value->IsString())
1172+
{
1173+
auto platform = value->GetString();
1174+
if (!platform.empty())
1175+
{
1176+
auto error = m_debugger.SetCurrentPlatform(platform.c_str());
1177+
if (error.Success())
1178+
return true;
1179+
}
1180+
}
1181+
}
11691182
return false;
11701183
}

core/debuggercontroller.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,10 @@ Ref<Metadata> DebuggerController::GetAdapterProperty(const std::string& name)
14901490

14911491
bool DebuggerController::SetAdapterProperty(const std::string& name, const BinaryNinja::Ref<BinaryNinja::Metadata>& value)
14921492
{
1493-
return true;
1493+
if (!m_adapter)
1494+
return false;
1495+
1496+
return m_adapter->SetProperty(name, value);
14941497
}
14951498

14961499

ui/debugserversetting.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,10 @@ void DebugServerSettingsDialog::apply()
110110
data = new Metadata(port);
111111
m_controller->GetData()->StoreMetadata("debugger.remote_port", data);
112112

113+
const auto platform = m_platformEntry->currentText().toStdString();
114+
data = new Metadata(platform);
115+
m_controller->SetAdapterProperty("current_platform", data);
116+
m_controller->GetData()->StoreMetadata("debugger.platform", data);
117+
113118
accept();
114119
}

0 commit comments

Comments
 (0)