[Lldb-commits] [lldb] [lldb-dap] Migrating 'threads' request to structured types. (PR #142510)

John Harrison via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 3 17:48:14 PDT 2025


ashgti wrote:

> Can you add a `Thread` serialization/deserialization unit test?

I added some unit tests but looking at this a bit more, I took some time to try a slightly different approach to validating the serialization logic.

Specifically, using `roundtrip` and the individual asserts on each field felt like a lot of boiler plate.

I have a slightly different approach in my test that uses a few of the `llvm::json` helpers (`parse` and `Value`) to convert our POD types into other types that have `==` operators for making comparisons more straight forward.

Additionally, I also think we can support just a `fromJSON` or `toJSON` case as well with this approach.

I also tweaked the `ProtocolTypesTest.DisassembledInstruction` test as well, because the `Thread` type is fairly trivial and I wanted to make sure this worked okay for a more complex type.

Let me know what you think

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


More information about the lldb-commits mailing list