1 //===-- SBFunction.cpp ------------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #include "lldb/API/SBFunction.h" 11 #include "lldb/API/SBProcess.h" 12 #include "lldb/Symbol/Function.h" 13 14 using namespace lldb; 15 16 17 SBFunction::SBFunction () : 18 m_opaque_ptr (NULL) 19 { 20 } 21 22 SBFunction::SBFunction (lldb_private::Function *lldb_object_ptr) : 23 m_opaque_ptr (lldb_object_ptr) 24 { 25 } 26 27 SBFunction::~SBFunction () 28 { 29 m_opaque_ptr = NULL; 30 } 31 32 bool 33 SBFunction::IsValid () const 34 { 35 return m_opaque_ptr != NULL; 36 } 37 38 const char * 39 SBFunction::GetName() const 40 { 41 if (m_opaque_ptr) 42 return m_opaque_ptr->GetMangled().GetName().AsCString(); 43 return NULL; 44 } 45 46 const char * 47 SBFunction::GetMangledName () const 48 { 49 if (m_opaque_ptr) 50 return m_opaque_ptr->GetMangled().GetMangledName().AsCString(); 51 return NULL; 52 } 53 54 bool 55 SBFunction::operator == (const SBFunction &rhs) const 56 { 57 return m_opaque_ptr == rhs.m_opaque_ptr; 58 } 59 60 bool 61 SBFunction::operator != (const SBFunction &rhs) const 62 { 63 return m_opaque_ptr != rhs.m_opaque_ptr; 64 } 65