2016-11-26 13:23:44 +08:00
|
|
|
//===-- Expression.cpp ------------------------------------------*- C++ -*-===//
|
2015-09-16 05:13:50 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2015-09-16 05:13:50 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "lldb/Expression/Expression.h"
|
|
|
|
#include "lldb/Target/ExecutionContextScope.h"
|
|
|
|
#include "lldb/Target/Target.h"
|
|
|
|
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
2019-11-12 17:04:32 +08:00
|
|
|
Expression::Expression(Target &target)
|
|
|
|
: m_target_wp(target.shared_from_this()),
|
2015-09-16 05:13:50 +08:00
|
|
|
m_jit_start_addr(LLDB_INVALID_ADDRESS),
|
|
|
|
m_jit_end_addr(LLDB_INVALID_ADDRESS) {
|
|
|
|
// Can't make any kind of expression without a target.
|
|
|
|
assert(m_target_wp.lock());
|
|
|
|
}
|
|
|
|
|
2019-11-12 17:04:32 +08:00
|
|
|
Expression::Expression(ExecutionContextScope &exe_scope)
|
|
|
|
: m_target_wp(exe_scope.CalculateTarget()),
|
2015-09-16 05:13:50 +08:00
|
|
|
m_jit_start_addr(LLDB_INVALID_ADDRESS),
|
|
|
|
m_jit_end_addr(LLDB_INVALID_ADDRESS) {
|
|
|
|
assert(m_target_wp.lock());
|
|
|
|
}
|