[Lldb-commits] [lldb] [lldb] Add support for unique target ids (PR #160736)

via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 25 10:52:42 PDT 2025


jimingham wrote:

> In the context of MCP support, we [have been discussing](https://github.com/llvm/llvm-project/issues/158676) adding a unique debugger identifier. If we're going to come up with something unique, it may be nice to make it globally unique, even across debuggers.

I'm confused.  Debugger's already have a unique ID:

Debugger's already have a unique, monotonically increasing id:

```
Debugger::Debugger(lldb::LogOutputCallback log_callback, void *baton)
    : UserID(g_unique_id++),

```

That's what gets returned by Debugger::GetID().

The problem here is that we refer to Targets just by their index in the target list.  

But I wonder if it wouldn't be better to change THAT, and have the targets listed by this unique ID instead.  It's kind of bogus that if you have three targets, and you remove the middle one, that changes how you refer to the targets in all the command interfaces for them.

https://github.com/llvm/llvm-project/pull/160736


More information about the lldb-commits mailing list