| 1548 | |
| 1549 | |
| 1550 | Ref<Metadata> LldbAdapter::GetProperty(const std::string& name) |
| 1551 | { |
| 1552 | if (name == "current_platform") |
| 1553 | { |
| 1554 | auto platform = m_debugger.GetSelectedPlatform(); |
| 1555 | return new Metadata(std::string(platform.GetName())); |
| 1556 | } |
| 1557 | else if (name == "platforms") |
| 1558 | { |
| 1559 | std::vector<std::string> platforms; |
| 1560 | for (size_t i = 0; i < m_debugger.GetNumAvailablePlatforms(); i++) |
| 1561 | { |
| 1562 | auto platform = m_debugger.GetAvailablePlatformInfoAtIndex(i); |
| 1563 | auto nameData = platform.GetValueForKey("name"); |
| 1564 | char name[1024]; |
| 1565 | nameData.GetStringValue(name, 1024); |
| 1566 | platforms.emplace_back(name); |
| 1567 | } |
| 1568 | return new Metadata(platforms); |
| 1569 | } |
| 1570 | else if (name == "process_plugins") |
| 1571 | { |
| 1572 | std::vector<std::string> plugins; |
| 1573 | plugins.emplace_back("gdb-remote"); |
| 1574 | plugins.emplace_back("debugserver/lldb"); |
| 1575 | return new Metadata(plugins); |
| 1576 | } |
| 1577 | else if (name == "current_process_plugin") |
| 1578 | { |
| 1579 | return new Metadata(m_processPlugin); |
| 1580 | } |
| 1581 | return nullptr; |
| 1582 | } |
| 1583 | |
| 1584 | |
| 1585 | bool LldbAdapter::SetProperty(const std::string& name, const Ref<Metadata>& value) |