diff options
author | Tom Tromey <tromey@adacore.com> | 2023-06-28 06:57:16 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-07-21 09:30:12 -0600 |
commit | 812e7caf60b11c1b9ed09f7d5eda47c2178005dc (patch) | |
tree | 83624516f3de4d3dfd0fe3be0504ce177275e696 /gdb/testsuite/gdb.dap | |
parent | 83f362cf8f9539cefdd5df709a347a5396d23c76 (diff) | |
download | gdb-812e7caf60b11c1b9ed09f7d5eda47c2178005dc.zip gdb-812e7caf60b11c1b9ed09f7d5eda47c2178005dc.tar.gz gdb-812e7caf60b11c1b9ed09f7d5eda47c2178005dc.tar.bz2 |
Add instruction bytes to DAP disassembly response
The DAP disassemble command lets the client return the underlying
bytes of the instruction in an implementation-defined format. This
patch updates gdb to return this, and simply uses a hex string of the
bytes as the format.
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Diffstat (limited to 'gdb/testsuite/gdb.dap')
-rw-r--r-- | gdb/testsuite/gdb.dap/basic-dap.exp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.dap/basic-dap.exp b/gdb/testsuite/gdb.dap/basic-dap.exp index 853e153..ef3c535 100644 --- a/gdb/testsuite/gdb.dap/basic-dap.exp +++ b/gdb/testsuite/gdb.dap/basic-dap.exp @@ -191,6 +191,15 @@ set obj [dap_check_request_and_response "disassemble one instruction" \ $insn_pc]] set response [lindex $obj 0] gdb_assert { [dict exists $response body instructions] } "instructions in disassemble output" +foreach insn [dict get $response body instructions] { + gdb_assert {[dict exists $insn instructionBytes]} \ + "instruction bytes in disassemble output" + set bytes [dict get $insn instructionBytes] + gdb_assert {[string length $bytes] % 2 == 0} \ + "even number of digits" + gdb_assert {[regexp "^\[0-9A-Fa-f\]+\$" $bytes]} \ + "instructionBytes is hex" +} set obj [dap_check_request_and_response "command repl" \ evaluate {o expression [s {output 23}] context [s repl]}] |