diff options
author | dim <dim@FreeBSD.org> | 2015-09-06 14:32:30 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-09-06 14:32:30 +0000 |
commit | 80b639cd40df427b9e325318efeec2d885a65f62 (patch) | |
tree | 94980f450aa3daec3e1fec217374704ad62cfe45 /source/API/SBFrame.cpp | |
parent | 8037fa4ee916fa20b3c63cbf531f4ee7e1c76138 (diff) | |
download | FreeBSD-src-80b639cd40df427b9e325318efeec2d885a65f62.zip FreeBSD-src-80b639cd40df427b9e325318efeec2d885a65f62.tar.gz |
Vendor import of (stripped) lldb trunk r242221:
https://llvm.org/svn/llvm-project/lldb/trunk@242221
Diffstat (limited to 'source/API/SBFrame.cpp')
-rw-r--r-- | source/API/SBFrame.cpp | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/source/API/SBFrame.cpp b/source/API/SBFrame.cpp index e845aef..08a5822 100644 --- a/source/API/SBFrame.cpp +++ b/source/API/SBFrame.cpp @@ -1571,7 +1571,7 @@ SBFrame::GetFunctionName() const if (inlined_block) { const InlineFunctionInfo* inlined_info = inlined_block->GetInlinedFunctionInfo(); - name = inlined_info->GetName().AsCString(); + name = inlined_info->GetName(sc.function->GetLanguage()).AsCString(); } } @@ -1602,3 +1602,59 @@ SBFrame::GetFunctionName() const } return name; } + +const char * +SBFrame::GetDisplayFunctionName() +{ + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + const char *name = NULL; + ExecutionContext exe_ctx(m_opaque_sp.get()); + StackFrame *frame = NULL; + Target *target = exe_ctx.GetTargetPtr(); + Process *process = exe_ctx.GetProcessPtr(); + if (target && process) + { + Process::StopLocker stop_locker; + if (stop_locker.TryLock(&process->GetRunLock())) + { + frame = exe_ctx.GetFramePtr(); + if (frame) + { + SymbolContext sc (frame->GetSymbolContext(eSymbolContextFunction | eSymbolContextBlock | eSymbolContextSymbol)); + if (sc.block) + { + Block *inlined_block = sc.block->GetContainingInlinedBlock (); + if (inlined_block) + { + const InlineFunctionInfo* inlined_info = inlined_block->GetInlinedFunctionInfo(); + name = inlined_info->GetDisplayName(sc.function->GetLanguage()).AsCString(); + } + } + + if (name == NULL) + { + if (sc.function) + name = sc.function->GetDisplayName().GetCString(); + } + + if (name == NULL) + { + if (sc.symbol) + name = sc.symbol->GetDisplayName().GetCString(); + } + } + else + { + if (log) + log->Printf ("SBFrame::GetDisplayFunctionName () => error: could not reconstruct frame object for this SBFrame."); + } + } + else + { + if (log) + log->Printf ("SBFrame::GetDisplayFunctionName() => error: process is running"); + + } + } + return name; +} |