This is an archive of the discontinued LLVM Phabricator instance.

Creating a startDebugging reverse DAP request handler in lldb-vscode.
ClosedPublic

Authored by ashgti on Jun 21 2023, 10:48 AM.

Details

Summary

Adds support for a reverse DAP request to startDebugging. The new request can be used to launch child processes from lldb scripts, for example it would be start forward to configure a debug configuration for a server and a client allowing you to launch both processes with a single debug configuraiton.

Diff Detail

Event Timeline

ashgti created this revision.Jun 21 2023, 10:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2023, 10:48 AM
ashgti updated this revision to Diff 533349.Jun 21 2023, 11:21 AM

Corrected a makefile reference.

ashgti published this revision for review.Jun 21 2023, 2:30 PM
ashgti added reviewers: wallace, ivanhernandez13.
ashgti added a project: Restricted Project.
wallace accepted this revision.Jun 21 2023, 3:37 PM

pretty nice! Just a few nits, but other than that it's good to go

lldb/tools/lldb-vscode/lldb-vscode.cpp
1475

call it lldb-vscode instead of dap to have the same nomenclature all across

1478
1479
This revision is now accepted and ready to land.Jun 21 2023, 3:37 PM
wallace requested changes to this revision.Jun 21 2023, 3:51 PM

Please write an entry about this in the documentation of lldb-vscode

This revision now requires changes to proceed.Jun 21 2023, 3:51 PM
ashgti updated this revision to Diff 533440.Jun 21 2023, 5:27 PM
ashgti marked 3 inline comments as done.

Adding documentation to the lldb-vscode/README.md.

Please write an entry about this in the documentation of lldb-vscode

Updated with some additional documentation in the lldb-vscode/README.md

wallace accepted this revision.Jun 21 2023, 6:55 PM
This revision is now accepted and ready to land.Jun 21 2023, 6:55 PM
ashgti updated this revision to Diff 533804.Jun 22 2023, 3:32 PM

Enhancing the test coverage and fixing an issue when a reverse request is invoked a request from a DAP request handler.

ashgti updated this revision to Diff 533806.Jun 22 2023, 3:35 PM

Cleaning up the runInTerminal test.

ashgti requested review of this revision.Jun 22 2023, 3:38 PM

Hi @wallace I updated the tests and discovered a deadlock with my implementation of the SendReverseRequest. I refactored the function and added some additional tests to cover this more thoroughly.

ivanhernandez13 accepted this revision.Jun 27 2023, 10:58 AM
ivanhernandez13 added inline comments.
lldb/tools/lldb-vscode/VSCode.cpp
569

Dead code?

This revision is now accepted and ready to land.Jun 27 2023, 10:58 AM
ashgti updated this revision to Diff 535072.Jun 27 2023, 11:18 AM

Removing a dead comment that is not needed.

ashgti marked an inline comment as done.Jun 27 2023, 11:19 AM
wallace accepted this revision.Jun 27 2023, 11:27 AM
lldb/tools/lldb-vscode/VSCode.h
250–254

nit: Could you update this comment that is no longer accurate

ashgti updated this revision to Diff 535864.Jun 29 2023, 9:51 AM

Fixing stale comment.

ashgti marked an inline comment as done.Jun 29 2023, 9:52 AM