summaryrefslogtreecommitdiffstats
path: root/lib/MiddleWare
diff options
context:
space:
mode:
authorZdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com>2009-04-16 15:19:21 +0200
committerZdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com>2009-04-16 15:19:21 +0200
commitd71fe39576ded4e9567f5f938e9ef67183bb8afd (patch)
treeece53e7155d3d85ce5d2e700c3cf729f42241b4c /lib/MiddleWare
parent3e7c2ab09e4bcb4b63fd80ed33c99539d3a27c5f (diff)
downloadabrt-d71fe39576ded4e9567f5f938e9ef67183bb8afd.tar.gz
abrt-d71fe39576ded4e9567f5f938e9ef67183bb8afd.tar.xz
abrt-d71fe39576ded4e9567f5f938e9ef67183bb8afd.zip
simple report can be activated immediately after a crash occurs
Diffstat (limited to 'lib/MiddleWare')
-rw-r--r--lib/MiddleWare/MiddleWare.cpp19
-rw-r--r--lib/MiddleWare/MiddleWare.h3
2 files changed, 22 insertions, 0 deletions
diff --git a/lib/MiddleWare/MiddleWare.cpp b/lib/MiddleWare/MiddleWare.cpp
index d2d12a0..e1e679a 100644
--- a/lib/MiddleWare/MiddleWare.cpp
+++ b/lib/MiddleWare/MiddleWare.cpp
@@ -173,6 +173,20 @@ void CMiddleWare::CreateCrashReport(const std::string& pUUID,
add_crash_data_to_crash_report(pCrashReport, CD_REPRODUCE, CD_TXT, CD_ISEDITABLE, "1.\n2.\n3.\n");
}
+void CMiddleWare::Report(const std::string& pDebugDumpDir)
+{
+ map_crash_report_t crashReport;
+
+ DebugDumpToCrashReport(pDebugDumpDir, crashReport);
+
+ set_reporters_t::iterator it_r;
+ for (it_r = m_setReporters.begin(); it_r != m_setReporters.end(); it_r++)
+ {
+ CReporter* reporter = m_pPluginManager->GetReporter(*it_r);
+ reporter->Report(crashReport);
+ }
+}
+
void CMiddleWare::Report(const map_crash_report_t& pCrashReport)
{
if (pCrashReport.find(CD_MWANALYZER) == pCrashReport.end() ||
@@ -488,3 +502,8 @@ void CMiddleWare::AddAnalyzerAction(const std::string& pAnalyzer,
{
m_mapAnalyzerActions[pAnalyzer].insert(make_pair(pAction, pArgs));
}
+
+void CMiddleWare::AddReporter(const std::string& pReporter)
+{
+ m_setReporters.insert(pReporter);
+}
diff --git a/lib/MiddleWare/MiddleWare.h b/lib/MiddleWare/MiddleWare.h
index 86db708..28afb2a 100644
--- a/lib/MiddleWare/MiddleWare.h
+++ b/lib/MiddleWare/MiddleWare.h
@@ -45,6 +45,7 @@ class CMiddleWare
std::string m_sDatabase;
map_reporter_associations_t m_mapAnalyzerReporters;
map_action_associations_t m_mapAnalyzerActions;
+ set_reporters_t m_setReporters;
bool m_bOpenGPGCheck;
@@ -79,6 +80,7 @@ class CMiddleWare
const std::string& pUID,
map_crash_report_t& pCrashReport);
+ void Report(const std::string& pDebugDumpDir);
void Report(const map_crash_report_t& pCrashReport);
void DeleteDebugDumpDir(const std::string& pDebugDumpDir);
void DeleteCrashInfo(const std::string& pUUID,
@@ -100,6 +102,7 @@ class CMiddleWare
void AddAnalyzerAction(const std::string& pAnalyzer,
const std::string& pAction,
const std::string& pArgs);
+ void AddReporter(const std::string& pReporter);
};
#endif /*MIDDLEWARE_H_*/