google / google/cppdap

ignores terminated event when body is empty (DAP protocol violation)

Đang mở
#152 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C++
Star
192
Fork
66
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

When cppdap receives a terminated event with an empty body (e.g., {"type":"event","event":"terminated","body":{}}), it ​​silently skips processing​​ the event.

When debugging Python applications using `cppdap`, the debug adapter correctly sends a terminated event when the application finishes, but with an empty body field. Currently, cppdap silently ignores these events, preventing my application from handling the proper debug session termination.

this is debugpy`s log:

```
D+00000.049: Server[1] --> {
"pydevd_cmd_id": 129,
"seq": 62,
"type": "event",
"event": "terminated",
"body": {}
}

D+00000.050: /handling #62 event "terminated" from Server[1]/
Closing Server[1] message stream

D+00000.050: Exiting message loop for channel Server[1]: No more messages

I+00000.051: /handling disconnect from Server[1]/
Server[1] has disconnected; finalizing Session[1].

I+00000.051: All debug servers disconnected; waiting for remaining sessions...

D+00000.051: /handling disconnect from Server[1]/
Client[1] <-- {
"seq": 30,
"type": "event",
"event": "terminated"
}
```

According to the DAP protocol specification, the body field in terminated events is optional and may be empty. cppdap should properly process these events regardless of the body content.

Additionally, I believe that in commit https://github.com/google/cppdap/commit/574190fb634d803c8abc66838e5b8d639d6e2ee2, while modifications were made to address similar issues, it still fails to properly handle events with empty bodies as intended.

related issue: https://github.com/google/cppdap/issues/81

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.