[Lldb-commits] [lldb] [lldb] Track native and accelerator target relationships (PR #229180)
Greg Clayton via lldb-commits
lldb-commits at lists.llvm.org
Thu Oct 8 11:48:11 PDT 2026
clayborg wrote:
> It seems to me like you are introducing the notion of a target group here. I imagine an lldb where I've made a bunch of native targets, and then each of them has a bunch of associated accelerator targets and now I want to start acting on them - do something to some one or all the accelerator targets of native target A. First I've got to go ferret out native target A from the target list, then tell which of the other targets are associated with A, etc. That could get messy quickly.
>
> Seems to me if you are going to introduce target groups, then you should introduce target groups as an actual thing. I think that's going to make everything easier downstream.
These are really target relationships. The native CPU target, can own one or more GPU targets. These is a relationship between the targets where a GPU target might need to halt the CPU target in order to do something, and vice versa, the CPU target might want to halt the GPU target when it stops. Also, users might want to switch between the GPU and CPU targets that are related. This current approach allows us to quick get from the parent CPU target to the one and only GPU target, though there may be more. Many GPU targets want the CPU target to stop when the GPU stops, and possibly the reverse as well.
Target groups seem to make this relationship a bit less clear. Do you envision a target group having a parent target in it? If so, then this will be easy to implement and make it work for GPUs. If not, the parent/child relationship is lost and makes things like selecting the CPU vs GPU target a bit more work where we must iterate over the list of targets in a target group and figuring it out instead of using a clear parent/child relationship.
Let us know what you envision and we can see if we can make it work.
https://github.com/llvm/llvm-project/pull/229180
More information about the lldb-commits
mailing list