[Lldb-commits] [PATCH] D113608: [lldb] Simplify specifying of platform supported architectures

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 10 12:56:25 PST 2021


labath created this revision.
labath added reviewers: JDevlieghere, jasonmolenda.
Herald added subscribers: krytarowski, arichardson, emaste.
labath requested review of this revision.
Herald added a project: LLDB.

The GetSupportedArchitectureAtIndex pattern forces the use of
complicated patterns in both the implementations of the function and in
the various callers.

This patch creates a new method (GetSupportedArchitectures), which
returns a list (vector) of architectures. The
GetSupportedArchitectureAtIndex is kept in order to enable incremental
rollout. Base Platform class contains implementations of both of these
methods, using the other method as the source of truth. Platforms
without infinite stacks should implement at least one of them.

This patch also ports Linux, FreeBSD and NetBSD platforms to the new
API. A new helper function (CreateArchList) is added to simplify the
common task of creating a list of ArchSpecs with the same OS but
different architectures.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113608

Files:
  lldb/include/lldb/Target/Platform.h
  lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
  lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h
  lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
  lldb/source/Plugins/Platform/Linux/PlatformLinux.h
  lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
  lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.h
  lldb/source/Target/Platform.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113608.386292.patch
Type: text/x-patch
Size: 14346 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20211110/7e2836df/attachment-0001.bin>


More information about the lldb-commits mailing list