[Lldb-commits] [lldb] [lldb] Add target groups for related targets (PR #229180)
Greg Clayton via lldb-commits
lldb-commits at lists.llvm.org
Mon Oct 12 11:51:20 PDT 2026
================
@@ -0,0 +1,75 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_TARGET_TARGETGROUP_H
+#define LLDB_TARGET_TARGETGROUP_H
+
+#include "lldb/lldb-forward.h"
+
+#include <memory>
+#include <mutex>
+#include <utility>
+#include <vector>
+
+namespace lldb_private {
+
+/// Describes the part a target plays in a target group.
+enum class TargetRole {
+ None = 0,
+ CPU,
+ Accelerator,
+};
+
+/// A group of related targets and the roles they play in that relationship.
+/// Groups are created and owned by a Debugger's TargetGroupList. Deleting a
+/// group makes any retained shared pointer inactive.
+class TargetGroup : public std::enable_shared_from_this<TargetGroup> {
----------------
clayborg wrote:
Do we also want a TargetGroup type enum? A target could end up in multiple target groups and at some point we might want to act on all target groups of a specific type?
```
class TargetGroup ... {
public:
enum class Type {
/// A group of spawned processes if we even support attaching to all spawned child processes
Spawned,
/// A group of processes that are related, such as a CPU related to a GPU target
Related,
};
```
https://github.com/llvm/llvm-project/pull/229180
More information about the lldb-commits
mailing list