Page MenuHomePhabricator

Add environment var LLDBVSCODE_SKIP_INIT_FILES to lldb-vscode
Needs ReviewPublic

Authored by aadsm on Dec 1 2019, 7:12 PM.

Details

Summary

lldb has the -x option but this doesn't exist at all for lldb-vscode. To be honest my main goal is the ability to run the lldb-vscode tests without an lldbinit file polluting it.
The DAP doesn't seem to have it (https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Initialize) so we're adding it as an env var.

Event Timeline

aadsm created this revision.Dec 1 2019, 7:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 1 2019, 7:12 PM
aadsm updated this revision to Diff 231629.Dec 1 2019, 7:17 PM

Oops, wrnog default

If MS VS Code IDE itself will never pass this to the "initialize" packet, then we might just want to use an env var instead? You should probably get rid of https://reviews.llvm.org/D70886 and just modify this patch?

aadsm planned changes to this revision.Dec 2 2019, 11:01 AM

Yes, I'll change this to env it makes more sense.

aadsm updated this revision to Diff 231759.Dec 2 2019, 12:19 PM

Use an env var instead

aadsm retitled this revision from Add skipInitFiles option to lldb-vscode initialize to Add environment var LLDBVSCODE_SKIP_INIT_FILES to lldb-vscode.Dec 2 2019, 12:20 PM
aadsm edited the summary of this revision. (Show Details)
clayborg added inline comments.Dec 2 2019, 2:23 PM
lldb/tools/lldb-vscode/lldb-vscode.cpp
64

make singleton function:

bool GetSkipInitFiles() {
  static const bool skip_init = getenv("LLDBVSCODE_SKIP_INIT_FILES") != NULL;
  return skip_init;
}
aadsm updated this revision to Diff 231807.Dec 2 2019, 6:16 PM

Put the logic into a function