Files
Dave Lee b32b74af7c [Debug] Print only description of value types that conform to CustomStringConvertible (#84677)
This is for lldb, where the `po` command for Swift is implemented in `_DebuggerSupport.stringForPrintObject`.

Up to now, a Swift struct which conforms to `CustomStringConvertible` will print both its `description`, and also recursively print its internals.

This differs from a class, where only the `description` is printed.

This changes `stringForPrintObject` to print only the `description` of value types that conform to `CustomStringConvertible` (or `debugDescription` for `CustomDebugStringConvertible`) – unless the also type conforms to `CustomReflectable`, in which case its children are printed.

This issue was raised for `FilePath`, which prints excessively verbosely, like so:

```
(lldb) po FilePath("/tmp")
▿ "/tmp"
  ▿ _storage : "/tmp"
    ▿ nullTerminatedStorage : 5 elements
      ▿ 0 : SystemChar
        - rawValue : 47
      ▿ 1 : SystemChar
        - rawValue : 116
      ▿ 2 : SystemChar
        - rawValue : 109
      ▿ 3 : SystemChar
        - rawValue : 112
      ▿ 4 : SystemChar
        - rawValue : 0
```

rdar://161919005
2026-03-16 18:47:59 -07:00
..
…
…
…