aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dap
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-07-27 13:06:38 -0600
committerTom Tromey <tromey@adacore.com>2023-08-01 13:00:57 -0600
commit2128d888b888b04edb4553a5359e6e259c792606 (patch)
tree306541d476c371991ce6a21b309e3c8a290060d9 /gdb/testsuite/gdb.dap
parentaf93035b2755fef31c67016f68ab9fcdc2074c42 (diff)
downloadgdb-2128d888b888b04edb4553a5359e6e259c792606.zip
gdb-2128d888b888b04edb4553a5359e6e259c792606.tar.gz
gdb-2128d888b888b04edb4553a5359e6e259c792606.tar.bz2
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.
Diffstat (limited to 'gdb/testsuite/gdb.dap')
-rw-r--r--gdb/testsuite/gdb.dap/memory.c2
-rw-r--r--gdb/testsuite/gdb.dap/memory.exp2
2 files changed, 4 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.dap/memory.c b/gdb/testsuite/gdb.dap/memory.c
index 3b9f613..630e23d 100644
--- a/gdb/testsuite/gdb.dap/memory.c
+++ b/gdb/testsuite/gdb.dap/memory.c
@@ -19,6 +19,8 @@
uint32_t thirty_two = 7;
+uint32_t *thirty_two_p = &thirty_two;
+
int main ()
{
return 0; /* BREAK */
diff --git a/gdb/testsuite/gdb.dap/memory.exp b/gdb/testsuite/gdb.dap/memory.exp
index ab0516d..d702d5b 100644
--- a/gdb/testsuite/gdb.dap/memory.exp
+++ b/gdb/testsuite/gdb.dap/memory.exp
@@ -47,6 +47,8 @@ set obj [dap_check_request_and_response "evaluate global" \
evaluate {o expression [s thirty_two]}]
dap_match_values "global value" [lindex $obj 0] "body result" 7
+set obj [dap_check_request_and_response "evaluate global pointer" \
+ evaluate {o expression [s thirty_two_p]}]
set addr [dict get [lindex $obj 0] body memoryReference]
set obj [dap_check_request_and_response "read memory" \