summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp69
1 files changed, 53 insertions, 16 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index 4e2e5e16637b..2491f6af8c19 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -16,6 +16,7 @@
#include "lldb/Host/FileSystem.h"
#include "lldb/Utility/RangeMap.h"
#include "lldb/Utility/RegularExpression.h"
+#include "lldb/Utility/Timer.h"
//#define DEBUG_OSO_DMAP // DO NOT CHECKIN WITH THIS NOT COMMENTED OUT
#if defined(DEBUG_OSO_DMAP)
@@ -33,9 +34,6 @@
#include "LogChannelDWARF.h"
#include "SymbolFileDWARF.h"
-// Work around the fact that Timer.h pulls in the system Mach-O headers.
-#include "lldb/Utility/Timer.h"
-
#include <memory>
using namespace lldb;
@@ -230,12 +228,7 @@ void SymbolFileDWARFDebugMap::Terminate() {
PluginManager::UnregisterPlugin(CreateInstance);
}
-lldb_private::ConstString SymbolFileDWARFDebugMap::GetPluginNameStatic() {
- static ConstString g_name("dwarf-debugmap");
- return g_name;
-}
-
-const char *SymbolFileDWARFDebugMap::GetPluginDescriptionStatic() {
+llvm::StringRef SymbolFileDWARFDebugMap::GetPluginDescriptionStatic() {
return "DWARF and DWARF3 debug symbol file reader (debug map).";
}
@@ -1236,13 +1229,6 @@ void SymbolFileDWARFDebugMap::DumpClangAST(Stream &s) {
});
}
-// PluginInterface protocol
-lldb_private::ConstString SymbolFileDWARFDebugMap::GetPluginName() {
- return GetPluginNameStatic();
-}
-
-uint32_t SymbolFileDWARFDebugMap::GetPluginVersion() { return 1; }
-
lldb::CompUnitSP
SymbolFileDWARFDebugMap::GetCompileUnit(SymbolFileDWARF *oso_dwarf) {
if (oso_dwarf) {
@@ -1443,3 +1429,54 @@ SymbolFileDWARFDebugMap::AddOSOARanges(SymbolFileDWARF *dwarf2Data,
}
return num_line_entries_added;
}
+
+uint64_t SymbolFileDWARFDebugMap::GetDebugInfoSize() {
+ uint64_t debug_info_size = 0;
+ ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
+ ObjectFile *oso_objfile = oso_dwarf->GetObjectFile();
+ if (!oso_objfile)
+ return false; // Keep iterating
+ ModuleSP module_sp = oso_objfile->GetModule();
+ if (!module_sp)
+ return false; // Keep iterating
+ SectionList *section_list = module_sp->GetSectionList();
+ if (section_list)
+ debug_info_size += section_list->GetDebugInfoSize();
+ return false; // Keep iterating
+ });
+ return debug_info_size;
+}
+
+StatsDuration SymbolFileDWARFDebugMap::GetDebugInfoParseTime() {
+ StatsDuration elapsed(0.0);
+ ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
+ ObjectFile *oso_objfile = oso_dwarf->GetObjectFile();
+ if (oso_objfile) {
+ ModuleSP module_sp = oso_objfile->GetModule();
+ if (module_sp) {
+ SymbolFile *symfile = module_sp->GetSymbolFile();
+ if (symfile)
+ elapsed += symfile->GetDebugInfoParseTime();
+ }
+ }
+ return false; // Keep iterating
+ });
+ return elapsed;
+}
+
+StatsDuration SymbolFileDWARFDebugMap::GetDebugInfoIndexTime() {
+ StatsDuration elapsed(0.0);
+ ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
+ ObjectFile *oso_objfile = oso_dwarf->GetObjectFile();
+ if (oso_objfile) {
+ ModuleSP module_sp = oso_objfile->GetModule();
+ if (module_sp) {
+ SymbolFile *symfile = module_sp->GetSymbolFile();
+ if (symfile)
+ elapsed += symfile->GetDebugInfoIndexTime();
+ }
+ }
+ return false; // Keep iterating
+ });
+ return elapsed;
+}