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>
20namespace lldb_private {
21class CompilerType;
22class DataExtractor;
23class Status;
24class ValueObject;
25}
26
27namespace 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.
33public:
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
67private:
71 lldb::ValueObjectSP m_address_of_backend;
72
76};
77
78} // namespace lldb_private
79
80#endif // LLDB_CORE_VALUEOBJECTCONSTRESULTIMPL_H
static llvm::raw_ostream & error(Stream &strm)
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
A uniqued constant string class.
Definition: ConstString.h:39
An data extractor class.
Definition: DataExtractor.h:48
An error handling class.
Definition: Status.h:44
A class wrapping common implementation details for operations in ValueObjectConstResult ( & Child ) t...
lldb::ValueObjectSP GetSyntheticChildAtOffset(uint32_t offset, const CompilerType &type, bool can_create, ConstString name_const_str=ConstString())
virtual size_t GetPointeeData(DataExtractor &data, uint32_t item_idx=0, uint32_t item_count=1)
void SetLiveAddress(lldb::addr_t addr=LLDB_INVALID_ADDRESS, AddressType address_type=eAddressTypeLoad)
ValueObject * CreateChildAtIndex(size_t idx, bool synthetic_array_member, int32_t synthetic_index)
lldb::ValueObjectSP Cast(const CompilerType &compiler_type)
const ValueObjectConstResultImpl & operator=(const ValueObjectConstResultImpl &)=delete
virtual lldb::addr_t GetAddressOf(bool scalar_is_load_address=true, AddressType *address_type=nullptr)
lldb::ValueObjectSP Dereference(Status &error)
ValueObjectConstResultImpl(const ValueObjectConstResultImpl &)=delete
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:74
A class that represents a running process on the host machine.
@ eAddressTypeLoad
Address is an address as in the current target inferior process.
uint64_t addr_t
Definition: lldb-types.h:83