[Lldb-commits] [PATCH] D98370: [lldb] Fix SBValue::Persist() for constant values

Andy Yankovsky via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 21 03:41:36 PDT 2021


werat added a comment.

In D98370#2686515 <https://reviews.llvm.org/D98370#2686515>, @jingham wrote:

> If persisting already persistent variables is indeed the only failure case, then I wonder if it wouldn't be more straightforward to just see if the ValueObject is already a persistent variable and have Persist just return the incoming variable.

Persisting already persistent variables is not the only valid use case, one might also want to persist variables created via `SBTarget::CreateValueFromData()`.

I guess it is currently not clear from the API, but I would expect `SBValue::Persist()` to produces a new value every time:

  auto v1 = value.Persist();
  auto v2 = value.Persist();
  
  assert(v1.GetName() != v1.GetName())  // modulo comparing char*...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98370/new/

https://reviews.llvm.org/D98370



More information about the lldb-commits mailing list