aboutsummaryrefslogtreecommitdiff
path: root/source/Expression/ExpressionVariable.cpp
blob: 8bef60fdf1d7b1164f4566b5244efc7bd9e03e06 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//===-- ExpressionVariable.cpp ----------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "lldb/Expression/ExpressionVariable.h"

using namespace lldb_private;

ExpressionVariable::~ExpressionVariable()
{
}

uint8_t *
ExpressionVariable::GetValueBytes()
{
    const size_t byte_size = m_frozen_sp->GetByteSize();
    if (byte_size > 0)
    {
        if (m_frozen_sp->GetDataExtractor().GetByteSize() < byte_size)
        {
            m_frozen_sp->GetValue().ResizeData(byte_size);
            m_frozen_sp->GetValue().GetData (m_frozen_sp->GetDataExtractor());
        }
        return const_cast<uint8_t *>(m_frozen_sp->GetDataExtractor().GetDataStart());
    }
    return NULL;
}

PersistentExpressionState::~PersistentExpressionState ()
{
}