[all-commits] [llvm/llvm-project] b23717: [lldb] Make that we can call HostInfo::Initialize ...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Fri Dec 20 03:52:27 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b2371791fc74b2ecad7f608ff8592ec512d098e6
      https://github.com/llvm/llvm-project/commit/b2371791fc74b2ecad7f608ff8592ec512d098e6
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2019-12-20 (Fri, 20 Dec 2019)

  Changed paths:
    M lldb/source/Host/common/HostInfoBase.cpp

  Log Message:
  -----------
  [lldb] Make that we can call HostInfo::Initialize and HostInfo::Terminate multiple times

Summary:
HostInfo's state isn't actually fully rested after calling ::Terminate. Currently we only reset the
values of all the `HostInfoBaseFields` but not all the variables with static storage that
keep track of whether the fields need to be initialised. This breaks random unit tests as running
them twice (or running multiple test instances in one run) will cause that the second time
we ask HostInfo for any information we get the default value back for any field.

This patch moves all the once_flag's into the `HostInfoBaseFields` so that they also get reseted
by ::Terminate and removes all the `success` bools. We should also rewrite half this code but
I would prefer if my tests aren't broken over the holidays so let's just put some duct tape on it
for now.

Reviewers: labath

Reviewed By: labath

Subscribers: abidh, JDevlieghere, lldb-commits

Tags: #lldb

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




More information about the All-commits mailing list