From 873a7a4b64353cd0e7b018abe19a2ea5a567e427 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Fri, 16 Mar 2012 20:46:10 +0000 Subject: Patch from dawn@burble.org: GetSupportFileAtIndex(), GetNumSupportFiles(), FindSupportFileIndex(): Add API support for getting the list of files in a compilation unit. GetNumCompileUnits(), GetCompileUnitAtIndex(): Add API support for retrieving the compilation units in a module. llvm-svn: 152942 --- lldb/source/API/SBModule.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'lldb/source/API/SBModule.cpp') diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp index c23a35e711bb..3090fb4d4733 100644 --- a/lldb/source/API/SBModule.cpp +++ b/lldb/source/API/SBModule.cpp @@ -266,6 +266,30 @@ SBModule::GetDescription (SBStream &description) return true; } +uint32_t +SBModule::GetNumCompileUnits() +{ + ModuleSP module_sp (GetSP ()); + if (module_sp) + { + return module_sp->GetNumCompileUnits (); + } + return 0; +} + +SBCompileUnit +SBModule::GetCompileUnitAtIndex (uint32_t index) +{ + SBCompileUnit sb_cu; + ModuleSP module_sp (GetSP ()); + if (module_sp) + { + CompUnitSP cu_sp = module_sp->GetCompileUnitAtIndex (index); + sb_cu.reset(cu_sp.get()); + } + return sb_cu; +} + size_t SBModule::GetNumSymbols () { -- cgit v1.2.3