Closed jonahgraham closed 1 year ago
The new UART code can fail to open the UART and it leads to weird feedback.
The setup is to have a typo in the port:
"uart": { "serialPort": "/mistake", }
This leads to a {} in the debug console, here you see it while running verbose:
{}
The underlying issue is lost because it is on node's output which gets interpreted by VSCode as DAP and it falls over a little here as a result.
Running the adapter in server mode:
https://github.com/eclipse-cdt-cloud/cdt-gdb-adapter/blob/92bb15046fea82256742a69f0b240129a1949a76/.vscode/launch.json#L16
and connecting to it with "debugServer": 4711 in the launch.json shows what ended up on the output in the debug console:
"debugServer": 4711
launch.json
The key part is:
(node:479803) UnhandledPromiseRejectionWarning: Error: Error: No such file or directory, cannot open /mistake
Therefore this PR adds error handling on serial port to make sure errors are passed back to the user.
@AdhamRagabMCHP - can you have a review of this please.
The new UART code can fail to open the UART and it leads to weird feedback.
The setup is to have a typo in the port:
This leads to a
{}
in the debug console, here you see it while running verbose:The underlying issue is lost because it is on node's output which gets interpreted by VSCode as DAP and it falls over a little here as a result.
Running the adapter in server mode:
https://github.com/eclipse-cdt-cloud/cdt-gdb-adapter/blob/92bb15046fea82256742a69f0b240129a1949a76/.vscode/launch.json#L16
and connecting to it with
"debugServer": 4711
in thelaunch.json
shows what ended up on the output in the debug console:The key part is:
Therefore this PR adds error handling on serial port to make sure errors are passed back to the user.