[Lldb-commits] [lldb] [lldb-dap] Updating VariableDescription to use GetDescription() as a fallback. (PR #77026)

John Harrison via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 5 17:06:38 PST 2024


ashgti wrote:

> Looks fine to me. Can we add a test?

Updated the existing tests to check the adjusted format.

One issue I did notice with tests is that the response to an expression will include a response are automatically persisted by `SBValue::GetDescription()`, so you will see the value name in the response, for example:

```swift
// Example swift struct.
struct Event: Identifiable, Comparable {
  let id: String
  let name: String
  let time: DateInterval
  var count = 0
}
```

```
> self
(Calendar.Event) $R1 = {
  id = "e1"
  name = "Event 1"
  time = (start = 2024-01-03 17:00:00 UTC, duration = Swift.Double @ 0x0000600001754928)
  count = (_value = 0)
}
> self
(Calendar.Event) $R2 = {
  id = "e1"
  name = "Event 1"
  time = (start = 2024-01-03 17:00:00 UTC, duration = Swift.Double @ 0x0000600001754928)
  count = (_value = 0)
}
> $R2.count + 2
2
```

Screenshot of how this looks in VS Code:

<img width="896" alt="Screenshot 2024-01-05 at 5 03 43 PM" src="https://github.com/llvm/llvm-project/assets/22535/4e4e2dc9-3013-4936-b621-eaa6c59d7f47">




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


More information about the lldb-commits mailing list