15ffd83dbSDimitry Andric //===-- SBFrame.cpp -------------------------------------------------------===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric
90b57cec5SDimitry Andric #include <algorithm>
100b57cec5SDimitry Andric #include <set>
110b57cec5SDimitry Andric #include <string>
120b57cec5SDimitry Andric
130b57cec5SDimitry Andric #include "lldb/API/SBFrame.h"
140b57cec5SDimitry Andric
150b57cec5SDimitry Andric #include "lldb/lldb-types.h"
160b57cec5SDimitry Andric
170b57cec5SDimitry Andric #include "SBReproducerPrivate.h"
180b57cec5SDimitry Andric #include "Utils.h"
190b57cec5SDimitry Andric #include "lldb/Core/Address.h"
200b57cec5SDimitry Andric #include "lldb/Core/StreamFile.h"
210b57cec5SDimitry Andric #include "lldb/Core/ValueObjectRegister.h"
220b57cec5SDimitry Andric #include "lldb/Core/ValueObjectVariable.h"
230b57cec5SDimitry Andric #include "lldb/Expression/ExpressionVariable.h"
240b57cec5SDimitry Andric #include "lldb/Expression/UserExpression.h"
250b57cec5SDimitry Andric #include "lldb/Host/Host.h"
260b57cec5SDimitry Andric #include "lldb/Symbol/Block.h"
270b57cec5SDimitry Andric #include "lldb/Symbol/Function.h"
280b57cec5SDimitry Andric #include "lldb/Symbol/Symbol.h"
290b57cec5SDimitry Andric #include "lldb/Symbol/SymbolContext.h"
300b57cec5SDimitry Andric #include "lldb/Symbol/Variable.h"
310b57cec5SDimitry Andric #include "lldb/Symbol/VariableList.h"
320b57cec5SDimitry Andric #include "lldb/Target/ExecutionContext.h"
330b57cec5SDimitry Andric #include "lldb/Target/Process.h"
340b57cec5SDimitry Andric #include "lldb/Target/RegisterContext.h"
350b57cec5SDimitry Andric #include "lldb/Target/StackFrame.h"
360b57cec5SDimitry Andric #include "lldb/Target/StackFrameRecognizer.h"
370b57cec5SDimitry Andric #include "lldb/Target/StackID.h"
380b57cec5SDimitry Andric #include "lldb/Target/Target.h"
390b57cec5SDimitry Andric #include "lldb/Target/Thread.h"
400b57cec5SDimitry Andric #include "lldb/Utility/ConstString.h"
410b57cec5SDimitry Andric #include "lldb/Utility/Stream.h"
420b57cec5SDimitry Andric
430b57cec5SDimitry Andric #include "lldb/API/SBAddress.h"
440b57cec5SDimitry Andric #include "lldb/API/SBDebugger.h"
450b57cec5SDimitry Andric #include "lldb/API/SBExpressionOptions.h"
460b57cec5SDimitry Andric #include "lldb/API/SBStream.h"
470b57cec5SDimitry Andric #include "lldb/API/SBSymbolContext.h"
480b57cec5SDimitry Andric #include "lldb/API/SBThread.h"
490b57cec5SDimitry Andric #include "lldb/API/SBValue.h"
500b57cec5SDimitry Andric #include "lldb/API/SBVariablesOptions.h"
510b57cec5SDimitry Andric
520b57cec5SDimitry Andric #include "llvm/Support/PrettyStackTrace.h"
530b57cec5SDimitry Andric
540b57cec5SDimitry Andric using namespace lldb;
550b57cec5SDimitry Andric using namespace lldb_private;
560b57cec5SDimitry Andric
SBFrame()570b57cec5SDimitry Andric SBFrame::SBFrame() : m_opaque_sp(new ExecutionContextRef()) {
580b57cec5SDimitry Andric LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBFrame);
590b57cec5SDimitry Andric }
600b57cec5SDimitry Andric
SBFrame(const StackFrameSP & lldb_object_sp)610b57cec5SDimitry Andric SBFrame::SBFrame(const StackFrameSP &lldb_object_sp)
620b57cec5SDimitry Andric : m_opaque_sp(new ExecutionContextRef(lldb_object_sp)) {
630b57cec5SDimitry Andric LLDB_RECORD_CONSTRUCTOR(SBFrame, (const lldb::StackFrameSP &),
640b57cec5SDimitry Andric lldb_object_sp);
650b57cec5SDimitry Andric }
660b57cec5SDimitry Andric
SBFrame(const SBFrame & rhs)670b57cec5SDimitry Andric SBFrame::SBFrame(const SBFrame &rhs) : m_opaque_sp() {
680b57cec5SDimitry Andric LLDB_RECORD_CONSTRUCTOR(SBFrame, (const lldb::SBFrame &), rhs);
690b57cec5SDimitry Andric
700b57cec5SDimitry Andric m_opaque_sp = clone(rhs.m_opaque_sp);
710b57cec5SDimitry Andric }
720b57cec5SDimitry Andric
730b57cec5SDimitry Andric SBFrame::~SBFrame() = default;
740b57cec5SDimitry Andric
operator =(const SBFrame & rhs)750b57cec5SDimitry Andric const SBFrame &SBFrame::operator=(const SBFrame &rhs) {
760b57cec5SDimitry Andric LLDB_RECORD_METHOD(const lldb::SBFrame &,
770b57cec5SDimitry Andric SBFrame, operator=,(const lldb::SBFrame &), rhs);
780b57cec5SDimitry Andric
790b57cec5SDimitry Andric if (this != &rhs)
800b57cec5SDimitry Andric m_opaque_sp = clone(rhs.m_opaque_sp);
810b57cec5SDimitry Andric return LLDB_RECORD_RESULT(*this);
820b57cec5SDimitry Andric }
830b57cec5SDimitry Andric
GetFrameSP() const840b57cec5SDimitry Andric StackFrameSP SBFrame::GetFrameSP() const {
850b57cec5SDimitry Andric return (m_opaque_sp ? m_opaque_sp->GetFrameSP() : StackFrameSP());
860b57cec5SDimitry Andric }
870b57cec5SDimitry Andric
SetFrameSP(const StackFrameSP & lldb_object_sp)880b57cec5SDimitry Andric void SBFrame::SetFrameSP(const StackFrameSP &lldb_object_sp) {
890b57cec5SDimitry Andric return m_opaque_sp->SetFrameSP(lldb_object_sp);
900b57cec5SDimitry Andric }
910b57cec5SDimitry Andric
IsValid() const920b57cec5SDimitry Andric bool SBFrame::IsValid() const {
930b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBFrame, IsValid);
940b57cec5SDimitry Andric return this->operator bool();
950b57cec5SDimitry Andric }
operator bool() const960b57cec5SDimitry Andric SBFrame::operator bool() const {
970b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBFrame, operator bool);
980b57cec5SDimitry Andric
990b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
1000b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
1010b57cec5SDimitry Andric
1020b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
1030b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
1040b57cec5SDimitry Andric if (target && process) {
1050b57cec5SDimitry Andric Process::StopLocker stop_locker;
1060b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock()))
1070b57cec5SDimitry Andric return GetFrameSP().get() != nullptr;
1080b57cec5SDimitry Andric }
1090b57cec5SDimitry Andric
1100b57cec5SDimitry Andric // Without a target & process we can't have a valid stack frame.
1110b57cec5SDimitry Andric return false;
1120b57cec5SDimitry Andric }
1130b57cec5SDimitry Andric
GetSymbolContext(uint32_t resolve_scope) const1140b57cec5SDimitry Andric SBSymbolContext SBFrame::GetSymbolContext(uint32_t resolve_scope) const {
1150b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST(lldb::SBSymbolContext, SBFrame, GetSymbolContext,
1160b57cec5SDimitry Andric (uint32_t), resolve_scope);
1170b57cec5SDimitry Andric
1180b57cec5SDimitry Andric SBSymbolContext sb_sym_ctx;
1190b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
1200b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
1210b57cec5SDimitry Andric SymbolContextItem scope = static_cast<SymbolContextItem>(resolve_scope);
1220b57cec5SDimitry Andric StackFrame *frame = nullptr;
1230b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
1240b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
1250b57cec5SDimitry Andric if (target && process) {
1260b57cec5SDimitry Andric Process::StopLocker stop_locker;
1270b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
1280b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
1290b57cec5SDimitry Andric if (frame)
1300b57cec5SDimitry Andric sb_sym_ctx.SetSymbolContext(&frame->GetSymbolContext(scope));
1310b57cec5SDimitry Andric }
1320b57cec5SDimitry Andric }
1330b57cec5SDimitry Andric
1340b57cec5SDimitry Andric return LLDB_RECORD_RESULT(sb_sym_ctx);
1350b57cec5SDimitry Andric }
1360b57cec5SDimitry Andric
GetModule() const1370b57cec5SDimitry Andric SBModule SBFrame::GetModule() const {
1380b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBModule, SBFrame, GetModule);
1390b57cec5SDimitry Andric
1400b57cec5SDimitry Andric SBModule sb_module;
1410b57cec5SDimitry Andric ModuleSP module_sp;
1420b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
1430b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
1440b57cec5SDimitry Andric
1450b57cec5SDimitry Andric StackFrame *frame = nullptr;
1460b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
1470b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
1480b57cec5SDimitry Andric if (target && process) {
1490b57cec5SDimitry Andric Process::StopLocker stop_locker;
1500b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
1510b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
1520b57cec5SDimitry Andric if (frame) {
1530b57cec5SDimitry Andric module_sp = frame->GetSymbolContext(eSymbolContextModule).module_sp;
1540b57cec5SDimitry Andric sb_module.SetSP(module_sp);
1550b57cec5SDimitry Andric }
1560b57cec5SDimitry Andric }
1570b57cec5SDimitry Andric }
1580b57cec5SDimitry Andric
1590b57cec5SDimitry Andric return LLDB_RECORD_RESULT(sb_module);
1600b57cec5SDimitry Andric }
1610b57cec5SDimitry Andric
GetCompileUnit() const1620b57cec5SDimitry Andric SBCompileUnit SBFrame::GetCompileUnit() const {
1630b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBCompileUnit, SBFrame,
1640b57cec5SDimitry Andric GetCompileUnit);
1650b57cec5SDimitry Andric
1660b57cec5SDimitry Andric SBCompileUnit sb_comp_unit;
1670b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
1680b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
1690b57cec5SDimitry Andric
1700b57cec5SDimitry Andric StackFrame *frame = nullptr;
1710b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
1720b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
1730b57cec5SDimitry Andric if (target && process) {
1740b57cec5SDimitry Andric Process::StopLocker stop_locker;
1750b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
1760b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
1770b57cec5SDimitry Andric if (frame) {
1780b57cec5SDimitry Andric sb_comp_unit.reset(
1790b57cec5SDimitry Andric frame->GetSymbolContext(eSymbolContextCompUnit).comp_unit);
1800b57cec5SDimitry Andric }
1810b57cec5SDimitry Andric }
1820b57cec5SDimitry Andric }
1830b57cec5SDimitry Andric
1840b57cec5SDimitry Andric return LLDB_RECORD_RESULT(sb_comp_unit);
1850b57cec5SDimitry Andric }
1860b57cec5SDimitry Andric
GetFunction() const1870b57cec5SDimitry Andric SBFunction SBFrame::GetFunction() const {
1880b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFunction, SBFrame, GetFunction);
1890b57cec5SDimitry Andric
1900b57cec5SDimitry Andric SBFunction sb_function;
1910b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
1920b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
1930b57cec5SDimitry Andric
1940b57cec5SDimitry Andric StackFrame *frame = nullptr;
1950b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
1960b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
1970b57cec5SDimitry Andric if (target && process) {
1980b57cec5SDimitry Andric Process::StopLocker stop_locker;
1990b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
2000b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
2010b57cec5SDimitry Andric if (frame) {
2020b57cec5SDimitry Andric sb_function.reset(
2030b57cec5SDimitry Andric frame->GetSymbolContext(eSymbolContextFunction).function);
2040b57cec5SDimitry Andric }
2050b57cec5SDimitry Andric }
2060b57cec5SDimitry Andric }
2070b57cec5SDimitry Andric
2080b57cec5SDimitry Andric return LLDB_RECORD_RESULT(sb_function);
2090b57cec5SDimitry Andric }
2100b57cec5SDimitry Andric
GetSymbol() const2110b57cec5SDimitry Andric SBSymbol SBFrame::GetSymbol() const {
2120b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBSymbol, SBFrame, GetSymbol);
2130b57cec5SDimitry Andric
2140b57cec5SDimitry Andric SBSymbol sb_symbol;
2150b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
2160b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
2170b57cec5SDimitry Andric
2180b57cec5SDimitry Andric StackFrame *frame = nullptr;
2190b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
2200b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
2210b57cec5SDimitry Andric if (target && process) {
2220b57cec5SDimitry Andric Process::StopLocker stop_locker;
2230b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
2240b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
2250b57cec5SDimitry Andric if (frame) {
2260b57cec5SDimitry Andric sb_symbol.reset(frame->GetSymbolContext(eSymbolContextSymbol).symbol);
2270b57cec5SDimitry Andric }
2280b57cec5SDimitry Andric }
2290b57cec5SDimitry Andric }
2300b57cec5SDimitry Andric
2310b57cec5SDimitry Andric return LLDB_RECORD_RESULT(sb_symbol);
2320b57cec5SDimitry Andric }
2330b57cec5SDimitry Andric
GetBlock() const2340b57cec5SDimitry Andric SBBlock SBFrame::GetBlock() const {
2350b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBBlock, SBFrame, GetBlock);
2360b57cec5SDimitry Andric
2370b57cec5SDimitry Andric SBBlock sb_block;
2380b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
2390b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
2400b57cec5SDimitry Andric
2410b57cec5SDimitry Andric StackFrame *frame = nullptr;
2420b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
2430b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
2440b57cec5SDimitry Andric if (target && process) {
2450b57cec5SDimitry Andric Process::StopLocker stop_locker;
2460b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
2470b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
2480b57cec5SDimitry Andric if (frame)
2490b57cec5SDimitry Andric sb_block.SetPtr(frame->GetSymbolContext(eSymbolContextBlock).block);
2500b57cec5SDimitry Andric }
2510b57cec5SDimitry Andric }
2520b57cec5SDimitry Andric return LLDB_RECORD_RESULT(sb_block);
2530b57cec5SDimitry Andric }
2540b57cec5SDimitry Andric
GetFrameBlock() const2550b57cec5SDimitry Andric SBBlock SBFrame::GetFrameBlock() const {
2560b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBBlock, SBFrame, GetFrameBlock);
2570b57cec5SDimitry Andric
2580b57cec5SDimitry Andric SBBlock sb_block;
2590b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
2600b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
2610b57cec5SDimitry Andric
2620b57cec5SDimitry Andric StackFrame *frame = nullptr;
2630b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
2640b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
2650b57cec5SDimitry Andric if (target && process) {
2660b57cec5SDimitry Andric Process::StopLocker stop_locker;
2670b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
2680b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
2690b57cec5SDimitry Andric if (frame)
2700b57cec5SDimitry Andric sb_block.SetPtr(frame->GetFrameBlock());
2710b57cec5SDimitry Andric }
2720b57cec5SDimitry Andric }
2730b57cec5SDimitry Andric return LLDB_RECORD_RESULT(sb_block);
2740b57cec5SDimitry Andric }
2750b57cec5SDimitry Andric
GetLineEntry() const2760b57cec5SDimitry Andric SBLineEntry SBFrame::GetLineEntry() const {
2770b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBLineEntry, SBFrame, GetLineEntry);
2780b57cec5SDimitry Andric
2790b57cec5SDimitry Andric SBLineEntry sb_line_entry;
2800b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
2810b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
2820b57cec5SDimitry Andric
2830b57cec5SDimitry Andric StackFrame *frame = nullptr;
2840b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
2850b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
2860b57cec5SDimitry Andric if (target && process) {
2870b57cec5SDimitry Andric Process::StopLocker stop_locker;
2880b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
2890b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
2900b57cec5SDimitry Andric if (frame) {
2910b57cec5SDimitry Andric sb_line_entry.SetLineEntry(
2920b57cec5SDimitry Andric frame->GetSymbolContext(eSymbolContextLineEntry).line_entry);
2930b57cec5SDimitry Andric }
2940b57cec5SDimitry Andric }
2950b57cec5SDimitry Andric }
2960b57cec5SDimitry Andric return LLDB_RECORD_RESULT(sb_line_entry);
2970b57cec5SDimitry Andric }
2980b57cec5SDimitry Andric
GetFrameID() const2990b57cec5SDimitry Andric uint32_t SBFrame::GetFrameID() const {
3000b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBFrame, GetFrameID);
3010b57cec5SDimitry Andric
3020b57cec5SDimitry Andric uint32_t frame_idx = UINT32_MAX;
3030b57cec5SDimitry Andric
3040b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
3050b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
3060b57cec5SDimitry Andric
3070b57cec5SDimitry Andric StackFrame *frame = exe_ctx.GetFramePtr();
3080b57cec5SDimitry Andric if (frame)
3090b57cec5SDimitry Andric frame_idx = frame->GetFrameIndex();
3100b57cec5SDimitry Andric
3110b57cec5SDimitry Andric return frame_idx;
3120b57cec5SDimitry Andric }
3130b57cec5SDimitry Andric
GetCFA() const3140b57cec5SDimitry Andric lldb::addr_t SBFrame::GetCFA() const {
3150b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::addr_t, SBFrame, GetCFA);
3160b57cec5SDimitry Andric
3170b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
3180b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
3190b57cec5SDimitry Andric
3200b57cec5SDimitry Andric StackFrame *frame = exe_ctx.GetFramePtr();
3210b57cec5SDimitry Andric if (frame)
3220b57cec5SDimitry Andric return frame->GetStackID().GetCallFrameAddress();
3230b57cec5SDimitry Andric return LLDB_INVALID_ADDRESS;
3240b57cec5SDimitry Andric }
3250b57cec5SDimitry Andric
GetPC() const3260b57cec5SDimitry Andric addr_t SBFrame::GetPC() const {
3270b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::addr_t, SBFrame, GetPC);
3280b57cec5SDimitry Andric
3290b57cec5SDimitry Andric addr_t addr = LLDB_INVALID_ADDRESS;
3300b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
3310b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
3320b57cec5SDimitry Andric
3330b57cec5SDimitry Andric StackFrame *frame = nullptr;
3340b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
3350b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
3360b57cec5SDimitry Andric if (target && process) {
3370b57cec5SDimitry Andric Process::StopLocker stop_locker;
3380b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
3390b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
3400b57cec5SDimitry Andric if (frame) {
3410b57cec5SDimitry Andric addr = frame->GetFrameCodeAddress().GetOpcodeLoadAddress(
3420b57cec5SDimitry Andric target, AddressClass::eCode);
3430b57cec5SDimitry Andric }
3440b57cec5SDimitry Andric }
3450b57cec5SDimitry Andric }
3460b57cec5SDimitry Andric
3470b57cec5SDimitry Andric return addr;
3480b57cec5SDimitry Andric }
3490b57cec5SDimitry Andric
SetPC(addr_t new_pc)3500b57cec5SDimitry Andric bool SBFrame::SetPC(addr_t new_pc) {
3510b57cec5SDimitry Andric LLDB_RECORD_METHOD(bool, SBFrame, SetPC, (lldb::addr_t), new_pc);
3520b57cec5SDimitry Andric
3530b57cec5SDimitry Andric bool ret_val = false;
3540b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
3550b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
3560b57cec5SDimitry Andric
3570b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
3580b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
3590b57cec5SDimitry Andric if (target && process) {
3600b57cec5SDimitry Andric Process::StopLocker stop_locker;
3610b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
3625ffd83dbSDimitry Andric if (StackFrame *frame = exe_ctx.GetFramePtr()) {
3635ffd83dbSDimitry Andric if (RegisterContextSP reg_ctx_sp = frame->GetRegisterContext()) {
3645ffd83dbSDimitry Andric ret_val = reg_ctx_sp->SetPC(new_pc);
3655ffd83dbSDimitry Andric }
3660b57cec5SDimitry Andric }
3670b57cec5SDimitry Andric }
3680b57cec5SDimitry Andric }
3690b57cec5SDimitry Andric
3700b57cec5SDimitry Andric return ret_val;
3710b57cec5SDimitry Andric }
3720b57cec5SDimitry Andric
GetSP() const3730b57cec5SDimitry Andric addr_t SBFrame::GetSP() const {
3740b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::addr_t, SBFrame, GetSP);
3750b57cec5SDimitry Andric
3760b57cec5SDimitry Andric addr_t addr = LLDB_INVALID_ADDRESS;
3770b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
3780b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
3790b57cec5SDimitry Andric
3800b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
3810b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
3820b57cec5SDimitry Andric if (target && process) {
3830b57cec5SDimitry Andric Process::StopLocker stop_locker;
3840b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
3855ffd83dbSDimitry Andric if (StackFrame *frame = exe_ctx.GetFramePtr()) {
3865ffd83dbSDimitry Andric if (RegisterContextSP reg_ctx_sp = frame->GetRegisterContext()) {
3875ffd83dbSDimitry Andric addr = reg_ctx_sp->GetSP();
3885ffd83dbSDimitry Andric }
3890b57cec5SDimitry Andric }
3900b57cec5SDimitry Andric }
3910b57cec5SDimitry Andric }
3920b57cec5SDimitry Andric
3930b57cec5SDimitry Andric return addr;
3940b57cec5SDimitry Andric }
3950b57cec5SDimitry Andric
GetFP() const3960b57cec5SDimitry Andric addr_t SBFrame::GetFP() const {
3970b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::addr_t, SBFrame, GetFP);
3980b57cec5SDimitry Andric
3990b57cec5SDimitry Andric addr_t addr = LLDB_INVALID_ADDRESS;
4000b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
4010b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
4020b57cec5SDimitry Andric
4030b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
4040b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
4050b57cec5SDimitry Andric if (target && process) {
4060b57cec5SDimitry Andric Process::StopLocker stop_locker;
4070b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
4085ffd83dbSDimitry Andric if (StackFrame *frame = exe_ctx.GetFramePtr()) {
4095ffd83dbSDimitry Andric if (RegisterContextSP reg_ctx_sp = frame->GetRegisterContext()) {
4105ffd83dbSDimitry Andric addr = reg_ctx_sp->GetFP();
4115ffd83dbSDimitry Andric }
4125ffd83dbSDimitry Andric }
4130b57cec5SDimitry Andric }
4140b57cec5SDimitry Andric }
4150b57cec5SDimitry Andric
4160b57cec5SDimitry Andric return addr;
4170b57cec5SDimitry Andric }
4180b57cec5SDimitry Andric
GetPCAddress() const4190b57cec5SDimitry Andric SBAddress SBFrame::GetPCAddress() const {
4200b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBAddress, SBFrame, GetPCAddress);
4210b57cec5SDimitry Andric
4220b57cec5SDimitry Andric SBAddress sb_addr;
4230b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
4240b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
4250b57cec5SDimitry Andric
4260b57cec5SDimitry Andric StackFrame *frame = exe_ctx.GetFramePtr();
4270b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
4280b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
4290b57cec5SDimitry Andric if (target && process) {
4300b57cec5SDimitry Andric Process::StopLocker stop_locker;
4310b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
4320b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
4330b57cec5SDimitry Andric if (frame)
434*af732203SDimitry Andric sb_addr.SetAddress(frame->GetFrameCodeAddress());
4350b57cec5SDimitry Andric }
4360b57cec5SDimitry Andric }
4370b57cec5SDimitry Andric return LLDB_RECORD_RESULT(sb_addr);
4380b57cec5SDimitry Andric }
4390b57cec5SDimitry Andric
Clear()4400b57cec5SDimitry Andric void SBFrame::Clear() {
4410b57cec5SDimitry Andric LLDB_RECORD_METHOD_NO_ARGS(void, SBFrame, Clear);
4420b57cec5SDimitry Andric
4430b57cec5SDimitry Andric m_opaque_sp->Clear();
4440b57cec5SDimitry Andric }
4450b57cec5SDimitry Andric
GetValueForVariablePath(const char * var_path)4460b57cec5SDimitry Andric lldb::SBValue SBFrame::GetValueForVariablePath(const char *var_path) {
4470b57cec5SDimitry Andric LLDB_RECORD_METHOD(lldb::SBValue, SBFrame, GetValueForVariablePath,
4480b57cec5SDimitry Andric (const char *), var_path);
4490b57cec5SDimitry Andric
4500b57cec5SDimitry Andric SBValue sb_value;
4510b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
4520b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
4530b57cec5SDimitry Andric
4540b57cec5SDimitry Andric StackFrame *frame = exe_ctx.GetFramePtr();
4550b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
4560b57cec5SDimitry Andric if (frame && target) {
4570b57cec5SDimitry Andric lldb::DynamicValueType use_dynamic =
4580b57cec5SDimitry Andric frame->CalculateTarget()->GetPreferDynamicValue();
4590b57cec5SDimitry Andric sb_value = GetValueForVariablePath(var_path, use_dynamic);
4600b57cec5SDimitry Andric }
4610b57cec5SDimitry Andric return LLDB_RECORD_RESULT(sb_value);
4620b57cec5SDimitry Andric }
4630b57cec5SDimitry Andric
GetValueForVariablePath(const char * var_path,DynamicValueType use_dynamic)4640b57cec5SDimitry Andric lldb::SBValue SBFrame::GetValueForVariablePath(const char *var_path,
4650b57cec5SDimitry Andric DynamicValueType use_dynamic) {
4660b57cec5SDimitry Andric LLDB_RECORD_METHOD(lldb::SBValue, SBFrame, GetValueForVariablePath,
4670b57cec5SDimitry Andric (const char *, lldb::DynamicValueType), var_path,
4680b57cec5SDimitry Andric use_dynamic);
4690b57cec5SDimitry Andric
4700b57cec5SDimitry Andric SBValue sb_value;
4710b57cec5SDimitry Andric if (var_path == nullptr || var_path[0] == '\0') {
4720b57cec5SDimitry Andric return LLDB_RECORD_RESULT(sb_value);
4730b57cec5SDimitry Andric }
4740b57cec5SDimitry Andric
4750b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
4760b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
4770b57cec5SDimitry Andric
4780b57cec5SDimitry Andric StackFrame *frame = nullptr;
4790b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
4800b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
4810b57cec5SDimitry Andric if (target && process) {
4820b57cec5SDimitry Andric Process::StopLocker stop_locker;
4830b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
4840b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
4850b57cec5SDimitry Andric if (frame) {
4860b57cec5SDimitry Andric VariableSP var_sp;
4870b57cec5SDimitry Andric Status error;
4880b57cec5SDimitry Andric ValueObjectSP value_sp(frame->GetValueForVariableExpressionPath(
4890b57cec5SDimitry Andric var_path, eNoDynamicValues,
4900b57cec5SDimitry Andric StackFrame::eExpressionPathOptionCheckPtrVsMember |
4910b57cec5SDimitry Andric StackFrame::eExpressionPathOptionsAllowDirectIVarAccess,
4920b57cec5SDimitry Andric var_sp, error));
4930b57cec5SDimitry Andric sb_value.SetSP(value_sp, use_dynamic);
4940b57cec5SDimitry Andric }
4950b57cec5SDimitry Andric }
4960b57cec5SDimitry Andric }
4970b57cec5SDimitry Andric return LLDB_RECORD_RESULT(sb_value);
4980b57cec5SDimitry Andric }
4990b57cec5SDimitry Andric
FindVariable(const char * name)5000b57cec5SDimitry Andric SBValue SBFrame::FindVariable(const char *name) {
5010b57cec5SDimitry Andric LLDB_RECORD_METHOD(lldb::SBValue, SBFrame, FindVariable, (const char *),
5020b57cec5SDimitry Andric name);
5030b57cec5SDimitry Andric
5040b57cec5SDimitry Andric SBValue value;
5050b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
5060b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
5070b57cec5SDimitry Andric
5080b57cec5SDimitry Andric StackFrame *frame = exe_ctx.GetFramePtr();
5090b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
5100b57cec5SDimitry Andric if (frame && target) {
5110b57cec5SDimitry Andric lldb::DynamicValueType use_dynamic =
5120b57cec5SDimitry Andric frame->CalculateTarget()->GetPreferDynamicValue();
5130b57cec5SDimitry Andric value = FindVariable(name, use_dynamic);
5140b57cec5SDimitry Andric }
5150b57cec5SDimitry Andric return LLDB_RECORD_RESULT(value);
5160b57cec5SDimitry Andric }
5170b57cec5SDimitry Andric
FindVariable(const char * name,lldb::DynamicValueType use_dynamic)5180b57cec5SDimitry Andric SBValue SBFrame::FindVariable(const char *name,
5190b57cec5SDimitry Andric lldb::DynamicValueType use_dynamic) {
5200b57cec5SDimitry Andric LLDB_RECORD_METHOD(lldb::SBValue, SBFrame, FindVariable,
5210b57cec5SDimitry Andric (const char *, lldb::DynamicValueType), name, use_dynamic);
5220b57cec5SDimitry Andric
5230b57cec5SDimitry Andric VariableSP var_sp;
5240b57cec5SDimitry Andric SBValue sb_value;
5250b57cec5SDimitry Andric
5260b57cec5SDimitry Andric if (name == nullptr || name[0] == '\0') {
5270b57cec5SDimitry Andric return LLDB_RECORD_RESULT(sb_value);
5280b57cec5SDimitry Andric }
5290b57cec5SDimitry Andric
5300b57cec5SDimitry Andric ValueObjectSP value_sp;
5310b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
5320b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
5330b57cec5SDimitry Andric
5340b57cec5SDimitry Andric StackFrame *frame = nullptr;
5350b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
5360b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
5370b57cec5SDimitry Andric if (target && process) {
5380b57cec5SDimitry Andric Process::StopLocker stop_locker;
5390b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
5400b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
5410b57cec5SDimitry Andric if (frame) {
5420b57cec5SDimitry Andric value_sp = frame->FindVariable(ConstString(name));
5430b57cec5SDimitry Andric
5440b57cec5SDimitry Andric if (value_sp)
5450b57cec5SDimitry Andric sb_value.SetSP(value_sp, use_dynamic);
5460b57cec5SDimitry Andric }
5470b57cec5SDimitry Andric }
5480b57cec5SDimitry Andric }
5490b57cec5SDimitry Andric
5500b57cec5SDimitry Andric return LLDB_RECORD_RESULT(sb_value);
5510b57cec5SDimitry Andric }
5520b57cec5SDimitry Andric
FindValue(const char * name,ValueType value_type)5530b57cec5SDimitry Andric SBValue SBFrame::FindValue(const char *name, ValueType value_type) {
5540b57cec5SDimitry Andric LLDB_RECORD_METHOD(lldb::SBValue, SBFrame, FindValue,
5550b57cec5SDimitry Andric (const char *, lldb::ValueType), name, value_type);
5560b57cec5SDimitry Andric
5570b57cec5SDimitry Andric SBValue value;
5580b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
5590b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
5600b57cec5SDimitry Andric
5610b57cec5SDimitry Andric StackFrame *frame = exe_ctx.GetFramePtr();
5620b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
5630b57cec5SDimitry Andric if (frame && target) {
5640b57cec5SDimitry Andric lldb::DynamicValueType use_dynamic =
5650b57cec5SDimitry Andric frame->CalculateTarget()->GetPreferDynamicValue();
5660b57cec5SDimitry Andric value = FindValue(name, value_type, use_dynamic);
5670b57cec5SDimitry Andric }
5680b57cec5SDimitry Andric return LLDB_RECORD_RESULT(value);
5690b57cec5SDimitry Andric }
5700b57cec5SDimitry Andric
FindValue(const char * name,ValueType value_type,lldb::DynamicValueType use_dynamic)5710b57cec5SDimitry Andric SBValue SBFrame::FindValue(const char *name, ValueType value_type,
5720b57cec5SDimitry Andric lldb::DynamicValueType use_dynamic) {
5730b57cec5SDimitry Andric LLDB_RECORD_METHOD(lldb::SBValue, SBFrame, FindValue,
5740b57cec5SDimitry Andric (const char *, lldb::ValueType, lldb::DynamicValueType),
5750b57cec5SDimitry Andric name, value_type, use_dynamic);
5760b57cec5SDimitry Andric
5770b57cec5SDimitry Andric SBValue sb_value;
5780b57cec5SDimitry Andric
5790b57cec5SDimitry Andric if (name == nullptr || name[0] == '\0') {
5800b57cec5SDimitry Andric return LLDB_RECORD_RESULT(sb_value);
5810b57cec5SDimitry Andric }
5820b57cec5SDimitry Andric
5830b57cec5SDimitry Andric ValueObjectSP value_sp;
5840b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
5850b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
5860b57cec5SDimitry Andric
5870b57cec5SDimitry Andric StackFrame *frame = nullptr;
5880b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
5890b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
5900b57cec5SDimitry Andric if (target && process) {
5910b57cec5SDimitry Andric Process::StopLocker stop_locker;
5920b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
5930b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
5940b57cec5SDimitry Andric if (frame) {
5950b57cec5SDimitry Andric VariableList variable_list;
5960b57cec5SDimitry Andric
5970b57cec5SDimitry Andric switch (value_type) {
5980b57cec5SDimitry Andric case eValueTypeVariableGlobal: // global variable
5990b57cec5SDimitry Andric case eValueTypeVariableStatic: // static variable
6000b57cec5SDimitry Andric case eValueTypeVariableArgument: // function argument variables
6010b57cec5SDimitry Andric case eValueTypeVariableLocal: // function local variables
6020b57cec5SDimitry Andric case eValueTypeVariableThreadLocal: // thread local variables
6030b57cec5SDimitry Andric {
6040b57cec5SDimitry Andric SymbolContext sc(frame->GetSymbolContext(eSymbolContextBlock));
6050b57cec5SDimitry Andric
6060b57cec5SDimitry Andric const bool can_create = true;
6070b57cec5SDimitry Andric const bool get_parent_variables = true;
6080b57cec5SDimitry Andric const bool stop_if_block_is_inlined_function = true;
6090b57cec5SDimitry Andric
6100b57cec5SDimitry Andric if (sc.block)
6110b57cec5SDimitry Andric sc.block->AppendVariables(
6120b57cec5SDimitry Andric can_create, get_parent_variables,
6130b57cec5SDimitry Andric stop_if_block_is_inlined_function,
6140b57cec5SDimitry Andric [frame](Variable *v) { return v->IsInScope(frame); },
6150b57cec5SDimitry Andric &variable_list);
6160b57cec5SDimitry Andric if (value_type == eValueTypeVariableGlobal) {
6170b57cec5SDimitry Andric const bool get_file_globals = true;
6180b57cec5SDimitry Andric VariableList *frame_vars = frame->GetVariableList(get_file_globals);
6190b57cec5SDimitry Andric if (frame_vars)
6200b57cec5SDimitry Andric frame_vars->AppendVariablesIfUnique(variable_list);
6210b57cec5SDimitry Andric }
6220b57cec5SDimitry Andric ConstString const_name(name);
6230b57cec5SDimitry Andric VariableSP variable_sp(
6240b57cec5SDimitry Andric variable_list.FindVariable(const_name, value_type));
6250b57cec5SDimitry Andric if (variable_sp) {
6260b57cec5SDimitry Andric value_sp = frame->GetValueObjectForFrameVariable(variable_sp,
6270b57cec5SDimitry Andric eNoDynamicValues);
6280b57cec5SDimitry Andric sb_value.SetSP(value_sp, use_dynamic);
6290b57cec5SDimitry Andric }
6300b57cec5SDimitry Andric } break;
6310b57cec5SDimitry Andric
6320b57cec5SDimitry Andric case eValueTypeRegister: // stack frame register value
6330b57cec5SDimitry Andric {
6340b57cec5SDimitry Andric RegisterContextSP reg_ctx(frame->GetRegisterContext());
6350b57cec5SDimitry Andric if (reg_ctx) {
6360b57cec5SDimitry Andric const uint32_t num_regs = reg_ctx->GetRegisterCount();
6370b57cec5SDimitry Andric for (uint32_t reg_idx = 0; reg_idx < num_regs; ++reg_idx) {
6380b57cec5SDimitry Andric const RegisterInfo *reg_info =
6390b57cec5SDimitry Andric reg_ctx->GetRegisterInfoAtIndex(reg_idx);
6400b57cec5SDimitry Andric if (reg_info &&
6410b57cec5SDimitry Andric ((reg_info->name && strcasecmp(reg_info->name, name) == 0) ||
6420b57cec5SDimitry Andric (reg_info->alt_name &&
6430b57cec5SDimitry Andric strcasecmp(reg_info->alt_name, name) == 0))) {
6440b57cec5SDimitry Andric value_sp = ValueObjectRegister::Create(frame, reg_ctx, reg_idx);
6450b57cec5SDimitry Andric sb_value.SetSP(value_sp);
6460b57cec5SDimitry Andric break;
6470b57cec5SDimitry Andric }
6480b57cec5SDimitry Andric }
6490b57cec5SDimitry Andric }
6500b57cec5SDimitry Andric } break;
6510b57cec5SDimitry Andric
6520b57cec5SDimitry Andric case eValueTypeRegisterSet: // A collection of stack frame register
6530b57cec5SDimitry Andric // values
6540b57cec5SDimitry Andric {
6550b57cec5SDimitry Andric RegisterContextSP reg_ctx(frame->GetRegisterContext());
6560b57cec5SDimitry Andric if (reg_ctx) {
6570b57cec5SDimitry Andric const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
6580b57cec5SDimitry Andric for (uint32_t set_idx = 0; set_idx < num_sets; ++set_idx) {
6590b57cec5SDimitry Andric const RegisterSet *reg_set = reg_ctx->GetRegisterSet(set_idx);
6600b57cec5SDimitry Andric if (reg_set &&
6610b57cec5SDimitry Andric ((reg_set->name && strcasecmp(reg_set->name, name) == 0) ||
6620b57cec5SDimitry Andric (reg_set->short_name &&
6630b57cec5SDimitry Andric strcasecmp(reg_set->short_name, name) == 0))) {
6640b57cec5SDimitry Andric value_sp =
6650b57cec5SDimitry Andric ValueObjectRegisterSet::Create(frame, reg_ctx, set_idx);
6660b57cec5SDimitry Andric sb_value.SetSP(value_sp);
6670b57cec5SDimitry Andric break;
6680b57cec5SDimitry Andric }
6690b57cec5SDimitry Andric }
6700b57cec5SDimitry Andric }
6710b57cec5SDimitry Andric } break;
6720b57cec5SDimitry Andric
6730b57cec5SDimitry Andric case eValueTypeConstResult: // constant result variables
6740b57cec5SDimitry Andric {
6750b57cec5SDimitry Andric ConstString const_name(name);
6760b57cec5SDimitry Andric ExpressionVariableSP expr_var_sp(
6770b57cec5SDimitry Andric target->GetPersistentVariable(const_name));
6780b57cec5SDimitry Andric if (expr_var_sp) {
6790b57cec5SDimitry Andric value_sp = expr_var_sp->GetValueObject();
6800b57cec5SDimitry Andric sb_value.SetSP(value_sp, use_dynamic);
6810b57cec5SDimitry Andric }
6820b57cec5SDimitry Andric } break;
6830b57cec5SDimitry Andric
6840b57cec5SDimitry Andric default:
6850b57cec5SDimitry Andric break;
6860b57cec5SDimitry Andric }
6870b57cec5SDimitry Andric }
6880b57cec5SDimitry Andric }
6890b57cec5SDimitry Andric }
6900b57cec5SDimitry Andric
6910b57cec5SDimitry Andric return LLDB_RECORD_RESULT(sb_value);
6920b57cec5SDimitry Andric }
6930b57cec5SDimitry Andric
IsEqual(const SBFrame & that) const6940b57cec5SDimitry Andric bool SBFrame::IsEqual(const SBFrame &that) const {
6950b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST(bool, SBFrame, IsEqual, (const lldb::SBFrame &),
6960b57cec5SDimitry Andric that);
6970b57cec5SDimitry Andric
6980b57cec5SDimitry Andric lldb::StackFrameSP this_sp = GetFrameSP();
6990b57cec5SDimitry Andric lldb::StackFrameSP that_sp = that.GetFrameSP();
7000b57cec5SDimitry Andric return (this_sp && that_sp && this_sp->GetStackID() == that_sp->GetStackID());
7010b57cec5SDimitry Andric }
7020b57cec5SDimitry Andric
operator ==(const SBFrame & rhs) const7030b57cec5SDimitry Andric bool SBFrame::operator==(const SBFrame &rhs) const {
7040b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST(bool, SBFrame, operator==,(const lldb::SBFrame &),
7050b57cec5SDimitry Andric rhs);
7060b57cec5SDimitry Andric
7070b57cec5SDimitry Andric return IsEqual(rhs);
7080b57cec5SDimitry Andric }
7090b57cec5SDimitry Andric
operator !=(const SBFrame & rhs) const7100b57cec5SDimitry Andric bool SBFrame::operator!=(const SBFrame &rhs) const {
7110b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST(bool, SBFrame, operator!=,(const lldb::SBFrame &),
7120b57cec5SDimitry Andric rhs);
7130b57cec5SDimitry Andric
7140b57cec5SDimitry Andric return !IsEqual(rhs);
7150b57cec5SDimitry Andric }
7160b57cec5SDimitry Andric
GetThread() const7170b57cec5SDimitry Andric SBThread SBFrame::GetThread() const {
7180b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBThread, SBFrame, GetThread);
7190b57cec5SDimitry Andric
7200b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
7210b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
7220b57cec5SDimitry Andric
7230b57cec5SDimitry Andric ThreadSP thread_sp(exe_ctx.GetThreadSP());
7240b57cec5SDimitry Andric SBThread sb_thread(thread_sp);
7250b57cec5SDimitry Andric
7260b57cec5SDimitry Andric return LLDB_RECORD_RESULT(sb_thread);
7270b57cec5SDimitry Andric }
7280b57cec5SDimitry Andric
Disassemble() const7290b57cec5SDimitry Andric const char *SBFrame::Disassemble() const {
7300b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBFrame, Disassemble);
7310b57cec5SDimitry Andric
7320b57cec5SDimitry Andric const char *disassembly = nullptr;
7330b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
7340b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
7350b57cec5SDimitry Andric
7360b57cec5SDimitry Andric StackFrame *frame = nullptr;
7370b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
7380b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
7390b57cec5SDimitry Andric if (target && process) {
7400b57cec5SDimitry Andric Process::StopLocker stop_locker;
7410b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
7420b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
7430b57cec5SDimitry Andric if (frame) {
7440b57cec5SDimitry Andric disassembly = frame->Disassemble();
7450b57cec5SDimitry Andric }
7460b57cec5SDimitry Andric }
7470b57cec5SDimitry Andric }
7480b57cec5SDimitry Andric
7490b57cec5SDimitry Andric return disassembly;
7500b57cec5SDimitry Andric }
7510b57cec5SDimitry Andric
GetVariables(bool arguments,bool locals,bool statics,bool in_scope_only)7520b57cec5SDimitry Andric SBValueList SBFrame::GetVariables(bool arguments, bool locals, bool statics,
7530b57cec5SDimitry Andric bool in_scope_only) {
7540b57cec5SDimitry Andric LLDB_RECORD_METHOD(lldb::SBValueList, SBFrame, GetVariables,
7550b57cec5SDimitry Andric (bool, bool, bool, bool), arguments, locals, statics,
7560b57cec5SDimitry Andric in_scope_only);
7570b57cec5SDimitry Andric
7580b57cec5SDimitry Andric SBValueList value_list;
7590b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
7600b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
7610b57cec5SDimitry Andric
7620b57cec5SDimitry Andric StackFrame *frame = exe_ctx.GetFramePtr();
7630b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
7640b57cec5SDimitry Andric if (frame && target) {
7650b57cec5SDimitry Andric lldb::DynamicValueType use_dynamic =
7660b57cec5SDimitry Andric frame->CalculateTarget()->GetPreferDynamicValue();
7670b57cec5SDimitry Andric const bool include_runtime_support_values =
7680b57cec5SDimitry Andric target ? target->GetDisplayRuntimeSupportValues() : false;
7690b57cec5SDimitry Andric
7700b57cec5SDimitry Andric SBVariablesOptions options;
7710b57cec5SDimitry Andric options.SetIncludeArguments(arguments);
7720b57cec5SDimitry Andric options.SetIncludeLocals(locals);
7730b57cec5SDimitry Andric options.SetIncludeStatics(statics);
7740b57cec5SDimitry Andric options.SetInScopeOnly(in_scope_only);
7750b57cec5SDimitry Andric options.SetIncludeRuntimeSupportValues(include_runtime_support_values);
7760b57cec5SDimitry Andric options.SetUseDynamic(use_dynamic);
7770b57cec5SDimitry Andric
7780b57cec5SDimitry Andric value_list = GetVariables(options);
7790b57cec5SDimitry Andric }
7800b57cec5SDimitry Andric return LLDB_RECORD_RESULT(value_list);
7810b57cec5SDimitry Andric }
7820b57cec5SDimitry Andric
GetVariables(bool arguments,bool locals,bool statics,bool in_scope_only,lldb::DynamicValueType use_dynamic)7830b57cec5SDimitry Andric lldb::SBValueList SBFrame::GetVariables(bool arguments, bool locals,
7840b57cec5SDimitry Andric bool statics, bool in_scope_only,
7850b57cec5SDimitry Andric lldb::DynamicValueType use_dynamic) {
7860b57cec5SDimitry Andric LLDB_RECORD_METHOD(lldb::SBValueList, SBFrame, GetVariables,
7870b57cec5SDimitry Andric (bool, bool, bool, bool, lldb::DynamicValueType),
7880b57cec5SDimitry Andric arguments, locals, statics, in_scope_only, use_dynamic);
7890b57cec5SDimitry Andric
7900b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
7910b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
7920b57cec5SDimitry Andric
7930b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
7940b57cec5SDimitry Andric const bool include_runtime_support_values =
7950b57cec5SDimitry Andric target ? target->GetDisplayRuntimeSupportValues() : false;
7960b57cec5SDimitry Andric SBVariablesOptions options;
7970b57cec5SDimitry Andric options.SetIncludeArguments(arguments);
7980b57cec5SDimitry Andric options.SetIncludeLocals(locals);
7990b57cec5SDimitry Andric options.SetIncludeStatics(statics);
8000b57cec5SDimitry Andric options.SetInScopeOnly(in_scope_only);
8010b57cec5SDimitry Andric options.SetIncludeRuntimeSupportValues(include_runtime_support_values);
8020b57cec5SDimitry Andric options.SetUseDynamic(use_dynamic);
8030b57cec5SDimitry Andric return LLDB_RECORD_RESULT(GetVariables(options));
8040b57cec5SDimitry Andric }
8050b57cec5SDimitry Andric
GetVariables(const lldb::SBVariablesOptions & options)8060b57cec5SDimitry Andric SBValueList SBFrame::GetVariables(const lldb::SBVariablesOptions &options) {
8070b57cec5SDimitry Andric LLDB_RECORD_METHOD(lldb::SBValueList, SBFrame, GetVariables,
8080b57cec5SDimitry Andric (const lldb::SBVariablesOptions &), options);
8090b57cec5SDimitry Andric
8100b57cec5SDimitry Andric SBValueList value_list;
8110b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
8120b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
8130b57cec5SDimitry Andric
8140b57cec5SDimitry Andric StackFrame *frame = nullptr;
8150b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
8160b57cec5SDimitry Andric
8170b57cec5SDimitry Andric const bool statics = options.GetIncludeStatics();
8180b57cec5SDimitry Andric const bool arguments = options.GetIncludeArguments();
8190b57cec5SDimitry Andric const bool recognized_arguments =
8200b57cec5SDimitry Andric options.GetIncludeRecognizedArguments(SBTarget(exe_ctx.GetTargetSP()));
8210b57cec5SDimitry Andric const bool locals = options.GetIncludeLocals();
8220b57cec5SDimitry Andric const bool in_scope_only = options.GetInScopeOnly();
8230b57cec5SDimitry Andric const bool include_runtime_support_values =
8240b57cec5SDimitry Andric options.GetIncludeRuntimeSupportValues();
8250b57cec5SDimitry Andric const lldb::DynamicValueType use_dynamic = options.GetUseDynamic();
8260b57cec5SDimitry Andric
8270b57cec5SDimitry Andric
8280b57cec5SDimitry Andric std::set<VariableSP> variable_set;
8290b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
8300b57cec5SDimitry Andric if (target && process) {
8310b57cec5SDimitry Andric Process::StopLocker stop_locker;
8320b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
8330b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
8340b57cec5SDimitry Andric if (frame) {
8350b57cec5SDimitry Andric VariableList *variable_list = nullptr;
8360b57cec5SDimitry Andric variable_list = frame->GetVariableList(true);
8370b57cec5SDimitry Andric if (variable_list) {
8380b57cec5SDimitry Andric const size_t num_variables = variable_list->GetSize();
8390b57cec5SDimitry Andric if (num_variables) {
840480093f4SDimitry Andric for (const VariableSP &variable_sp : *variable_list) {
8410b57cec5SDimitry Andric if (variable_sp) {
8420b57cec5SDimitry Andric bool add_variable = false;
8430b57cec5SDimitry Andric switch (variable_sp->GetScope()) {
8440b57cec5SDimitry Andric case eValueTypeVariableGlobal:
8450b57cec5SDimitry Andric case eValueTypeVariableStatic:
8460b57cec5SDimitry Andric case eValueTypeVariableThreadLocal:
8470b57cec5SDimitry Andric add_variable = statics;
8480b57cec5SDimitry Andric break;
8490b57cec5SDimitry Andric
8500b57cec5SDimitry Andric case eValueTypeVariableArgument:
8510b57cec5SDimitry Andric add_variable = arguments;
8520b57cec5SDimitry Andric break;
8530b57cec5SDimitry Andric
8540b57cec5SDimitry Andric case eValueTypeVariableLocal:
8550b57cec5SDimitry Andric add_variable = locals;
8560b57cec5SDimitry Andric break;
8570b57cec5SDimitry Andric
8580b57cec5SDimitry Andric default:
8590b57cec5SDimitry Andric break;
8600b57cec5SDimitry Andric }
8610b57cec5SDimitry Andric if (add_variable) {
8620b57cec5SDimitry Andric // Only add variables once so we don't end up with duplicates
8630b57cec5SDimitry Andric if (variable_set.find(variable_sp) == variable_set.end())
8640b57cec5SDimitry Andric variable_set.insert(variable_sp);
8650b57cec5SDimitry Andric else
8660b57cec5SDimitry Andric continue;
8670b57cec5SDimitry Andric
8680b57cec5SDimitry Andric if (in_scope_only && !variable_sp->IsInScope(frame))
8690b57cec5SDimitry Andric continue;
8700b57cec5SDimitry Andric
8710b57cec5SDimitry Andric ValueObjectSP valobj_sp(frame->GetValueObjectForFrameVariable(
8720b57cec5SDimitry Andric variable_sp, eNoDynamicValues));
8730b57cec5SDimitry Andric
8740b57cec5SDimitry Andric if (!include_runtime_support_values && valobj_sp != nullptr &&
8750b57cec5SDimitry Andric valobj_sp->IsRuntimeSupportValue())
8760b57cec5SDimitry Andric continue;
8770b57cec5SDimitry Andric
8780b57cec5SDimitry Andric SBValue value_sb;
8790b57cec5SDimitry Andric value_sb.SetSP(valobj_sp, use_dynamic);
8800b57cec5SDimitry Andric value_list.Append(value_sb);
8810b57cec5SDimitry Andric }
8820b57cec5SDimitry Andric }
8830b57cec5SDimitry Andric }
8840b57cec5SDimitry Andric }
8850b57cec5SDimitry Andric }
8860b57cec5SDimitry Andric if (recognized_arguments) {
8870b57cec5SDimitry Andric auto recognized_frame = frame->GetRecognizedFrame();
8880b57cec5SDimitry Andric if (recognized_frame) {
8890b57cec5SDimitry Andric ValueObjectListSP recognized_arg_list =
8900b57cec5SDimitry Andric recognized_frame->GetRecognizedArguments();
8910b57cec5SDimitry Andric if (recognized_arg_list) {
8920b57cec5SDimitry Andric for (auto &rec_value_sp : recognized_arg_list->GetObjects()) {
8930b57cec5SDimitry Andric SBValue value_sb;
8940b57cec5SDimitry Andric value_sb.SetSP(rec_value_sp, use_dynamic);
8950b57cec5SDimitry Andric value_list.Append(value_sb);
8960b57cec5SDimitry Andric }
8970b57cec5SDimitry Andric }
8980b57cec5SDimitry Andric }
8990b57cec5SDimitry Andric }
9000b57cec5SDimitry Andric }
9010b57cec5SDimitry Andric }
9020b57cec5SDimitry Andric }
9030b57cec5SDimitry Andric
9040b57cec5SDimitry Andric return LLDB_RECORD_RESULT(value_list);
9050b57cec5SDimitry Andric }
9060b57cec5SDimitry Andric
GetRegisters()9070b57cec5SDimitry Andric SBValueList SBFrame::GetRegisters() {
9080b57cec5SDimitry Andric LLDB_RECORD_METHOD_NO_ARGS(lldb::SBValueList, SBFrame, GetRegisters);
9090b57cec5SDimitry Andric
9100b57cec5SDimitry Andric SBValueList value_list;
9110b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
9120b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
9130b57cec5SDimitry Andric
9140b57cec5SDimitry Andric StackFrame *frame = nullptr;
9150b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
9160b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
9170b57cec5SDimitry Andric if (target && process) {
9180b57cec5SDimitry Andric Process::StopLocker stop_locker;
9190b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
9200b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
9210b57cec5SDimitry Andric if (frame) {
9220b57cec5SDimitry Andric RegisterContextSP reg_ctx(frame->GetRegisterContext());
9230b57cec5SDimitry Andric if (reg_ctx) {
9240b57cec5SDimitry Andric const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
9250b57cec5SDimitry Andric for (uint32_t set_idx = 0; set_idx < num_sets; ++set_idx) {
9260b57cec5SDimitry Andric value_list.Append(
9270b57cec5SDimitry Andric ValueObjectRegisterSet::Create(frame, reg_ctx, set_idx));
9280b57cec5SDimitry Andric }
9290b57cec5SDimitry Andric }
9300b57cec5SDimitry Andric }
9310b57cec5SDimitry Andric }
9320b57cec5SDimitry Andric }
9330b57cec5SDimitry Andric
9340b57cec5SDimitry Andric return LLDB_RECORD_RESULT(value_list);
9350b57cec5SDimitry Andric }
9360b57cec5SDimitry Andric
FindRegister(const char * name)9370b57cec5SDimitry Andric SBValue SBFrame::FindRegister(const char *name) {
9380b57cec5SDimitry Andric LLDB_RECORD_METHOD(lldb::SBValue, SBFrame, FindRegister, (const char *),
9390b57cec5SDimitry Andric name);
9400b57cec5SDimitry Andric
9410b57cec5SDimitry Andric SBValue result;
9420b57cec5SDimitry Andric ValueObjectSP value_sp;
9430b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
9440b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
9450b57cec5SDimitry Andric
9460b57cec5SDimitry Andric StackFrame *frame = nullptr;
9470b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
9480b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
9490b57cec5SDimitry Andric if (target && process) {
9500b57cec5SDimitry Andric Process::StopLocker stop_locker;
9510b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
9520b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
9530b57cec5SDimitry Andric if (frame) {
9540b57cec5SDimitry Andric RegisterContextSP reg_ctx(frame->GetRegisterContext());
9550b57cec5SDimitry Andric if (reg_ctx) {
9560b57cec5SDimitry Andric const uint32_t num_regs = reg_ctx->GetRegisterCount();
9570b57cec5SDimitry Andric for (uint32_t reg_idx = 0; reg_idx < num_regs; ++reg_idx) {
9580b57cec5SDimitry Andric const RegisterInfo *reg_info =
9590b57cec5SDimitry Andric reg_ctx->GetRegisterInfoAtIndex(reg_idx);
9600b57cec5SDimitry Andric if (reg_info &&
9610b57cec5SDimitry Andric ((reg_info->name && strcasecmp(reg_info->name, name) == 0) ||
9620b57cec5SDimitry Andric (reg_info->alt_name &&
9630b57cec5SDimitry Andric strcasecmp(reg_info->alt_name, name) == 0))) {
9640b57cec5SDimitry Andric value_sp = ValueObjectRegister::Create(frame, reg_ctx, reg_idx);
9650b57cec5SDimitry Andric result.SetSP(value_sp);
9660b57cec5SDimitry Andric break;
9670b57cec5SDimitry Andric }
9680b57cec5SDimitry Andric }
9690b57cec5SDimitry Andric }
9700b57cec5SDimitry Andric }
9710b57cec5SDimitry Andric }
9720b57cec5SDimitry Andric }
9730b57cec5SDimitry Andric
9740b57cec5SDimitry Andric return LLDB_RECORD_RESULT(result);
9750b57cec5SDimitry Andric }
9760b57cec5SDimitry Andric
GetDescription(SBStream & description)9770b57cec5SDimitry Andric bool SBFrame::GetDescription(SBStream &description) {
9780b57cec5SDimitry Andric LLDB_RECORD_METHOD(bool, SBFrame, GetDescription, (lldb::SBStream &),
9790b57cec5SDimitry Andric description);
9800b57cec5SDimitry Andric
9810b57cec5SDimitry Andric Stream &strm = description.ref();
9820b57cec5SDimitry Andric
9830b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
9840b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
9850b57cec5SDimitry Andric
9860b57cec5SDimitry Andric StackFrame *frame;
9870b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
9880b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
9890b57cec5SDimitry Andric if (target && process) {
9900b57cec5SDimitry Andric Process::StopLocker stop_locker;
9910b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
9920b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
9930b57cec5SDimitry Andric if (frame) {
9940b57cec5SDimitry Andric frame->DumpUsingSettingsFormat(&strm);
9950b57cec5SDimitry Andric }
9960b57cec5SDimitry Andric }
9970b57cec5SDimitry Andric
9980b57cec5SDimitry Andric } else
9990b57cec5SDimitry Andric strm.PutCString("No value");
10000b57cec5SDimitry Andric
10010b57cec5SDimitry Andric return true;
10020b57cec5SDimitry Andric }
10030b57cec5SDimitry Andric
EvaluateExpression(const char * expr)10040b57cec5SDimitry Andric SBValue SBFrame::EvaluateExpression(const char *expr) {
10050b57cec5SDimitry Andric LLDB_RECORD_METHOD(lldb::SBValue, SBFrame, EvaluateExpression, (const char *),
10060b57cec5SDimitry Andric expr);
10070b57cec5SDimitry Andric
10080b57cec5SDimitry Andric SBValue result;
10090b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
10100b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
10110b57cec5SDimitry Andric
10120b57cec5SDimitry Andric StackFrame *frame = exe_ctx.GetFramePtr();
10130b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
10140b57cec5SDimitry Andric if (frame && target) {
10150b57cec5SDimitry Andric SBExpressionOptions options;
10160b57cec5SDimitry Andric lldb::DynamicValueType fetch_dynamic_value =
10170b57cec5SDimitry Andric frame->CalculateTarget()->GetPreferDynamicValue();
10180b57cec5SDimitry Andric options.SetFetchDynamicValue(fetch_dynamic_value);
10190b57cec5SDimitry Andric options.SetUnwindOnError(true);
10200b57cec5SDimitry Andric options.SetIgnoreBreakpoints(true);
10210b57cec5SDimitry Andric if (target->GetLanguage() != eLanguageTypeUnknown)
10220b57cec5SDimitry Andric options.SetLanguage(target->GetLanguage());
10230b57cec5SDimitry Andric else
10240b57cec5SDimitry Andric options.SetLanguage(frame->GetLanguage());
10250b57cec5SDimitry Andric return LLDB_RECORD_RESULT(EvaluateExpression(expr, options));
10260b57cec5SDimitry Andric }
10270b57cec5SDimitry Andric return LLDB_RECORD_RESULT(result);
10280b57cec5SDimitry Andric }
10290b57cec5SDimitry Andric
10300b57cec5SDimitry Andric SBValue
EvaluateExpression(const char * expr,lldb::DynamicValueType fetch_dynamic_value)10310b57cec5SDimitry Andric SBFrame::EvaluateExpression(const char *expr,
10320b57cec5SDimitry Andric lldb::DynamicValueType fetch_dynamic_value) {
10330b57cec5SDimitry Andric LLDB_RECORD_METHOD(lldb::SBValue, SBFrame, EvaluateExpression,
10340b57cec5SDimitry Andric (const char *, lldb::DynamicValueType), expr,
10350b57cec5SDimitry Andric fetch_dynamic_value);
10360b57cec5SDimitry Andric
10370b57cec5SDimitry Andric SBExpressionOptions options;
10380b57cec5SDimitry Andric options.SetFetchDynamicValue(fetch_dynamic_value);
10390b57cec5SDimitry Andric options.SetUnwindOnError(true);
10400b57cec5SDimitry Andric options.SetIgnoreBreakpoints(true);
10410b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
10420b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
10430b57cec5SDimitry Andric
10440b57cec5SDimitry Andric StackFrame *frame = exe_ctx.GetFramePtr();
10450b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
10460b57cec5SDimitry Andric if (target && target->GetLanguage() != eLanguageTypeUnknown)
10470b57cec5SDimitry Andric options.SetLanguage(target->GetLanguage());
10480b57cec5SDimitry Andric else if (frame)
10490b57cec5SDimitry Andric options.SetLanguage(frame->GetLanguage());
10500b57cec5SDimitry Andric return LLDB_RECORD_RESULT(EvaluateExpression(expr, options));
10510b57cec5SDimitry Andric }
10520b57cec5SDimitry Andric
EvaluateExpression(const char * expr,lldb::DynamicValueType fetch_dynamic_value,bool unwind_on_error)10530b57cec5SDimitry Andric SBValue SBFrame::EvaluateExpression(const char *expr,
10540b57cec5SDimitry Andric lldb::DynamicValueType fetch_dynamic_value,
10550b57cec5SDimitry Andric bool unwind_on_error) {
10560b57cec5SDimitry Andric LLDB_RECORD_METHOD(lldb::SBValue, SBFrame, EvaluateExpression,
10570b57cec5SDimitry Andric (const char *, lldb::DynamicValueType, bool), expr,
10580b57cec5SDimitry Andric fetch_dynamic_value, unwind_on_error);
10590b57cec5SDimitry Andric
10600b57cec5SDimitry Andric SBExpressionOptions options;
10610b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
10620b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
10630b57cec5SDimitry Andric
10640b57cec5SDimitry Andric options.SetFetchDynamicValue(fetch_dynamic_value);
10650b57cec5SDimitry Andric options.SetUnwindOnError(unwind_on_error);
10660b57cec5SDimitry Andric options.SetIgnoreBreakpoints(true);
10670b57cec5SDimitry Andric StackFrame *frame = exe_ctx.GetFramePtr();
10680b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
10690b57cec5SDimitry Andric if (target && target->GetLanguage() != eLanguageTypeUnknown)
10700b57cec5SDimitry Andric options.SetLanguage(target->GetLanguage());
10710b57cec5SDimitry Andric else if (frame)
10720b57cec5SDimitry Andric options.SetLanguage(frame->GetLanguage());
10730b57cec5SDimitry Andric return LLDB_RECORD_RESULT(EvaluateExpression(expr, options));
10740b57cec5SDimitry Andric }
10750b57cec5SDimitry Andric
EvaluateExpression(const char * expr,const SBExpressionOptions & options)10760b57cec5SDimitry Andric lldb::SBValue SBFrame::EvaluateExpression(const char *expr,
10770b57cec5SDimitry Andric const SBExpressionOptions &options) {
10780b57cec5SDimitry Andric LLDB_RECORD_METHOD(lldb::SBValue, SBFrame, EvaluateExpression,
10790b57cec5SDimitry Andric (const char *, const lldb::SBExpressionOptions &), expr,
10800b57cec5SDimitry Andric options);
10810b57cec5SDimitry Andric
10820b57cec5SDimitry Andric Log *expr_log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
10830b57cec5SDimitry Andric
10840b57cec5SDimitry Andric SBValue expr_result;
10850b57cec5SDimitry Andric
10860b57cec5SDimitry Andric if (expr == nullptr || expr[0] == '\0') {
10870b57cec5SDimitry Andric return LLDB_RECORD_RESULT(expr_result);
10880b57cec5SDimitry Andric }
10890b57cec5SDimitry Andric
10900b57cec5SDimitry Andric ValueObjectSP expr_value_sp;
10910b57cec5SDimitry Andric
10920b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
10930b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
10940b57cec5SDimitry Andric
10950b57cec5SDimitry Andric
10960b57cec5SDimitry Andric StackFrame *frame = nullptr;
10970b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
10980b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
10990b57cec5SDimitry Andric
11000b57cec5SDimitry Andric if (target && process) {
11010b57cec5SDimitry Andric Process::StopLocker stop_locker;
11020b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
11030b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
11040b57cec5SDimitry Andric if (frame) {
11050b57cec5SDimitry Andric std::unique_ptr<llvm::PrettyStackTraceFormat> stack_trace;
11060b57cec5SDimitry Andric if (target->GetDisplayExpressionsInCrashlogs()) {
11070b57cec5SDimitry Andric StreamString frame_description;
11080b57cec5SDimitry Andric frame->DumpUsingSettingsFormat(&frame_description);
11099dba64beSDimitry Andric stack_trace = std::make_unique<llvm::PrettyStackTraceFormat>(
11100b57cec5SDimitry Andric "SBFrame::EvaluateExpression (expr = \"%s\", fetch_dynamic_value "
11110b57cec5SDimitry Andric "= %u) %s",
11120b57cec5SDimitry Andric expr, options.GetFetchDynamicValue(),
11130b57cec5SDimitry Andric frame_description.GetData());
11140b57cec5SDimitry Andric }
11150b57cec5SDimitry Andric
11160b57cec5SDimitry Andric target->EvaluateExpression(expr, frame, expr_value_sp, options.ref());
11170b57cec5SDimitry Andric expr_result.SetSP(expr_value_sp, options.GetFetchDynamicValue());
11180b57cec5SDimitry Andric }
11190b57cec5SDimitry Andric }
11200b57cec5SDimitry Andric }
11210b57cec5SDimitry Andric
11229dba64beSDimitry Andric LLDB_LOGF(expr_log,
11239dba64beSDimitry Andric "** [SBFrame::EvaluateExpression] Expression result is "
11240b57cec5SDimitry Andric "%s, summary %s **",
11250b57cec5SDimitry Andric expr_result.GetValue(), expr_result.GetSummary());
11260b57cec5SDimitry Andric
11270b57cec5SDimitry Andric return LLDB_RECORD_RESULT(expr_result);
11280b57cec5SDimitry Andric }
11290b57cec5SDimitry Andric
IsInlined()11300b57cec5SDimitry Andric bool SBFrame::IsInlined() {
11310b57cec5SDimitry Andric LLDB_RECORD_METHOD_NO_ARGS(bool, SBFrame, IsInlined);
11320b57cec5SDimitry Andric
11330b57cec5SDimitry Andric return static_cast<const SBFrame *>(this)->IsInlined();
11340b57cec5SDimitry Andric }
11350b57cec5SDimitry Andric
IsInlined() const11360b57cec5SDimitry Andric bool SBFrame::IsInlined() const {
11370b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBFrame, IsInlined);
11380b57cec5SDimitry Andric
11390b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
11400b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
11410b57cec5SDimitry Andric
11420b57cec5SDimitry Andric StackFrame *frame = nullptr;
11430b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
11440b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
11450b57cec5SDimitry Andric if (target && process) {
11460b57cec5SDimitry Andric Process::StopLocker stop_locker;
11470b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
11480b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
11490b57cec5SDimitry Andric if (frame) {
11500b57cec5SDimitry Andric
11510b57cec5SDimitry Andric Block *block = frame->GetSymbolContext(eSymbolContextBlock).block;
11520b57cec5SDimitry Andric if (block)
11530b57cec5SDimitry Andric return block->GetContainingInlinedBlock() != nullptr;
11540b57cec5SDimitry Andric }
11550b57cec5SDimitry Andric }
11560b57cec5SDimitry Andric }
11570b57cec5SDimitry Andric return false;
11580b57cec5SDimitry Andric }
11590b57cec5SDimitry Andric
IsArtificial()11600b57cec5SDimitry Andric bool SBFrame::IsArtificial() {
11610b57cec5SDimitry Andric LLDB_RECORD_METHOD_NO_ARGS(bool, SBFrame, IsArtificial);
11620b57cec5SDimitry Andric
11630b57cec5SDimitry Andric return static_cast<const SBFrame *>(this)->IsArtificial();
11640b57cec5SDimitry Andric }
11650b57cec5SDimitry Andric
IsArtificial() const11660b57cec5SDimitry Andric bool SBFrame::IsArtificial() const {
11670b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBFrame, IsArtificial);
11680b57cec5SDimitry Andric
11690b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
11700b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
11710b57cec5SDimitry Andric
11720b57cec5SDimitry Andric StackFrame *frame = exe_ctx.GetFramePtr();
11730b57cec5SDimitry Andric if (frame)
11740b57cec5SDimitry Andric return frame->IsArtificial();
11750b57cec5SDimitry Andric
11760b57cec5SDimitry Andric return false;
11770b57cec5SDimitry Andric }
11780b57cec5SDimitry Andric
GetFunctionName()11790b57cec5SDimitry Andric const char *SBFrame::GetFunctionName() {
11800b57cec5SDimitry Andric LLDB_RECORD_METHOD_NO_ARGS(const char *, SBFrame, GetFunctionName);
11810b57cec5SDimitry Andric
11820b57cec5SDimitry Andric return static_cast<const SBFrame *>(this)->GetFunctionName();
11830b57cec5SDimitry Andric }
11840b57cec5SDimitry Andric
GuessLanguage() const11850b57cec5SDimitry Andric lldb::LanguageType SBFrame::GuessLanguage() const {
11860b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::LanguageType, SBFrame, GuessLanguage);
11870b57cec5SDimitry Andric
11880b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
11890b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
11900b57cec5SDimitry Andric
11910b57cec5SDimitry Andric StackFrame *frame = nullptr;
11920b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
11930b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
11940b57cec5SDimitry Andric if (target && process) {
11950b57cec5SDimitry Andric Process::StopLocker stop_locker;
11960b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
11970b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
11980b57cec5SDimitry Andric if (frame) {
11990b57cec5SDimitry Andric return frame->GuessLanguage();
12000b57cec5SDimitry Andric }
12010b57cec5SDimitry Andric }
12020b57cec5SDimitry Andric }
12030b57cec5SDimitry Andric return eLanguageTypeUnknown;
12040b57cec5SDimitry Andric }
12050b57cec5SDimitry Andric
GetFunctionName() const12060b57cec5SDimitry Andric const char *SBFrame::GetFunctionName() const {
12070b57cec5SDimitry Andric LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBFrame, GetFunctionName);
12080b57cec5SDimitry Andric
12090b57cec5SDimitry Andric const char *name = nullptr;
12100b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
12110b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
12120b57cec5SDimitry Andric
12130b57cec5SDimitry Andric StackFrame *frame = nullptr;
12140b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
12150b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
12160b57cec5SDimitry Andric if (target && process) {
12170b57cec5SDimitry Andric Process::StopLocker stop_locker;
12180b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
12190b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
12200b57cec5SDimitry Andric if (frame) {
12210b57cec5SDimitry Andric SymbolContext sc(frame->GetSymbolContext(eSymbolContextFunction |
12220b57cec5SDimitry Andric eSymbolContextBlock |
12230b57cec5SDimitry Andric eSymbolContextSymbol));
12240b57cec5SDimitry Andric if (sc.block) {
12250b57cec5SDimitry Andric Block *inlined_block = sc.block->GetContainingInlinedBlock();
12260b57cec5SDimitry Andric if (inlined_block) {
12270b57cec5SDimitry Andric const InlineFunctionInfo *inlined_info =
12280b57cec5SDimitry Andric inlined_block->GetInlinedFunctionInfo();
12295ffd83dbSDimitry Andric name = inlined_info->GetName().AsCString();
12300b57cec5SDimitry Andric }
12310b57cec5SDimitry Andric }
12320b57cec5SDimitry Andric
12330b57cec5SDimitry Andric if (name == nullptr) {
12340b57cec5SDimitry Andric if (sc.function)
12350b57cec5SDimitry Andric name = sc.function->GetName().GetCString();
12360b57cec5SDimitry Andric }
12370b57cec5SDimitry Andric
12380b57cec5SDimitry Andric if (name == nullptr) {
12390b57cec5SDimitry Andric if (sc.symbol)
12400b57cec5SDimitry Andric name = sc.symbol->GetName().GetCString();
12410b57cec5SDimitry Andric }
12420b57cec5SDimitry Andric }
12430b57cec5SDimitry Andric }
12440b57cec5SDimitry Andric }
12450b57cec5SDimitry Andric return name;
12460b57cec5SDimitry Andric }
12470b57cec5SDimitry Andric
GetDisplayFunctionName()12480b57cec5SDimitry Andric const char *SBFrame::GetDisplayFunctionName() {
12490b57cec5SDimitry Andric LLDB_RECORD_METHOD_NO_ARGS(const char *, SBFrame, GetDisplayFunctionName);
12500b57cec5SDimitry Andric
12510b57cec5SDimitry Andric const char *name = nullptr;
12520b57cec5SDimitry Andric
12530b57cec5SDimitry Andric std::unique_lock<std::recursive_mutex> lock;
12540b57cec5SDimitry Andric ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
12550b57cec5SDimitry Andric
12560b57cec5SDimitry Andric StackFrame *frame = nullptr;
12570b57cec5SDimitry Andric Target *target = exe_ctx.GetTargetPtr();
12580b57cec5SDimitry Andric Process *process = exe_ctx.GetProcessPtr();
12590b57cec5SDimitry Andric if (target && process) {
12600b57cec5SDimitry Andric Process::StopLocker stop_locker;
12610b57cec5SDimitry Andric if (stop_locker.TryLock(&process->GetRunLock())) {
12620b57cec5SDimitry Andric frame = exe_ctx.GetFramePtr();
12630b57cec5SDimitry Andric if (frame) {
12640b57cec5SDimitry Andric SymbolContext sc(frame->GetSymbolContext(eSymbolContextFunction |
12650b57cec5SDimitry Andric eSymbolContextBlock |
12660b57cec5SDimitry Andric eSymbolContextSymbol));
12670b57cec5SDimitry Andric if (sc.block) {
12680b57cec5SDimitry Andric Block *inlined_block = sc.block->GetContainingInlinedBlock();
12690b57cec5SDimitry Andric if (inlined_block) {
12700b57cec5SDimitry Andric const InlineFunctionInfo *inlined_info =
12710b57cec5SDimitry Andric inlined_block->GetInlinedFunctionInfo();
12725ffd83dbSDimitry Andric name = inlined_info->GetDisplayName().AsCString();
12730b57cec5SDimitry Andric }
12740b57cec5SDimitry Andric }
12750b57cec5SDimitry Andric
12760b57cec5SDimitry Andric if (name == nullptr) {
12770b57cec5SDimitry Andric if (sc.function)
12780b57cec5SDimitry Andric name = sc.function->GetDisplayName().GetCString();
12790b57cec5SDimitry Andric }
12800b57cec5SDimitry Andric
12810b57cec5SDimitry Andric if (name == nullptr) {
12820b57cec5SDimitry Andric if (sc.symbol)
12830b57cec5SDimitry Andric name = sc.symbol->GetDisplayName().GetCString();
12840b57cec5SDimitry Andric }
12850b57cec5SDimitry Andric }
12860b57cec5SDimitry Andric }
12870b57cec5SDimitry Andric }
12880b57cec5SDimitry Andric return name;
12890b57cec5SDimitry Andric }
12900b57cec5SDimitry Andric
12910b57cec5SDimitry Andric namespace lldb_private {
12920b57cec5SDimitry Andric namespace repro {
12930b57cec5SDimitry Andric
12940b57cec5SDimitry Andric template <>
RegisterMethods(Registry & R)12950b57cec5SDimitry Andric void RegisterMethods<SBFrame>(Registry &R) {
12960b57cec5SDimitry Andric LLDB_REGISTER_CONSTRUCTOR(SBFrame, ());
12970b57cec5SDimitry Andric LLDB_REGISTER_CONSTRUCTOR(SBFrame, (const lldb::StackFrameSP &));
12980b57cec5SDimitry Andric LLDB_REGISTER_CONSTRUCTOR(SBFrame, (const lldb::SBFrame &));
12990b57cec5SDimitry Andric LLDB_REGISTER_METHOD(const lldb::SBFrame &,
13000b57cec5SDimitry Andric SBFrame, operator=,(const lldb::SBFrame &));
13010b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(bool, SBFrame, IsValid, ());
13020b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(bool, SBFrame, operator bool, ());
13030b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(lldb::SBSymbolContext, SBFrame, GetSymbolContext,
13040b57cec5SDimitry Andric (uint32_t));
13050b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(lldb::SBModule, SBFrame, GetModule, ());
13060b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(lldb::SBCompileUnit, SBFrame, GetCompileUnit,
13070b57cec5SDimitry Andric ());
13080b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(lldb::SBFunction, SBFrame, GetFunction, ());
13090b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(lldb::SBSymbol, SBFrame, GetSymbol, ());
13100b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(lldb::SBBlock, SBFrame, GetBlock, ());
13110b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(lldb::SBBlock, SBFrame, GetFrameBlock, ());
13120b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(lldb::SBLineEntry, SBFrame, GetLineEntry, ());
13130b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(uint32_t, SBFrame, GetFrameID, ());
13140b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(lldb::addr_t, SBFrame, GetCFA, ());
13150b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(lldb::addr_t, SBFrame, GetPC, ());
13160b57cec5SDimitry Andric LLDB_REGISTER_METHOD(bool, SBFrame, SetPC, (lldb::addr_t));
13170b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(lldb::addr_t, SBFrame, GetSP, ());
13180b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(lldb::addr_t, SBFrame, GetFP, ());
13190b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(lldb::SBAddress, SBFrame, GetPCAddress, ());
13200b57cec5SDimitry Andric LLDB_REGISTER_METHOD(void, SBFrame, Clear, ());
13210b57cec5SDimitry Andric LLDB_REGISTER_METHOD(lldb::SBValue, SBFrame, GetValueForVariablePath,
13220b57cec5SDimitry Andric (const char *));
13230b57cec5SDimitry Andric LLDB_REGISTER_METHOD(lldb::SBValue, SBFrame, GetValueForVariablePath,
13240b57cec5SDimitry Andric (const char *, lldb::DynamicValueType));
13250b57cec5SDimitry Andric LLDB_REGISTER_METHOD(lldb::SBValue, SBFrame, FindVariable, (const char *));
13260b57cec5SDimitry Andric LLDB_REGISTER_METHOD(lldb::SBValue, SBFrame, FindVariable,
13270b57cec5SDimitry Andric (const char *, lldb::DynamicValueType));
13280b57cec5SDimitry Andric LLDB_REGISTER_METHOD(lldb::SBValue, SBFrame, FindValue,
13290b57cec5SDimitry Andric (const char *, lldb::ValueType));
13300b57cec5SDimitry Andric LLDB_REGISTER_METHOD(
13310b57cec5SDimitry Andric lldb::SBValue, SBFrame, FindValue,
13320b57cec5SDimitry Andric (const char *, lldb::ValueType, lldb::DynamicValueType));
13330b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(bool, SBFrame, IsEqual, (const lldb::SBFrame &));
13340b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(bool,
13350b57cec5SDimitry Andric SBFrame, operator==,(const lldb::SBFrame &));
13360b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(bool,
13370b57cec5SDimitry Andric SBFrame, operator!=,(const lldb::SBFrame &));
13380b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(lldb::SBThread, SBFrame, GetThread, ());
13390b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(const char *, SBFrame, Disassemble, ());
13400b57cec5SDimitry Andric LLDB_REGISTER_METHOD(lldb::SBValueList, SBFrame, GetVariables,
13410b57cec5SDimitry Andric (bool, bool, bool, bool));
13420b57cec5SDimitry Andric LLDB_REGISTER_METHOD(lldb::SBValueList, SBFrame, GetVariables,
13430b57cec5SDimitry Andric (bool, bool, bool, bool, lldb::DynamicValueType));
13440b57cec5SDimitry Andric LLDB_REGISTER_METHOD(lldb::SBValueList, SBFrame, GetVariables,
13450b57cec5SDimitry Andric (const lldb::SBVariablesOptions &));
13460b57cec5SDimitry Andric LLDB_REGISTER_METHOD(lldb::SBValueList, SBFrame, GetRegisters, ());
13470b57cec5SDimitry Andric LLDB_REGISTER_METHOD(lldb::SBValue, SBFrame, FindRegister, (const char *));
13480b57cec5SDimitry Andric LLDB_REGISTER_METHOD(bool, SBFrame, GetDescription, (lldb::SBStream &));
13490b57cec5SDimitry Andric LLDB_REGISTER_METHOD(lldb::SBValue, SBFrame, EvaluateExpression,
13500b57cec5SDimitry Andric (const char *));
13510b57cec5SDimitry Andric LLDB_REGISTER_METHOD(lldb::SBValue, SBFrame, EvaluateExpression,
13520b57cec5SDimitry Andric (const char *, lldb::DynamicValueType));
13530b57cec5SDimitry Andric LLDB_REGISTER_METHOD(lldb::SBValue, SBFrame, EvaluateExpression,
13540b57cec5SDimitry Andric (const char *, lldb::DynamicValueType, bool));
13550b57cec5SDimitry Andric LLDB_REGISTER_METHOD(lldb::SBValue, SBFrame, EvaluateExpression,
13560b57cec5SDimitry Andric (const char *, const lldb::SBExpressionOptions &));
13570b57cec5SDimitry Andric LLDB_REGISTER_METHOD(bool, SBFrame, IsInlined, ());
13580b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(bool, SBFrame, IsInlined, ());
13590b57cec5SDimitry Andric LLDB_REGISTER_METHOD(bool, SBFrame, IsArtificial, ());
13600b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(bool, SBFrame, IsArtificial, ());
13610b57cec5SDimitry Andric LLDB_REGISTER_METHOD(const char *, SBFrame, GetFunctionName, ());
13620b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(lldb::LanguageType, SBFrame, GuessLanguage, ());
13630b57cec5SDimitry Andric LLDB_REGISTER_METHOD_CONST(const char *, SBFrame, GetFunctionName, ());
13640b57cec5SDimitry Andric LLDB_REGISTER_METHOD(const char *, SBFrame, GetDisplayFunctionName, ());
13650b57cec5SDimitry Andric }
13660b57cec5SDimitry Andric
13670b57cec5SDimitry Andric }
13680b57cec5SDimitry Andric }
1369