mqt.debugger.dap¶
This module handles DAP capabilities of the debugger.
- class DAPServer(host: str = '127.0.0.1', port: int = 4711)[source]¶
Bases:
objectThe DAP server class.
- code_coordinates_to_pos(line: int, col: int) int[source]¶
Helper method to convert a code line and column to its position idnex.
- code_pos_to_coordinates(pos: int) tuple[int, int][source]¶
Helper method to convert a code position to line and column.
- format_error_cause(cause: ErrorCause) str[source]¶
Format an error cause for output.
- Parameters:
cause (ErrorCause) – The error cause.
- Returns:
The formatted error cause.
- Return type:
- handle_assertion_fail(connection: socket) None[source]¶
Handles the sending of output events when an assertion fails.
- Parameters:
connection (socket) – The client socket.
- handle_client(connection: socket) None[source]¶
Handle incoming messages from the client.
- Parameters:
connection (socket) – The client socket.
- handle_command(command: dict[str, Any]) tuple[dict[str, Any], DAPMessage][source]¶
Handle an incoming command from the client and return the corresponding response.
- Parameters:
command (dict[str, Any]) – The command read from the client.
- Raises:
RuntimeError – If the command is not supported.
- Returns:
The response to the message as a dictionary and the message object.
- Return type:
tuple[dict[str, Any], DAPMessage]
- regular_checks(connection: socket) None[source]¶
Perform regular checks and send events to the client if necessary.
- Parameters:
connection (socket) – The client socket.
- send_message_hierarchy(message: dict[str, str | list[Any] | dict[str, Any]], line: int, column: int, connection: socket) None[source]¶
Send a hierarchy of messages to the client.
- simulation_state: SimulationState¶
- mqt.debugger.dap.adapter
- mqt.debugger.dap.messages
CapabilitiesDAPEventConfigurationDoneDAPMessageContinueDAPMessageDAPEventDAPMessageDisconnectDAPMessageExceptionInfoDAPMessageExitedDAPEventGrayOutDAPEventInitializeDAPMessageInitializedDAPEventLaunchDAPMessageNextDAPMessageOutputDAPEventPauseDAPMessageRequestRestartDAPMessageRestartFrameDAPMessageReverseContinueDAPMessageScopesDAPMessageSetBreakpointsDAPMessageSetExceptionBreakpointsDAPMessageStackTraceDAPMessageStepBackDAPMessageStepInDAPMessageStepOutDAPMessageStopReasonStoppedDAPEventTerminateDAPMessageTerminatedDAPEventThreadsDAPMessageVariablesDAPMessage