1 | //===-- ValueObjectUpdater.h ------------------------------------*- C++ -*-===// |
2 | // |
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 |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #ifndef LLDB_CORE_VALUEOBJECTUPDATER_H |
10 | #define LLDB_CORE_VALUEOBJECTUPDATER_H |
11 | |
12 | #include "lldb/Core/ValueObject.h" |
13 | |
14 | namespace lldb_private { |
15 | |
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; |
28 | |
29 | public: |
30 | ValueObjectUpdater(lldb::ValueObjectSP in_valobj_sp); |
31 | |
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 |
35 | /// debugging. |
36 | lldb::ValueObjectSP GetSP(); |
37 | |
38 | lldb::ProcessSP GetProcessSP() const; |
39 | }; |
40 | |
41 | } // namespace lldb_private |
42 | |
43 | #endif // LLDB_CORE_VALUEOBJECTUPDATER_H |
44 | |