This is an archive of the discontinued LLVM Phabricator instance.

[dotest] Add the ability to set environment variables for the inferior.
ClosedPublic

Authored by JDevlieghere on Jun 25 2019, 1:48 PM.

Details

Summary

This patch adds a dotest flag for setting environment variables for the inferior. This is different from the current --env flag, which sets variables in the debugger's environment. This allows us to set things like LD_LIBRARY_PATH for testing.

Diff Detail

Repository
rL LLVM

Event Timeline

JDevlieghere created this revision.Jun 25 2019, 1:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 25 2019, 1:48 PM
amccarth added inline comments.
lldb/packages/Python/lldbsuite/test/lldbtest.py
1861 ↗(On Diff #206523)

env or settings set target.env-vars? On Windows, where spaces in paths are common, this works:

(lldb) settings set target.env-vars "MY_PATH=C:\Program Files\stuff"

but this doesn't:

(lldb) env "MY_PATH=C:\Program Files\stuff"
JDevlieghere marked 2 inline comments as done.
JDevlieghere added inline comments.
lldb/packages/Python/lldbsuite/test/lldbtest.py
1861 ↗(On Diff #206523)

I've updated the diff, but this sounds more like a bug in the alias?

The LGTM, but I wasn't nominated as a reviewer, and I was mostly looking at it from the point of Windows compatibility.

davide accepted this revision.Jun 26 2019, 9:10 AM
This revision is now accepted and ready to land.Jun 26 2019, 9:10 AM
This revision was automatically updated to reflect the committed changes.
JDevlieghere marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2019, 9:12 AM