LLDB  mainline
ValueObjectConstResultImpl.h
Go to the documentation of this file.
1 //===-- ValueObjectConstResultImpl.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_VALUEOBJECTCONSTRESULTIMPL_H
10 #define LLDB_CORE_VALUEOBJECTCONSTRESULTIMPL_H
11 
13 #include "lldb/lldb-defines.h"
14 #include "lldb/lldb-forward.h"
16 #include "lldb/lldb-types.h"
17 
18 #include <cstddef>
19 #include <cstdint>
20 namespace lldb_private {
21 class CompilerType;
22 class DataExtractor;
23 class Status;
24 class ValueObject;
25 }
26 
27 namespace lldb_private {
28 
29 /// A class wrapping common implementation details for operations in
30 /// ValueObjectConstResult ( & Child ) that may need to jump from the host
31 /// memory space into the target's memory space.
33 public:
35  lldb::addr_t live_address = LLDB_INVALID_ADDRESS);
36 
37  virtual ~ValueObjectConstResultImpl() = default;
38 
39  lldb::ValueObjectSP Dereference(Status &error);
40 
41  ValueObject *CreateChildAtIndex(size_t idx, bool synthetic_array_member,
42  int32_t synthetic_index);
43 
44  lldb::ValueObjectSP
46  bool can_create,
47  ConstString name_const_str = ConstString());
48 
49  lldb::ValueObjectSP AddressOf(Status &error);
50 
52 
53  lldb::ValueObjectSP Cast(const CompilerType &compiler_type);
54 
56  AddressType address_type = eAddressTypeLoad) {
57  m_live_address = addr;
58  m_live_address_type = address_type;
59  }
60 
61  virtual lldb::addr_t GetAddressOf(bool scalar_is_load_address = true,
62  AddressType *address_type = nullptr);
63 
64  virtual size_t GetPointeeData(DataExtractor &data, uint32_t item_idx = 0,
65  uint32_t item_count = 1);
66 
67 private:
71  lldb::ValueObjectSP m_load_addr_backend;
72  lldb::ValueObjectSP m_address_of_backend;
73 
76  operator=(const ValueObjectConstResultImpl &) = delete;
77 };
78 
79 } // namespace lldb_private
80 
81 #endif // LLDB_CORE_VALUEOBJECTCONSTRESULTIMPL_H
lldb_private::ValueObjectConstResultImpl::AddressOf
lldb::ValueObjectSP AddressOf(Status &error)
Definition: ValueObjectConstResultImpl.cpp:115
lldb_private::ValueObjectConstResultImpl::SetLiveAddress
void SetLiveAddress(lldb::addr_t addr=LLDB_INVALID_ADDRESS, AddressType address_type=eAddressTypeLoad)
Definition: ValueObjectConstResultImpl.h:55
lldb_private::ValueObjectConstResultImpl::Dereference
lldb::ValueObjectSP Dereference(Status &error)
Definition: ValueObjectConstResultImpl.cpp:40
lldb_private::ValueObjectConstResultImpl::Cast
lldb::ValueObjectSP Cast(const CompilerType &compiler_type)
Definition: ValueObjectConstResultImpl.cpp:144
lldb_private::ValueObjectConstResultImpl::m_load_addr_backend
lldb::ValueObjectSP m_load_addr_backend
Definition: ValueObjectConstResultImpl.h:71
lldb-defines.h
lldb_private::AddressType
AddressType
Definition: lldb-private-enumerations.h:30
lldb_private::ValueObjectConstResultImpl::GetSyntheticChildAtOffset
lldb::ValueObjectSP GetSyntheticChildAtOffset(uint32_t offset, const CompilerType &type, bool can_create, ConstString name_const_str=ConstString())
Definition: ValueObjectConstResultImpl.cpp:105
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::ValueObjectConstResultImpl::operator=
const ValueObjectConstResultImpl & operator=(const ValueObjectConstResultImpl &)=delete
lldb-private-enumerations.h
lldb_private::ValueObjectConstResultImpl::GetPointeeData
virtual size_t GetPointeeData(DataExtractor &data, uint32_t item_idx=0, uint32_t item_count=1)
Definition: ValueObjectConstResultImpl.cpp:172
lldb_private::ValueObjectConstResultImpl::m_impl_backend
ValueObject * m_impl_backend
Definition: ValueObjectConstResultImpl.h:68
lldb_private::ValueObjectConstResultImpl::ValueObjectConstResultImpl
ValueObjectConstResultImpl(ValueObject *valobj, lldb::addr_t live_address=LLDB_INVALID_ADDRESS)
Definition: ValueObjectConstResultImpl.cpp:34
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::ValueObjectConstResultImpl::m_live_address_type
AddressType m_live_address_type
Definition: ValueObjectConstResultImpl.h:70
lldb_private::ValueObjectConstResultImpl::m_live_address
lldb::addr_t m_live_address
Definition: ValueObjectConstResultImpl.h:69
lldb_private::DataExtractor
Definition: DataExtractor.h:48
lldb_private::ValueObjectConstResultImpl::GetLiveAddress
lldb::addr_t GetLiveAddress()
Definition: ValueObjectConstResultImpl.h:51
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::ValueObjectConstResultImpl::CreateChildAtIndex
ValueObject * CreateChildAtIndex(size_t idx, bool synthetic_array_member, int32_t synthetic_index)
Definition: ValueObjectConstResultImpl.cpp:47
lldb_private::ValueObjectConstResultImpl::GetAddressOf
virtual lldb::addr_t GetAddressOf(bool scalar_is_load_address=true, AddressType *address_type=nullptr)
Definition: ValueObjectConstResultImpl.cpp:155
lldb_private::eAddressTypeLoad
@ eAddressTypeLoad
Address is an address as in the current target inferior process.
Definition: lldb-private-enumerations.h:34
lldb-types.h
lldb_private::Status
Definition: Status.h:44
lldb_private::ValueObject
ValueObject:
Definition: ValueObject.h:105
uint32_t
lldb_private::ValueObjectConstResultImpl
A class wrapping common implementation details for operations in ValueObjectConstResult ( & Child ) t...
Definition: ValueObjectConstResultImpl.h:32
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:86
lldb_private::ValueObjectConstResultImpl::m_address_of_backend
lldb::ValueObjectSP m_address_of_backend
Definition: ValueObjectConstResultImpl.h:72
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
lldb-forward.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
ConstString.h
lldb_private::ValueObjectConstResultImpl::~ValueObjectConstResultImpl
virtual ~ValueObjectConstResultImpl()=default
lldb_private::LineStatus::Status
@ Status