[all-commits] [llvm/llvm-project] 695b33: [lldb/API] Overwrite variables with SBLaunchInfo::...

Pavel Labath via All-commits all-commits at lists.llvm.org
Wed Jul 8 04:51:02 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 695b33a56919af8873eecb47cb83fa17a271e99f
      https://github.com/llvm/llvm-project/commit/695b33a56919af8873eecb47cb83fa17a271e99f
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2020-07-08 (Wed, 08 Jul 2020)

  Changed paths:
    M lldb/source/API/SBLaunchInfo.cpp
    M lldb/test/API/python_api/sbenvironment/TestSBEnvironment.py

  Log Message:
  -----------
  [lldb/API] Overwrite variables with SBLaunchInfo::SetEnvironment(append=true)

Summary:
This function was documented to overwrite entries with D76111, which was
adding a couple of similar functions. However, this function (unlike the
functions added in that patch) was/is not actually overwriting variables
-- any pre-existing variables would get ignored.

This behavior does not seem to be intentional. In fact, before the refactor in
D41359, this function could introduce duplicate entries, which could
have very surprising effects both inside lldb and on other applications
(some applications would take the first value, some the second one; in
lldb, attempting to unset a variable could make the second variable
become active, etc.).

Overwriting seems to be the most reasonable behavior here, so change the
code to match documentation.

Reviewers: clayborg, wallace, jingham

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D83306




More information about the All-commits mailing list