diff options
Diffstat (limited to 'lldb/source/API')
| -rw-r--r-- | lldb/source/API/SBFrame.cpp | 56 | ||||
| -rw-r--r-- | lldb/source/API/SBFunction.cpp | 20 | ||||
| -rw-r--r-- | lldb/source/API/SBSymbol.cpp | 14 |
3 files changed, 90 insertions, 0 deletions
diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp index e845aef41f4..70ee4d44c41 100644 --- a/lldb/source/API/SBFrame.cpp +++ b/lldb/source/API/SBFrame.cpp @@ -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().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; +} diff --git a/lldb/source/API/SBFunction.cpp b/lldb/source/API/SBFunction.cpp index bf5e9180a43..d57307add03 100644 --- a/lldb/source/API/SBFunction.cpp +++ b/lldb/source/API/SBFunction.cpp @@ -76,6 +76,26 @@ SBFunction::GetName() const } const char * +SBFunction::GetDisplayName() const +{ + const char *cstr = NULL; + if (m_opaque_ptr) + cstr = m_opaque_ptr->GetMangled().GetDisplayDemangledName().AsCString(); + + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + if (log) + { + if (cstr) + log->Printf ("SBFunction(%p)::GetDisplayName () => \"%s\"", + static_cast<void*>(m_opaque_ptr), cstr); + else + log->Printf ("SBFunction(%p)::GetDisplayName () => NULL", + static_cast<void*>(m_opaque_ptr)); + } + return cstr; +} + +const char * SBFunction::GetMangledName () const { const char *cstr = NULL; diff --git a/lldb/source/API/SBSymbol.cpp b/lldb/source/API/SBSymbol.cpp index 246a455d93a..171bfd84d0c 100644 --- a/lldb/source/API/SBSymbol.cpp +++ b/lldb/source/API/SBSymbol.cpp @@ -73,6 +73,20 @@ SBSymbol::GetName() const } const char * +SBSymbol::GetDisplayName() const +{ + const char *name = NULL; + if (m_opaque_ptr) + name = m_opaque_ptr->GetMangled().GetDisplayDemangledName().AsCString(); + + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + if (log) + log->Printf ("SBSymbol(%p)::GetDisplayName () => \"%s\"", + static_cast<void*>(m_opaque_ptr), name ? name : ""); + return name; +} + +const char * SBSymbol::GetMangledName () const { const char *name = NULL; |

