1 //===-- SBFrame.cpp ---------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
16 // Other libraries and framework includes
18 #include "lldb/API/SBFrame.h"
20 #include "lldb/lldb-types.h"
22 #include "Plugins/ExpressionParser/Clang/ClangPersistentVariables.h"
23 #include "lldb/Core/Address.h"
24 #include "lldb/Core/StreamFile.h"
25 #include "lldb/Core/ValueObjectRegister.h"
26 #include "lldb/Core/ValueObjectVariable.h"
27 #include "lldb/Expression/UserExpression.h"
28 #include "lldb/Host/Host.h"
29 #include "lldb/Symbol/Block.h"
30 #include "lldb/Symbol/Function.h"
31 #include "lldb/Symbol/Symbol.h"
32 #include "lldb/Symbol/SymbolContext.h"
33 #include "lldb/Symbol/Variable.h"
34 #include "lldb/Symbol/VariableList.h"
35 #include "lldb/Target/ExecutionContext.h"
36 #include "lldb/Target/Process.h"
37 #include "lldb/Target/RegisterContext.h"
38 #include "lldb/Target/StackFrame.h"
39 #include "lldb/Target/StackID.h"
40 #include "lldb/Target/Target.h"
41 #include "lldb/Target/Thread.h"
42 #include "lldb/Utility/ConstString.h"
43 #include "lldb/Utility/Log.h"
44 #include "lldb/Utility/Stream.h"
46 #include "lldb/API/SBAddress.h"
47 #include "lldb/API/SBDebugger.h"
48 #include "lldb/API/SBExpressionOptions.h"
49 #include "lldb/API/SBStream.h"
50 #include "lldb/API/SBSymbolContext.h"
51 #include "lldb/API/SBThread.h"
52 #include "lldb/API/SBValue.h"
53 #include "lldb/API/SBVariablesOptions.h"
55 #include "llvm/Support/PrettyStackTrace.h"
58 using namespace lldb_private;
60 SBFrame::SBFrame() : m_opaque_sp(new ExecutionContextRef()) {}
62 SBFrame::SBFrame(const StackFrameSP &lldb_object_sp)
63 : m_opaque_sp(new ExecutionContextRef(lldb_object_sp)) {
64 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
69 log->Printf("SBFrame::SBFrame (sp=%p) => SBFrame(%p): %s",
70 static_cast<void *>(lldb_object_sp.get()),
71 static_cast<void *>(lldb_object_sp.get()), sstr.GetData());
75 SBFrame::SBFrame(const SBFrame &rhs)
76 : m_opaque_sp(new ExecutionContextRef(*rhs.m_opaque_sp)) {}
78 SBFrame::~SBFrame() = default;
80 const SBFrame &SBFrame::operator=(const SBFrame &rhs) {
82 *m_opaque_sp = *rhs.m_opaque_sp;
86 StackFrameSP SBFrame::GetFrameSP() const {
87 return (m_opaque_sp ? m_opaque_sp->GetFrameSP() : StackFrameSP());
90 void SBFrame::SetFrameSP(const StackFrameSP &lldb_object_sp) {
91 return m_opaque_sp->SetFrameSP(lldb_object_sp);
94 bool SBFrame::IsValid() const {
95 std::unique_lock<std::recursive_mutex> lock;
96 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
98 Target *target = exe_ctx.GetTargetPtr();
99 Process *process = exe_ctx.GetProcessPtr();
100 if (target && process) {
101 Process::StopLocker stop_locker;
102 if (stop_locker.TryLock(&process->GetRunLock()))
103 return GetFrameSP().get() != nullptr;
106 // Without a target & process we can't have a valid stack frame.
110 SBSymbolContext SBFrame::GetSymbolContext(uint32_t resolve_scope) const {
111 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
112 SBSymbolContext sb_sym_ctx;
113 std::unique_lock<std::recursive_mutex> lock;
114 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
116 StackFrame *frame = nullptr;
117 Target *target = exe_ctx.GetTargetPtr();
118 Process *process = exe_ctx.GetProcessPtr();
119 if (target && process) {
120 Process::StopLocker stop_locker;
121 if (stop_locker.TryLock(&process->GetRunLock())) {
122 frame = exe_ctx.GetFramePtr();
124 sb_sym_ctx.SetSymbolContext(&frame->GetSymbolContext(resolve_scope));
127 log->Printf("SBFrame::GetVariables () => error: could not "
128 "reconstruct frame object for this SBFrame.");
133 "SBFrame::GetSymbolContext () => error: process is running");
138 log->Printf("SBFrame(%p)::GetSymbolContext (resolve_scope=0x%8.8x) => "
139 "SBSymbolContext(%p)",
140 static_cast<void *>(frame), resolve_scope,
141 static_cast<void *>(sb_sym_ctx.get()));
146 SBModule SBFrame::GetModule() const {
147 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
150 std::unique_lock<std::recursive_mutex> lock;
151 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
153 StackFrame *frame = nullptr;
154 Target *target = exe_ctx.GetTargetPtr();
155 Process *process = exe_ctx.GetProcessPtr();
156 if (target && process) {
157 Process::StopLocker stop_locker;
158 if (stop_locker.TryLock(&process->GetRunLock())) {
159 frame = exe_ctx.GetFramePtr();
161 module_sp = frame->GetSymbolContext(eSymbolContextModule).module_sp;
162 sb_module.SetSP(module_sp);
165 log->Printf("SBFrame::GetModule () => error: could not reconstruct "
166 "frame object for this SBFrame.");
170 log->Printf("SBFrame::GetModule () => error: process is running");
175 log->Printf("SBFrame(%p)::GetModule () => SBModule(%p)",
176 static_cast<void *>(frame),
177 static_cast<void *>(module_sp.get()));
182 SBCompileUnit SBFrame::GetCompileUnit() const {
183 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
184 SBCompileUnit sb_comp_unit;
185 std::unique_lock<std::recursive_mutex> lock;
186 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
188 StackFrame *frame = nullptr;
189 Target *target = exe_ctx.GetTargetPtr();
190 Process *process = exe_ctx.GetProcessPtr();
191 if (target && process) {
192 Process::StopLocker stop_locker;
193 if (stop_locker.TryLock(&process->GetRunLock())) {
194 frame = exe_ctx.GetFramePtr();
197 frame->GetSymbolContext(eSymbolContextCompUnit).comp_unit);
200 log->Printf("SBFrame::GetCompileUnit () => error: could not "
201 "reconstruct frame object for this SBFrame.");
205 log->Printf("SBFrame::GetCompileUnit () => error: process is running");
209 log->Printf("SBFrame(%p)::GetCompileUnit () => SBCompileUnit(%p)",
210 static_cast<void *>(frame),
211 static_cast<void *>(sb_comp_unit.get()));
216 SBFunction SBFrame::GetFunction() const {
217 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
218 SBFunction sb_function;
219 std::unique_lock<std::recursive_mutex> lock;
220 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
222 StackFrame *frame = nullptr;
223 Target *target = exe_ctx.GetTargetPtr();
224 Process *process = exe_ctx.GetProcessPtr();
225 if (target && process) {
226 Process::StopLocker stop_locker;
227 if (stop_locker.TryLock(&process->GetRunLock())) {
228 frame = exe_ctx.GetFramePtr();
231 frame->GetSymbolContext(eSymbolContextFunction).function);
234 log->Printf("SBFrame::GetFunction () => error: could not reconstruct "
235 "frame object for this SBFrame.");
239 log->Printf("SBFrame::GetFunction () => error: process is running");
243 log->Printf("SBFrame(%p)::GetFunction () => SBFunction(%p)",
244 static_cast<void *>(frame),
245 static_cast<void *>(sb_function.get()));
250 SBSymbol SBFrame::GetSymbol() const {
251 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
253 std::unique_lock<std::recursive_mutex> lock;
254 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
256 StackFrame *frame = nullptr;
257 Target *target = exe_ctx.GetTargetPtr();
258 Process *process = exe_ctx.GetProcessPtr();
259 if (target && process) {
260 Process::StopLocker stop_locker;
261 if (stop_locker.TryLock(&process->GetRunLock())) {
262 frame = exe_ctx.GetFramePtr();
264 sb_symbol.reset(frame->GetSymbolContext(eSymbolContextSymbol).symbol);
267 log->Printf("SBFrame::GetSymbol () => error: could not reconstruct "
268 "frame object for this SBFrame.");
272 log->Printf("SBFrame::GetSymbol () => error: process is running");
276 log->Printf("SBFrame(%p)::GetSymbol () => SBSymbol(%p)",
277 static_cast<void *>(frame),
278 static_cast<void *>(sb_symbol.get()));
282 SBBlock SBFrame::GetBlock() const {
283 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
285 std::unique_lock<std::recursive_mutex> lock;
286 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
288 StackFrame *frame = nullptr;
289 Target *target = exe_ctx.GetTargetPtr();
290 Process *process = exe_ctx.GetProcessPtr();
291 if (target && process) {
292 Process::StopLocker stop_locker;
293 if (stop_locker.TryLock(&process->GetRunLock())) {
294 frame = exe_ctx.GetFramePtr();
296 sb_block.SetPtr(frame->GetSymbolContext(eSymbolContextBlock).block);
299 log->Printf("SBFrame::GetBlock () => error: could not reconstruct "
300 "frame object for this SBFrame.");
304 log->Printf("SBFrame(%p)::GetBlock () => error: process is running",
305 static_cast<void *>(frame));
309 log->Printf("SBFrame(%p)::GetBlock () => SBBlock(%p)",
310 static_cast<void *>(frame),
311 static_cast<void *>(sb_block.GetPtr()));
315 SBBlock SBFrame::GetFrameBlock() const {
317 std::unique_lock<std::recursive_mutex> lock;
318 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
320 StackFrame *frame = nullptr;
321 Target *target = exe_ctx.GetTargetPtr();
322 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
323 Process *process = exe_ctx.GetProcessPtr();
324 if (target && process) {
325 Process::StopLocker stop_locker;
326 if (stop_locker.TryLock(&process->GetRunLock())) {
327 frame = exe_ctx.GetFramePtr();
329 sb_block.SetPtr(frame->GetFrameBlock());
332 log->Printf("SBFrame::GetFrameBlock () => error: could not "
333 "reconstruct frame object for this SBFrame.");
337 log->Printf("SBFrame::GetFrameBlock () => error: process is running");
341 log->Printf("SBFrame(%p)::GetFrameBlock () => SBBlock(%p)",
342 static_cast<void *>(frame),
343 static_cast<void *>(sb_block.GetPtr()));
347 SBLineEntry SBFrame::GetLineEntry() const {
348 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
349 SBLineEntry sb_line_entry;
350 std::unique_lock<std::recursive_mutex> lock;
351 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
353 StackFrame *frame = nullptr;
354 Target *target = exe_ctx.GetTargetPtr();
355 Process *process = exe_ctx.GetProcessPtr();
356 if (target && process) {
357 Process::StopLocker stop_locker;
358 if (stop_locker.TryLock(&process->GetRunLock())) {
359 frame = exe_ctx.GetFramePtr();
361 sb_line_entry.SetLineEntry(
362 frame->GetSymbolContext(eSymbolContextLineEntry).line_entry);
365 log->Printf("SBFrame::GetLineEntry () => error: could not "
366 "reconstruct frame object for this SBFrame.");
370 log->Printf("SBFrame::GetLineEntry () => error: process is running");
374 log->Printf("SBFrame(%p)::GetLineEntry () => SBLineEntry(%p)",
375 static_cast<void *>(frame),
376 static_cast<void *>(sb_line_entry.get()));
377 return sb_line_entry;
380 uint32_t SBFrame::GetFrameID() const {
381 uint32_t frame_idx = UINT32_MAX;
383 std::unique_lock<std::recursive_mutex> lock;
384 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
386 StackFrame *frame = exe_ctx.GetFramePtr();
388 frame_idx = frame->GetFrameIndex();
390 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
392 log->Printf("SBFrame(%p)::GetFrameID () => %u", static_cast<void *>(frame),
397 lldb::addr_t SBFrame::GetCFA() const {
398 std::unique_lock<std::recursive_mutex> lock;
399 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
401 StackFrame *frame = exe_ctx.GetFramePtr();
403 return frame->GetStackID().GetCallFrameAddress();
404 return LLDB_INVALID_ADDRESS;
407 addr_t SBFrame::GetPC() const {
408 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
409 addr_t addr = LLDB_INVALID_ADDRESS;
410 std::unique_lock<std::recursive_mutex> lock;
411 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
413 StackFrame *frame = nullptr;
414 Target *target = exe_ctx.GetTargetPtr();
415 Process *process = exe_ctx.GetProcessPtr();
416 if (target && process) {
417 Process::StopLocker stop_locker;
418 if (stop_locker.TryLock(&process->GetRunLock())) {
419 frame = exe_ctx.GetFramePtr();
421 addr = frame->GetFrameCodeAddress().GetOpcodeLoadAddress(
422 target, eAddressClassCode);
425 log->Printf("SBFrame::GetPC () => error: could not reconstruct frame "
426 "object for this SBFrame.");
430 log->Printf("SBFrame::GetPC () => error: process is running");
435 log->Printf("SBFrame(%p)::GetPC () => 0x%" PRIx64,
436 static_cast<void *>(frame), addr);
441 bool SBFrame::SetPC(addr_t new_pc) {
442 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
443 bool ret_val = false;
444 std::unique_lock<std::recursive_mutex> lock;
445 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
447 StackFrame *frame = nullptr;
448 Target *target = exe_ctx.GetTargetPtr();
449 Process *process = exe_ctx.GetProcessPtr();
450 if (target && process) {
451 Process::StopLocker stop_locker;
452 if (stop_locker.TryLock(&process->GetRunLock())) {
453 frame = exe_ctx.GetFramePtr();
455 ret_val = frame->GetRegisterContext()->SetPC(new_pc);
458 log->Printf("SBFrame::SetPC () => error: could not reconstruct frame "
459 "object for this SBFrame.");
463 log->Printf("SBFrame::SetPC () => error: process is running");
468 log->Printf("SBFrame(%p)::SetPC (new_pc=0x%" PRIx64 ") => %i",
469 static_cast<void *>(frame), new_pc, ret_val);
474 addr_t SBFrame::GetSP() const {
475 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
476 addr_t addr = LLDB_INVALID_ADDRESS;
477 std::unique_lock<std::recursive_mutex> lock;
478 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
480 StackFrame *frame = nullptr;
481 Target *target = exe_ctx.GetTargetPtr();
482 Process *process = exe_ctx.GetProcessPtr();
483 if (target && process) {
484 Process::StopLocker stop_locker;
485 if (stop_locker.TryLock(&process->GetRunLock())) {
486 frame = exe_ctx.GetFramePtr();
488 addr = frame->GetRegisterContext()->GetSP();
491 log->Printf("SBFrame::GetSP () => error: could not reconstruct frame "
492 "object for this SBFrame.");
496 log->Printf("SBFrame::GetSP () => error: process is running");
500 log->Printf("SBFrame(%p)::GetSP () => 0x%" PRIx64,
501 static_cast<void *>(frame), addr);
506 addr_t SBFrame::GetFP() const {
507 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
508 addr_t addr = LLDB_INVALID_ADDRESS;
509 std::unique_lock<std::recursive_mutex> lock;
510 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
512 StackFrame *frame = nullptr;
513 Target *target = exe_ctx.GetTargetPtr();
514 Process *process = exe_ctx.GetProcessPtr();
515 if (target && process) {
516 Process::StopLocker stop_locker;
517 if (stop_locker.TryLock(&process->GetRunLock())) {
518 frame = exe_ctx.GetFramePtr();
520 addr = frame->GetRegisterContext()->GetFP();
523 log->Printf("SBFrame::GetFP () => error: could not reconstruct frame "
524 "object for this SBFrame.");
528 log->Printf("SBFrame::GetFP () => error: process is running");
533 log->Printf("SBFrame(%p)::GetFP () => 0x%" PRIx64,
534 static_cast<void *>(frame), addr);
538 SBAddress SBFrame::GetPCAddress() const {
539 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
541 std::unique_lock<std::recursive_mutex> lock;
542 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
544 StackFrame *frame = exe_ctx.GetFramePtr();
545 Target *target = exe_ctx.GetTargetPtr();
546 Process *process = exe_ctx.GetProcessPtr();
547 if (target && process) {
548 Process::StopLocker stop_locker;
549 if (stop_locker.TryLock(&process->GetRunLock())) {
550 frame = exe_ctx.GetFramePtr();
552 sb_addr.SetAddress(&frame->GetFrameCodeAddress());
555 log->Printf("SBFrame::GetPCAddress () => error: could not "
556 "reconstruct frame object for this SBFrame.");
560 log->Printf("SBFrame::GetPCAddress () => error: process is running");
564 log->Printf("SBFrame(%p)::GetPCAddress () => SBAddress(%p)",
565 static_cast<void *>(frame), static_cast<void *>(sb_addr.get()));
569 void SBFrame::Clear() { m_opaque_sp->Clear(); }
571 lldb::SBValue SBFrame::GetValueForVariablePath(const char *var_path) {
573 std::unique_lock<std::recursive_mutex> lock;
574 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
576 StackFrame *frame = exe_ctx.GetFramePtr();
577 Target *target = exe_ctx.GetTargetPtr();
578 if (frame && target) {
579 lldb::DynamicValueType use_dynamic =
580 frame->CalculateTarget()->GetPreferDynamicValue();
581 sb_value = GetValueForVariablePath(var_path, use_dynamic);
586 lldb::SBValue SBFrame::GetValueForVariablePath(const char *var_path,
587 DynamicValueType use_dynamic) {
589 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
590 if (var_path == nullptr || var_path[0] == '\0') {
593 "SBFrame::GetValueForVariablePath called with empty variable path.");
597 std::unique_lock<std::recursive_mutex> lock;
598 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
600 StackFrame *frame = nullptr;
601 Target *target = exe_ctx.GetTargetPtr();
602 Process *process = exe_ctx.GetProcessPtr();
603 if (target && process) {
604 Process::StopLocker stop_locker;
605 if (stop_locker.TryLock(&process->GetRunLock())) {
606 frame = exe_ctx.GetFramePtr();
610 ValueObjectSP value_sp(frame->GetValueForVariableExpressionPath(
611 var_path, eNoDynamicValues,
612 StackFrame::eExpressionPathOptionCheckPtrVsMember |
613 StackFrame::eExpressionPathOptionsAllowDirectIVarAccess,
615 sb_value.SetSP(value_sp, use_dynamic);
618 log->Printf("SBFrame::GetValueForVariablePath () => error: could not "
619 "reconstruct frame object for this SBFrame.");
624 "SBFrame::GetValueForVariablePath () => error: process is running");
630 SBValue SBFrame::FindVariable(const char *name) {
632 std::unique_lock<std::recursive_mutex> lock;
633 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
635 StackFrame *frame = exe_ctx.GetFramePtr();
636 Target *target = exe_ctx.GetTargetPtr();
637 if (frame && target) {
638 lldb::DynamicValueType use_dynamic =
639 frame->CalculateTarget()->GetPreferDynamicValue();
640 value = FindVariable(name, use_dynamic);
645 SBValue SBFrame::FindVariable(const char *name,
646 lldb::DynamicValueType use_dynamic) {
647 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
651 if (name == nullptr || name[0] == '\0') {
653 log->Printf("SBFrame::FindVariable called with empty name");
657 ValueObjectSP value_sp;
658 std::unique_lock<std::recursive_mutex> lock;
659 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
661 StackFrame *frame = nullptr;
662 Target *target = exe_ctx.GetTargetPtr();
663 Process *process = exe_ctx.GetProcessPtr();
664 if (target && process) {
665 Process::StopLocker stop_locker;
666 if (stop_locker.TryLock(&process->GetRunLock())) {
667 frame = exe_ctx.GetFramePtr();
669 VariableList variable_list;
670 SymbolContext sc(frame->GetSymbolContext(eSymbolContextBlock));
673 const bool can_create = true;
674 const bool get_parent_variables = true;
675 const bool stop_if_block_is_inlined_function = true;
677 if (sc.block->AppendVariables(
678 can_create, get_parent_variables,
679 stop_if_block_is_inlined_function,
680 [frame](Variable *v) { return v->IsInScope(frame); },
682 var_sp = variable_list.FindVariable(ConstString(name));
688 frame->GetValueObjectForFrameVariable(var_sp, eNoDynamicValues);
689 sb_value.SetSP(value_sp, use_dynamic);
693 log->Printf("SBFrame::FindVariable () => error: could not "
694 "reconstruct frame object for this SBFrame.");
698 log->Printf("SBFrame::FindVariable () => error: process is running");
703 log->Printf("SBFrame(%p)::FindVariable (name=\"%s\") => SBValue(%p)",
704 static_cast<void *>(frame), name,
705 static_cast<void *>(value_sp.get()));
710 SBValue SBFrame::FindValue(const char *name, ValueType value_type) {
712 std::unique_lock<std::recursive_mutex> lock;
713 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
715 StackFrame *frame = exe_ctx.GetFramePtr();
716 Target *target = exe_ctx.GetTargetPtr();
717 if (frame && target) {
718 lldb::DynamicValueType use_dynamic =
719 frame->CalculateTarget()->GetPreferDynamicValue();
720 value = FindValue(name, value_type, use_dynamic);
725 SBValue SBFrame::FindValue(const char *name, ValueType value_type,
726 lldb::DynamicValueType use_dynamic) {
727 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
730 if (name == nullptr || name[0] == '\0') {
732 log->Printf("SBFrame::FindValue called with empty name.");
736 ValueObjectSP value_sp;
737 std::unique_lock<std::recursive_mutex> lock;
738 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
740 StackFrame *frame = nullptr;
741 Target *target = exe_ctx.GetTargetPtr();
742 Process *process = exe_ctx.GetProcessPtr();
743 if (target && process) {
744 Process::StopLocker stop_locker;
745 if (stop_locker.TryLock(&process->GetRunLock())) {
746 frame = exe_ctx.GetFramePtr();
748 VariableList variable_list;
750 switch (value_type) {
751 case eValueTypeVariableGlobal: // global variable
752 case eValueTypeVariableStatic: // static variable
753 case eValueTypeVariableArgument: // function argument variables
754 case eValueTypeVariableLocal: // function local variables
755 case eValueTypeVariableThreadLocal: // thread local variables
757 SymbolContext sc(frame->GetSymbolContext(eSymbolContextBlock));
759 const bool can_create = true;
760 const bool get_parent_variables = true;
761 const bool stop_if_block_is_inlined_function = true;
764 sc.block->AppendVariables(
765 can_create, get_parent_variables,
766 stop_if_block_is_inlined_function,
767 [frame](Variable *v) { return v->IsInScope(frame); },
769 if (value_type == eValueTypeVariableGlobal) {
770 const bool get_file_globals = true;
771 VariableList *frame_vars = frame->GetVariableList(get_file_globals);
773 frame_vars->AppendVariablesIfUnique(variable_list);
775 ConstString const_name(name);
776 VariableSP variable_sp(
777 variable_list.FindVariable(const_name, value_type));
779 value_sp = frame->GetValueObjectForFrameVariable(variable_sp,
781 sb_value.SetSP(value_sp, use_dynamic);
785 case eValueTypeRegister: // stack frame register value
787 RegisterContextSP reg_ctx(frame->GetRegisterContext());
789 const uint32_t num_regs = reg_ctx->GetRegisterCount();
790 for (uint32_t reg_idx = 0; reg_idx < num_regs; ++reg_idx) {
791 const RegisterInfo *reg_info =
792 reg_ctx->GetRegisterInfoAtIndex(reg_idx);
794 ((reg_info->name && strcasecmp(reg_info->name, name) == 0) ||
795 (reg_info->alt_name &&
796 strcasecmp(reg_info->alt_name, name) == 0))) {
797 value_sp = ValueObjectRegister::Create(frame, reg_ctx, reg_idx);
798 sb_value.SetSP(value_sp);
805 case eValueTypeRegisterSet: // A collection of stack frame register
808 RegisterContextSP reg_ctx(frame->GetRegisterContext());
810 const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
811 for (uint32_t set_idx = 0; set_idx < num_sets; ++set_idx) {
812 const RegisterSet *reg_set = reg_ctx->GetRegisterSet(set_idx);
814 ((reg_set->name && strcasecmp(reg_set->name, name) == 0) ||
815 (reg_set->short_name &&
816 strcasecmp(reg_set->short_name, name) == 0))) {
818 ValueObjectRegisterSet::Create(frame, reg_ctx, set_idx);
819 sb_value.SetSP(value_sp);
826 case eValueTypeConstResult: // constant result variables
828 ConstString const_name(name);
829 ExpressionVariableSP expr_var_sp(
830 target->GetPersistentVariable(const_name));
832 value_sp = expr_var_sp->GetValueObject();
833 sb_value.SetSP(value_sp, use_dynamic);
842 log->Printf("SBFrame::FindValue () => error: could not reconstruct "
843 "frame object for this SBFrame.");
847 log->Printf("SBFrame::FindValue () => error: process is running");
852 log->Printf("SBFrame(%p)::FindVariableInScope (name=\"%s\", value_type=%i) "
854 static_cast<void *>(frame), name, value_type,
855 static_cast<void *>(value_sp.get()));
860 bool SBFrame::IsEqual(const SBFrame &that) const {
861 lldb::StackFrameSP this_sp = GetFrameSP();
862 lldb::StackFrameSP that_sp = that.GetFrameSP();
863 return (this_sp && that_sp && this_sp->GetStackID() == that_sp->GetStackID());
866 bool SBFrame::operator==(const SBFrame &rhs) const { return IsEqual(rhs); }
868 bool SBFrame::operator!=(const SBFrame &rhs) const { return !IsEqual(rhs); }
870 SBThread SBFrame::GetThread() const {
871 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
873 std::unique_lock<std::recursive_mutex> lock;
874 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
876 ThreadSP thread_sp(exe_ctx.GetThreadSP());
877 SBThread sb_thread(thread_sp);
881 sb_thread.GetDescription(sstr);
882 log->Printf("SBFrame(%p)::GetThread () => SBThread(%p): %s",
883 static_cast<void *>(exe_ctx.GetFramePtr()),
884 static_cast<void *>(thread_sp.get()), sstr.GetData());
890 const char *SBFrame::Disassemble() const {
891 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
892 const char *disassembly = nullptr;
893 std::unique_lock<std::recursive_mutex> lock;
894 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
896 StackFrame *frame = nullptr;
897 Target *target = exe_ctx.GetTargetPtr();
898 Process *process = exe_ctx.GetProcessPtr();
899 if (target && process) {
900 Process::StopLocker stop_locker;
901 if (stop_locker.TryLock(&process->GetRunLock())) {
902 frame = exe_ctx.GetFramePtr();
904 disassembly = frame->Disassemble();
907 log->Printf("SBFrame::Disassemble () => error: could not reconstruct "
908 "frame object for this SBFrame.");
912 log->Printf("SBFrame::Disassemble () => error: process is running");
917 log->Printf("SBFrame(%p)::Disassemble () => %s", static_cast<void *>(frame),
923 SBValueList SBFrame::GetVariables(bool arguments, bool locals, bool statics,
924 bool in_scope_only) {
925 SBValueList value_list;
926 std::unique_lock<std::recursive_mutex> lock;
927 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
929 StackFrame *frame = exe_ctx.GetFramePtr();
930 Target *target = exe_ctx.GetTargetPtr();
931 if (frame && target) {
932 lldb::DynamicValueType use_dynamic =
933 frame->CalculateTarget()->GetPreferDynamicValue();
934 const bool include_runtime_support_values =
935 target ? target->GetDisplayRuntimeSupportValues() : false;
937 SBVariablesOptions options;
938 options.SetIncludeArguments(arguments);
939 options.SetIncludeLocals(locals);
940 options.SetIncludeStatics(statics);
941 options.SetInScopeOnly(in_scope_only);
942 options.SetIncludeRuntimeSupportValues(include_runtime_support_values);
943 options.SetUseDynamic(use_dynamic);
945 value_list = GetVariables(options);
950 lldb::SBValueList SBFrame::GetVariables(bool arguments, bool locals,
951 bool statics, bool in_scope_only,
952 lldb::DynamicValueType use_dynamic) {
953 std::unique_lock<std::recursive_mutex> lock;
954 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
956 Target *target = exe_ctx.GetTargetPtr();
957 const bool include_runtime_support_values =
958 target ? target->GetDisplayRuntimeSupportValues() : false;
959 SBVariablesOptions options;
960 options.SetIncludeArguments(arguments);
961 options.SetIncludeLocals(locals);
962 options.SetIncludeStatics(statics);
963 options.SetInScopeOnly(in_scope_only);
964 options.SetIncludeRuntimeSupportValues(include_runtime_support_values);
965 options.SetUseDynamic(use_dynamic);
966 return GetVariables(options);
969 SBValueList SBFrame::GetVariables(const lldb::SBVariablesOptions &options) {
970 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
972 SBValueList value_list;
973 std::unique_lock<std::recursive_mutex> lock;
974 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
976 StackFrame *frame = nullptr;
977 Target *target = exe_ctx.GetTargetPtr();
979 const bool statics = options.GetIncludeStatics();
980 const bool arguments = options.GetIncludeArguments();
981 const bool locals = options.GetIncludeLocals();
982 const bool in_scope_only = options.GetInScopeOnly();
983 const bool include_runtime_support_values =
984 options.GetIncludeRuntimeSupportValues();
985 const lldb::DynamicValueType use_dynamic = options.GetUseDynamic();
988 log->Printf("SBFrame::GetVariables (arguments=%i, locals=%i, statics=%i, "
989 "in_scope_only=%i runtime=%i dynamic=%i)",
990 arguments, locals, statics, in_scope_only,
991 include_runtime_support_values, use_dynamic);
993 std::set<VariableSP> variable_set;
994 Process *process = exe_ctx.GetProcessPtr();
995 if (target && process) {
996 Process::StopLocker stop_locker;
997 if (stop_locker.TryLock(&process->GetRunLock())) {
998 frame = exe_ctx.GetFramePtr();
1001 VariableList *variable_list = nullptr;
1002 variable_list = frame->GetVariableList(true);
1003 if (variable_list) {
1004 const size_t num_variables = variable_list->GetSize();
1005 if (num_variables) {
1006 for (i = 0; i < num_variables; ++i) {
1007 VariableSP variable_sp(variable_list->GetVariableAtIndex(i));
1009 bool add_variable = false;
1010 switch (variable_sp->GetScope()) {
1011 case eValueTypeVariableGlobal:
1012 case eValueTypeVariableStatic:
1013 case eValueTypeVariableThreadLocal:
1014 add_variable = statics;
1017 case eValueTypeVariableArgument:
1018 add_variable = arguments;
1021 case eValueTypeVariableLocal:
1022 add_variable = locals;
1029 // Only add variables once so we don't end up with duplicates
1030 if (variable_set.find(variable_sp) == variable_set.end())
1031 variable_set.insert(variable_sp);
1035 if (in_scope_only && !variable_sp->IsInScope(frame))
1038 ValueObjectSP valobj_sp(frame->GetValueObjectForFrameVariable(
1039 variable_sp, eNoDynamicValues));
1041 if (!include_runtime_support_values && valobj_sp != nullptr &&
1042 valobj_sp->IsRuntimeSupportValue())
1046 value_sb.SetSP(valobj_sp, use_dynamic);
1047 value_list.Append(value_sb);
1055 log->Printf("SBFrame::GetVariables () => error: could not "
1056 "reconstruct frame object for this SBFrame.");
1060 log->Printf("SBFrame::GetVariables () => error: process is running");
1065 log->Printf("SBFrame(%p)::GetVariables (...) => SBValueList(%p)",
1066 static_cast<void *>(frame),
1067 static_cast<void *>(value_list.opaque_ptr()));
1072 SBValueList SBFrame::GetRegisters() {
1073 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
1075 SBValueList value_list;
1076 std::unique_lock<std::recursive_mutex> lock;
1077 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
1079 StackFrame *frame = nullptr;
1080 Target *target = exe_ctx.GetTargetPtr();
1081 Process *process = exe_ctx.GetProcessPtr();
1082 if (target && process) {
1083 Process::StopLocker stop_locker;
1084 if (stop_locker.TryLock(&process->GetRunLock())) {
1085 frame = exe_ctx.GetFramePtr();
1087 RegisterContextSP reg_ctx(frame->GetRegisterContext());
1089 const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
1090 for (uint32_t set_idx = 0; set_idx < num_sets; ++set_idx) {
1092 ValueObjectRegisterSet::Create(frame, reg_ctx, set_idx));
1097 log->Printf("SBFrame::GetRegisters () => error: could not "
1098 "reconstruct frame object for this SBFrame.");
1102 log->Printf("SBFrame::GetRegisters () => error: process is running");
1107 log->Printf("SBFrame(%p)::GetRegisters () => SBValueList(%p)",
1108 static_cast<void *>(frame),
1109 static_cast<void *>(value_list.opaque_ptr()));
1114 SBValue SBFrame::FindRegister(const char *name) {
1115 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
1118 ValueObjectSP value_sp;
1119 std::unique_lock<std::recursive_mutex> lock;
1120 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
1122 StackFrame *frame = nullptr;
1123 Target *target = exe_ctx.GetTargetPtr();
1124 Process *process = exe_ctx.GetProcessPtr();
1125 if (target && process) {
1126 Process::StopLocker stop_locker;
1127 if (stop_locker.TryLock(&process->GetRunLock())) {
1128 frame = exe_ctx.GetFramePtr();
1130 RegisterContextSP reg_ctx(frame->GetRegisterContext());
1132 const uint32_t num_regs = reg_ctx->GetRegisterCount();
1133 for (uint32_t reg_idx = 0; reg_idx < num_regs; ++reg_idx) {
1134 const RegisterInfo *reg_info =
1135 reg_ctx->GetRegisterInfoAtIndex(reg_idx);
1137 ((reg_info->name && strcasecmp(reg_info->name, name) == 0) ||
1138 (reg_info->alt_name &&
1139 strcasecmp(reg_info->alt_name, name) == 0))) {
1140 value_sp = ValueObjectRegister::Create(frame, reg_ctx, reg_idx);
1141 result.SetSP(value_sp);
1148 log->Printf("SBFrame::FindRegister () => error: could not "
1149 "reconstruct frame object for this SBFrame.");
1153 log->Printf("SBFrame::FindRegister () => error: process is running");
1158 log->Printf("SBFrame(%p)::FindRegister () => SBValue(%p)",
1159 static_cast<void *>(frame),
1160 static_cast<void *>(value_sp.get()));
1165 bool SBFrame::GetDescription(SBStream &description) {
1166 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
1167 Stream &strm = description.ref();
1169 std::unique_lock<std::recursive_mutex> lock;
1170 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
1173 Target *target = exe_ctx.GetTargetPtr();
1174 Process *process = exe_ctx.GetProcessPtr();
1175 if (target && process) {
1176 Process::StopLocker stop_locker;
1177 if (stop_locker.TryLock(&process->GetRunLock())) {
1178 frame = exe_ctx.GetFramePtr();
1180 frame->DumpUsingSettingsFormat(&strm);
1183 log->Printf("SBFrame::GetDescription () => error: could not "
1184 "reconstruct frame object for this SBFrame.");
1188 log->Printf("SBFrame::GetDescription () => error: process is running");
1192 strm.PutCString("No value");
1197 SBValue SBFrame::EvaluateExpression(const char *expr) {
1199 std::unique_lock<std::recursive_mutex> lock;
1200 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
1202 StackFrame *frame = exe_ctx.GetFramePtr();
1203 Target *target = exe_ctx.GetTargetPtr();
1204 if (frame && target) {
1205 SBExpressionOptions options;
1206 lldb::DynamicValueType fetch_dynamic_value =
1207 frame->CalculateTarget()->GetPreferDynamicValue();
1208 options.SetFetchDynamicValue(fetch_dynamic_value);
1209 options.SetUnwindOnError(true);
1210 options.SetIgnoreBreakpoints(true);
1211 if (target->GetLanguage() != eLanguageTypeUnknown)
1212 options.SetLanguage(target->GetLanguage());
1214 options.SetLanguage(frame->GetLanguage());
1215 return EvaluateExpression(expr, options);
1221 SBFrame::EvaluateExpression(const char *expr,
1222 lldb::DynamicValueType fetch_dynamic_value) {
1223 SBExpressionOptions options;
1224 options.SetFetchDynamicValue(fetch_dynamic_value);
1225 options.SetUnwindOnError(true);
1226 options.SetIgnoreBreakpoints(true);
1227 std::unique_lock<std::recursive_mutex> lock;
1228 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
1230 StackFrame *frame = exe_ctx.GetFramePtr();
1231 Target *target = exe_ctx.GetTargetPtr();
1232 if (target && target->GetLanguage() != eLanguageTypeUnknown)
1233 options.SetLanguage(target->GetLanguage());
1235 options.SetLanguage(frame->GetLanguage());
1236 return EvaluateExpression(expr, options);
1239 SBValue SBFrame::EvaluateExpression(const char *expr,
1240 lldb::DynamicValueType fetch_dynamic_value,
1241 bool unwind_on_error) {
1242 SBExpressionOptions options;
1243 std::unique_lock<std::recursive_mutex> lock;
1244 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
1246 options.SetFetchDynamicValue(fetch_dynamic_value);
1247 options.SetUnwindOnError(unwind_on_error);
1248 options.SetIgnoreBreakpoints(true);
1249 StackFrame *frame = exe_ctx.GetFramePtr();
1250 Target *target = exe_ctx.GetTargetPtr();
1251 if (target && target->GetLanguage() != eLanguageTypeUnknown)
1252 options.SetLanguage(target->GetLanguage());
1254 options.SetLanguage(frame->GetLanguage());
1255 return EvaluateExpression(expr, options);
1258 lldb::SBValue SBFrame::EvaluateExpression(const char *expr,
1259 const SBExpressionOptions &options) {
1260 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
1262 #ifndef LLDB_DISABLE_PYTHON
1263 Log *expr_log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
1266 ExpressionResults exe_results = eExpressionSetupError;
1267 SBValue expr_result;
1269 if (expr == nullptr || expr[0] == '\0') {
1272 "SBFrame::EvaluateExpression called with an empty expression");
1276 ValueObjectSP expr_value_sp;
1278 std::unique_lock<std::recursive_mutex> lock;
1279 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
1282 log->Printf("SBFrame()::EvaluateExpression (expr=\"%s\")...", expr);
1284 StackFrame *frame = nullptr;
1285 Target *target = exe_ctx.GetTargetPtr();
1286 Process *process = exe_ctx.GetProcessPtr();
1288 if (target && process) {
1289 Process::StopLocker stop_locker;
1290 if (stop_locker.TryLock(&process->GetRunLock())) {
1291 frame = exe_ctx.GetFramePtr();
1293 std::unique_ptr<llvm::PrettyStackTraceFormat> stack_trace;
1294 if (target->GetDisplayExpressionsInCrashlogs()) {
1295 StreamString frame_description;
1296 frame->DumpUsingSettingsFormat(&frame_description);
1297 stack_trace = llvm::make_unique<llvm::PrettyStackTraceFormat>(
1298 "SBFrame::EvaluateExpression (expr = \"%s\", fetch_dynamic_value "
1300 expr, options.GetFetchDynamicValue(),
1301 frame_description.GetData());
1304 exe_results = target->EvaluateExpression(expr, frame, expr_value_sp,
1306 expr_result.SetSP(expr_value_sp, options.GetFetchDynamicValue());
1309 log->Printf("SBFrame::EvaluateExpression () => error: could not "
1310 "reconstruct frame object for this SBFrame.");
1315 "SBFrame::EvaluateExpression () => error: process is running");
1319 #ifndef LLDB_DISABLE_PYTHON
1321 expr_log->Printf("** [SBFrame::EvaluateExpression] Expression result is "
1322 "%s, summary %s **",
1323 expr_result.GetValue(), expr_result.GetSummary());
1326 log->Printf("SBFrame(%p)::EvaluateExpression (expr=\"%s\") => SBValue(%p) "
1327 "(execution result=%d)",
1328 static_cast<void *>(frame), expr,
1329 static_cast<void *>(expr_value_sp.get()), exe_results);
1335 bool SBFrame::IsInlined() {
1336 return static_cast<const SBFrame *>(this)->IsInlined();
1339 bool SBFrame::IsInlined() const {
1340 Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
1341 std::unique_lock<std::recursive_mutex> lock;
1342 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
1344 StackFrame *frame = nullptr;
1345 Target *target = exe_ctx.GetTargetPtr();
1346 Process *process = exe_ctx.GetProcessPtr();
1347 if (target && process) {
1348 Process::StopLocker stop_locker;
1349 if (stop_locker.TryLock(&process->GetRunLock())) {
1350 frame = exe_ctx.GetFramePtr();
1353 Block *block = frame->GetSymbolContext(eSymbolContextBlock).block;
1355 return block->GetContainingInlinedBlock() != nullptr;
1358 log->Printf("SBFrame::IsInlined () => error: could not reconstruct "
1359 "frame object for this SBFrame.");
1363 log->Printf("SBFrame::IsInlined () => error: process is running");
1369 const char *SBFrame::GetFunctionName() {
1370 return static_cast<const SBFrame *>(this)->GetFunctionName();
1373 lldb::LanguageType SBFrame::GuessLanguage() const {
1374 std::unique_lock<std::recursive_mutex> lock;
1375 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
1377 StackFrame *frame = nullptr;
1378 Target *target = exe_ctx.GetTargetPtr();
1379 Process *process = exe_ctx.GetProcessPtr();
1380 if (target && process) {
1381 Process::StopLocker stop_locker;
1382 if (stop_locker.TryLock(&process->GetRunLock())) {
1383 frame = exe_ctx.GetFramePtr();
1385 return frame->GuessLanguage();
1389 return eLanguageTypeUnknown;
1392 const char *SBFrame::GetFunctionName() const {
1393 Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
1394 const char *name = nullptr;
1395 std::unique_lock<std::recursive_mutex> lock;
1396 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
1398 StackFrame *frame = nullptr;
1399 Target *target = exe_ctx.GetTargetPtr();
1400 Process *process = exe_ctx.GetProcessPtr();
1401 if (target && process) {
1402 Process::StopLocker stop_locker;
1403 if (stop_locker.TryLock(&process->GetRunLock())) {
1404 frame = exe_ctx.GetFramePtr();
1406 SymbolContext sc(frame->GetSymbolContext(eSymbolContextFunction |
1407 eSymbolContextBlock |
1408 eSymbolContextSymbol));
1410 Block *inlined_block = sc.block->GetContainingInlinedBlock();
1411 if (inlined_block) {
1412 const InlineFunctionInfo *inlined_info =
1413 inlined_block->GetInlinedFunctionInfo();
1415 inlined_info->GetName(sc.function->GetLanguage()).AsCString();
1419 if (name == nullptr) {
1421 name = sc.function->GetName().GetCString();
1424 if (name == nullptr) {
1426 name = sc.symbol->GetName().GetCString();
1430 log->Printf("SBFrame::GetFunctionName () => error: could not "
1431 "reconstruct frame object for this SBFrame.");
1435 log->Printf("SBFrame::GetFunctionName() => error: process is running");
1441 const char *SBFrame::GetDisplayFunctionName() {
1442 Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
1443 const char *name = nullptr;
1445 std::unique_lock<std::recursive_mutex> lock;
1446 ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
1448 StackFrame *frame = nullptr;
1449 Target *target = exe_ctx.GetTargetPtr();
1450 Process *process = exe_ctx.GetProcessPtr();
1451 if (target && process) {
1452 Process::StopLocker stop_locker;
1453 if (stop_locker.TryLock(&process->GetRunLock())) {
1454 frame = exe_ctx.GetFramePtr();
1456 SymbolContext sc(frame->GetSymbolContext(eSymbolContextFunction |
1457 eSymbolContextBlock |
1458 eSymbolContextSymbol));
1460 Block *inlined_block = sc.block->GetContainingInlinedBlock();
1461 if (inlined_block) {
1462 const InlineFunctionInfo *inlined_info =
1463 inlined_block->GetInlinedFunctionInfo();
1464 name = inlined_info->GetDisplayName(sc.function->GetLanguage())
1469 if (name == nullptr) {
1471 name = sc.function->GetDisplayName().GetCString();
1474 if (name == nullptr) {
1476 name = sc.symbol->GetDisplayName().GetCString();
1480 log->Printf("SBFrame::GetDisplayFunctionName () => error: could not "
1481 "reconstruct frame object for this SBFrame.");
1486 "SBFrame::GetDisplayFunctionName() => error: process is running");