This is an archive of the discontinued LLVM Phabricator instance.

Prevent lldb-vscode tests from source lldbinit file
ClosedPublic

Authored by yinghuitan on Oct 10 2022, 3:03 PM.

Details

Summary

lldb-vscode is hard-coded to source .lldbinit file which causes some tests to
fail on my machine.
This patch adds a new option to control this:

  1. vscode.py and lldb-vscode tests will not source .lldbinit by default
  2. lldb-vscode will source .lldbinit in production if not specified otherwise

Diff Detail

Event Timeline

yinghuitan created this revision.Oct 10 2022, 3:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 10 2022, 3:03 PM
yinghuitan requested review of this revision.Oct 10 2022, 3:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 10 2022, 3:03 PM
clayborg requested changes to this revision.Oct 10 2022, 4:22 PM

Just add a comment as suggested and this is good to go!

lldb/tools/lldb-vscode/lldb-vscode.cpp
1448–1449

Please add a comment stating this is only used for LLDB unit tests and that this isn't part of the actual packet definition for "initialize". Also state something like "When testing lldb-vscode, we never want to source the init files as these files can change the outcome of tests if the user replaces or modifies commands".

This revision now requires changes to proceed.Oct 10 2022, 4:22 PM

Add comment per feedback

clayborg accepted this revision.Oct 11 2022, 2:05 PM
This revision is now accepted and ready to land.Oct 11 2022, 2:05 PM
This revision was automatically updated to reflect the committed changes.