Respect supportsMemoryReferences in DAP
authorTom Tromey <tromey@adacore.com>
Thu, 27 Jul 2023 19:06:38 +0000 (13:06 -0600)
committerTom Tromey <tromey@adacore.com>
Tue, 1 Aug 2023 19:00:57 +0000 (13:00 -0600)
commit2128d888b888b04edb4553a5359e6e259c792606
tree306541d476c371991ce6a21b309e3c8a290060d9
parentaf93035b2755fef31c67016f68ab9fcdc2074c42
Respect supportsMemoryReferences in DAP

I noticed that the support for memoryReference in the "variables"
output is gated on the client "supportsMemoryReferences" capability.

This patch implements this and makes some other changes to the DAP
memory reference code:

* Remove the memoryReference special case from _SetResult.
  Upstream DAP fixed this oversight in response to
  https://github.com/microsoft/debug-adapter-protocol/issues/414

* Don't use the address of a variable as its memoryReference -- only
  emit this for pointer types.  There's no spec support for the
  previous approach.

* Use strip_typedefs to handle typedefs of pointers.
gdb/python/lib/gdb/dap/evaluate.py
gdb/python/lib/gdb/dap/varref.py
gdb/testsuite/gdb.dap/memory.c
gdb/testsuite/gdb.dap/memory.exp
gdb/testsuite/lib/dap-support.exp