This is an archive of the discontinued LLVM Phabricator instance.

[lldb-vscode] Convert launch_info and attach_info to local variables
ClosedPublic

Authored by anton.kolesov on Mar 23 2020, 1:51 AM.

Details

Summary

Those fields inside of the global variable can be local variables because
they are used in only inside of one function: request_launch for launch_info
and request_attach for attach_info.

To avoid confusion an already existing local variable attach_info of
request_attach has been renamed to better reflect its purpose.

Diff Detail

Event Timeline

anton.kolesov created this revision.Mar 23 2020, 1:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 23 2020, 1:51 AM
labath accepted this revision.Mar 23 2020, 2:26 AM

Sounds like a good idea. Could you do the same for attach_info (it looks like it should be possible)? Otherwise, one is left wondering about what's the difference...

This revision is now accepted and ready to land.Mar 23 2020, 2:26 AM

Sounds like a good idea. Could you do the same for attach_info (it looks like it should be possible)? Otherwise, one is left wondering about what's the difference...

I have that as my next patch - it seems like something that should be in a separate commit, but in the same pull request, but I don't know how to properly submit patch series for review at Phabricator - only through "related revisions", I presume?

Sounds like a good idea. Could you do the same for attach_info (it looks like it should be possible)? Otherwise, one is left wondering about what's the difference...

I have that as my next patch - it seems like something that should be in a separate commit, but in the same pull request, but I don't know how to properly submit patch series for review at Phabricator - only through "related revisions", I presume?

You can (and should) use the "related revisions" functionality to denote the relationship between patches, but the purpose of this relationship is to make it easier to review by explaining what depends on what. We don't really have a concept of a "pull request" consisting of multiple patches, which get all committed as a group. Normally each patch should make sense on its own, even if it's not immediately useful (e.g. because it introduces an interface that is not yet used by anyone). The "related" patches can then explain/demonstrate how it's going to be used, but the preceding patches don't need to wait for a green light on the entire group to be committed. If there's some deviation from this (e.g. a preparatory refactoring patch makes some code substantially more complicated and so it may not be desired if the latter patch is not accepted, or there is some uncertainty about the overall direction of the patchset), it should be called out explicitly.

But none of this is really relevant for this patch, which is so simple you could have done it in one commit (and it could be argued that it *should* be done in a single commit, as doing it partway introduces a somewhat inconsistent state, which is undesirable).

clayborg accepted this revision.Mar 23 2020, 10:54 AM

Yes, this works now that we are creating the target in this function.

anton.kolesov retitled this revision from [lldb-vscode] Convert g_vsc.launch_info to a local variable to [lldb-vscode] Convert launch_info and attach_info to local variables.
anton.kolesov edited the summary of this revision. (Show Details)

Added attach_info conversion into the same revision.

labath accepted this revision.Mar 25 2020, 12:51 AM

still lgtm, just make sure to clang-format before committing.

This revision was automatically updated to reflect the committed changes.