Skip to content

Commit 76f6187

Browse files
committed
Specify that the debug messages follow the debug adapter protocol
1 parent 650fd75 commit 76f6187

File tree

1 file changed

+42
-3
lines changed

1 file changed

+42
-3
lines changed

docs/messaging.rst

+42-3
Original file line numberDiff line numberDiff line change
@@ -1018,13 +1018,39 @@ This message type is used with debugging kernels to request specific actions
10181018
to be performed by the debugger such as adding a breakpoint or stepping into
10191019
a code.
10201020

1021+
The contents of debug requests and replies respectively follow the schemas of the
1022+
``Request`` and ``Response`` messages of the *Debug Adapter Protocol* (DAP_).
1023+
10211024
Message type: ``debug_request``::
10221025

1023-
content = {}
1026+
content = {
1027+
# The type of debug message
1028+
'type': 'request',
1029+
# A unique sequence number
1030+
'seq': int,
1031+
# The command to execute
1032+
'command': str
1033+
# Optional: arguments for the command
1034+
'arguments': {}
1035+
}
10241036

10251037
Message type: ``debug_reply``::
10261038

1027-
content = {}
1039+
content = {
1040+
# The type of debug message
1041+
'type': 'response',
1042+
# Sequence number of the corresponding request
1043+
'request_seq': int
1044+
# Outcome of the request.
1045+
# - True if the request was successful. Then the 'body' attribute may contain the result of the request.
1046+
# - False if the request failed. Then the 'message' attributes contains the short-form error,
1047+
# and 'body' may contain additional information.
1048+
'success': bool,
1049+
# Optional: short-form error in case of failure
1050+
'message': str,
1051+
# Optional: request result in case of success, and further failure information otherwise.
1052+
'body': any
1053+
}
10281054

10291055
The ``content`` dict can be any JSON information used by debugging frontends
10301056
and kernels.
@@ -1312,9 +1338,21 @@ Debug event
13121338
This message type is used by debugging kernels to send debugging events to the
13131339
frontend.
13141340

1341+
The content of the debug events follows the schema of the ``Event`` message of
1342+
the *Debug Adapter Protocol* (DAP_).
1343+
13151344
Message type: ``debug_event``::
13161345

1317-
content = {}
1346+
content = {
1347+
# The type of debug message
1348+
'type': 'event',
1349+
# A unique sequence number
1350+
'seq': int,
1351+
# Type of event
1352+
'event': str
1353+
# Optional: event-specific information
1354+
'body': {}
1355+
}
13181356

13191357
The ``content`` dict can be any JSON information used by debugging frontends.
13201358

@@ -1511,3 +1549,4 @@ Known *not* affected frontends:
15111549

15121550
.. _ZeroMQ: http://zeromq.org
15131551
.. _nteract: https://nteract.io
1552+
.. _DAP: https://microsoft.github.io/debug-adapter-protocol/specification

0 commit comments

Comments
 (0)