[Lldb-commits] [PATCH] D147831: [lldb-vscode] Implement RestartRequest

walter erquinigo via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon May 1 19:12:07 PDT 2023


wallace accepted this revision.
wallace added a comment.
This revision is now accepted and ready to land.

lgtm!



================
Comment at: lldb/tools/lldb-vscode/lldb-vscode.cpp:1983
+  g_vsc.debugger.SetAsync(true);
+  LaunchProcess(*g_vsc.last_launch_or_attach_request);
+
----------------
jgorbe wrote:
> labath wrote:
> > I have no idea if that's a good idea or not, but I'm wondering if, instead of from the last attach request, we should be taking the arguments from lldb. So that if the user say changes the `target.run-args` setting, then the new restart request will take that into account...
> I think the intended way to allow the user to modify the configuration is to use the optional `arguments` field in `RestartRequest`, which the client can use to send the latest version of the config.
> 
> https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Restart
> 
> > ```
> > interface RestartRequest extends Request {
> >   command: 'restart';
> > 
> >   arguments?: RestartArguments;
> > }
> > ```
> > Arguments for restart request.
> > 
> > ```
> > interface RestartArguments {
> >   /**
> >    * The latest version of the `launch` or `attach` configuration.
> >    */
> >   arguments?: LaunchRequestArguments | AttachRequestArguments;
> > }
> > ```
> 
> We can check if the restart request has `arguments` and only used the saved config if that's not the case. What do you think?
> 
> @wallace any opinions here? Is this kind of lldb state manipulation via console commands something that is expected to work correctly in lldb-vscode?
i think it's better to reuse the same arguments that the user passed using the vscode interface. Modifying them in the command line might seems counterintuitive.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147831/new/

https://reviews.llvm.org/D147831



More information about the lldb-commits mailing list