This is an archive of the discontinued LLVM Phabricator instance.

Expose active and available platform lists via SBDebugger API
ClosedPublic

Authored by enlight on Jul 21 2017, 9:21 PM.

Details

Summary

The available platform list was previously only accessible via the platform list command, this patch makes it possible to access that list via the SBDebugger API. The active platform list has likewise been exposed via the SBDebugger API.

Diff Detail

Repository
rL LLVM

Event Timeline

enlight created this revision.Jul 21 2017, 9:21 PM
enlight updated this revision to Diff 107775.Jul 21 2017, 10:08 PM

Add docstrings to SWIG bindings.

enlight updated this revision to Diff 107789.Jul 22 2017, 7:43 AM

Update packages/Python/lldbsuite/test/python_api/default-constructor/sb_debugger.py

jingham requested changes to this revision.Jul 22 2017, 11:54 AM

This seems fine. I have a little quibble with the name, inline, and a testing suggestion.

packages/Python/lldbsuite/test/functionalities/platform/TestPlatformPython.py
32–33 ↗(On Diff #107789)

Instead of relying on there always being a remote-linux platform, couldn't you just grab a platform from the Available Platform list make sure it isn't the host platform, and add that?

This revision now requires changes to proceed.Jul 22 2017, 11:54 AM

Thanks for the review Jim, but I only see the testing suggestion, could you elaborate on the other two issues?

Huh, not sure how the other comment vanished. I was concerned that "GetAvailablePlatformAtIndex" didn't actually get a platform, so the name was confusing. I suggested GetAvailablePlatformInfoAtIndex as more accurate.

enlight updated this revision to Diff 108276.Jul 26 2017, 7:34 AM
enlight edited edge metadata.
  • Renamed SBDebugger::GetAvailablePlatformAtIndex() to GetAvailablePlatformInfoAtIndex().
  • Changed PlatformPythonTestCase.test_platform_list to select one of the available platforms instead of hardcoding the remote-linux platform.
enlight marked an inline comment as done.Aug 1 2017, 12:44 AM

I've updated the patch with your suggestions @jingham

clayborg accepted this revision.Aug 7 2017, 8:04 AM
This revision was automatically updated to reflect the committed changes.