[Lldb-commits] [PATCH] D138430: [lldb/test] Use SBPlatform info for lldbplatformutil.getPlatform()

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 21 06:44:41 PST 2022


labath created this revision.
labath added a reviewer: JDevlieghere.
Herald added a project: All.
labath requested review of this revision.
Herald added a project: LLDB.

Previously, we just used the platform name. This worked mostly OK, but
it required adding special handling for any unusual (and potentially
downstream) platform plugins, as evidenced by the hardcoding of the
qemu-user platform.

The current implementation was added in
D121605 <https://reviews.llvm.org/D121605>/21c5bb0a636c23ec75b13681c0a6fdb03ecd9c0d <https://reviews.llvm.org/rG21c5bb0a636c23ec75b13681c0a6fdb03ecd9c0d>, which this essentially
reverts and goes back to the previous method of retrieving the platform
name from the platform triple (the "OS" field).

The motivation for D121605 <https://reviews.llvm.org/D121605> was the ability to retrieve the process
without constructing an SBDebugger object (which would be necessary in a
world where SBPlatforms are managed by SBDebuggers). However, this world
did not arrive (mainly due to other commitments on my part), and I now
think that if we do want to go in that direction, that we should just
create a dummy/empty SBDebugger object for holding the initial
SBPlatform.

One benefit of D121605 <https://reviews.llvm.org/D121605> was the unification of getPlatform and
getHostPlatform code paths, and I preserve that benefit by unifying them
in the other direction -- using the host SBPlatform for getHostPlatform.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138430

Files:
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/lldbplatformutil.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138430.476884.patch
Type: text/x-patch
Size: 4065 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20221121/e7b43906/attachment-0001.bin>


More information about the lldb-commits mailing list