1 //===-- ValueObjectUpdater.h ------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_CORE_VALUEOBJECTUPDATER_H
10 #define LLDB_CORE_VALUEOBJECTUPDATER_H
12 #include "lldb/Core/ValueObject.h"
14 namespace lldb_private {
16 /// A value object class that is seeded with the static variable value
17 /// and it vends the user facing value object. If the type is dynamic it can
18 /// vend the dynamic type. If this user type also has a synthetic type
19 /// associated with it, it will vend the synthetic type. The class watches the
20 /// process' stop ID and will update the user type when needed.
21 class ValueObjectUpdater {
22 /// The root value object is the static typed variable object.
23 lldb::ValueObjectSP m_root_valobj_sp;
24 /// The user value object is the value object the user wants to see.
25 lldb::ValueObjectSP m_user_valobj_sp;
26 /// The stop ID that m_user_valobj_sp is valid for.
27 uint32_t m_stop_id = UINT32_MAX;
30 ValueObjectUpdater(lldb::ValueObjectSP in_valobj_sp);
32 /// Gets the correct value object from the root object for a given process
33 /// stop ID. If dynamic values are enabled, or if synthetic children are
34 /// enabled, the value object that the user wants to see might change while
36 lldb::ValueObjectSP GetSP();
38 lldb::ProcessSP GetProcessSP() const;
41 } // namespace lldb_private
43 #endif // LLDB_CORE_VALUEOBJECTUPDATER_H