[Lldb-commits] [PATCH] D71748: [lldb] Make that we can call HostInfo::Initialize and HostInfo::Terminate multiple times

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Dec 20 02:49:09 PST 2019


teemperor created this revision.
teemperor added a reviewer: labath.
Herald added subscribers: lldb-commits, JDevlieghere, abidh.
Herald added a project: LLDB.

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.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D71748

Files:
  lldb/source/Host/common/HostInfoBase.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71748.234848.patch
Type: text/x-patch
Size: 6916 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191220/171a06a0/attachment.bin>


More information about the lldb-commits mailing list