summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZdenek Prikryl <zprikryl@redhat.com>2009-02-11 16:17:21 +0100
committerZdenek Prikryl <zprikryl@redhat.com>2009-02-11 16:17:21 +0100
commitee95f1b02a1d9da61c707b16c0286e9b5301db0d (patch)
treede61c91027b077eb6d8cf8ed396a572bbae4efbd
parentf3ce5e7a7082e430c8ac1193b5c8c4335d1cd4a2 (diff)
downloadabrt-ee95f1b02a1d9da61c707b16c0286e9b5301db0d.tar.gz
abrt-ee95f1b02a1d9da61c707b16c0286e9b5301db0d.tar.xz
abrt-ee95f1b02a1d9da61c707b16c0286e9b5301db0d.zip
reflect new interface
-rw-r--r--lib/Plugins/CCpp.cpp34
-rw-r--r--lib/Plugins/CCpp.h5
2 files changed, 29 insertions, 10 deletions
diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp
index ce65acdc..657f9ac9 100644
--- a/lib/Plugins/CCpp.cpp
+++ b/lib/Plugins/CCpp.cpp
@@ -26,31 +26,49 @@
#include <sstream>
#define CORE_PATTERN_IFACE "/proc/sys/kernel/core_pattern"
-#define CORE_PATTERN CCPP_HOOK_PATH" %p %t %s"
+#define CORE_PATTERN CCPP_HOOK_PATH" %p %s"
CLanguageCCpp::CLanguageCCpp() :
m_bMemoryMap(false)
{}
-std::string CLanguageCCpp::GetLocalUUID(const std::string& pDebugDumpPath)
+std::string CLanguageCCpp::GetLocalUUID(const std::string& pDebugDumpDir)
{
std::stringstream ss;
char* core;
unsigned int size;
CDebugDump dd;
- dd.Open(pDebugDumpPath);
+ dd.Open(pDebugDumpDir);
dd.LoadBinary(FILENAME_BINARYDATA1, &core, &size);
- // TODO: write proper handler
+ // TODO: compute local UUID
ss << size;
return ss.str();
}
+std::string CLanguageCCpp::GetGlobalUUID(const std::string& pDebugDumpDir)
+{
+ std::stringstream ss;
+ CDebugDump dd;
+ std::string backtrace;
+ dd.Open(pDebugDumpDir);
+ dd.LoadText(FILENAME_TEXTDATA1, backtrace);
+
+ // TODO: compute global UUID
+ ss << backtrace.length();
+ return ss.str();
+}
-std::string CLanguageCCpp::GetReport(const std::string& pDebugDumpPath)
+void CLanguageCCpp::CreateReport(const std::string& pDebugDumpDir)
{
- // TODO: install or mount debug-infos
- // TODO:
- return "report";
+ CDebugDump dd;
+ dd.Open(pDebugDumpDir);
+
+ // TODO: install or mount debug-infos, gun gdb/archer and get backtrace
+ dd.SaveText(FILENAME_TEXTDATA1, "backtrace of the crashed C/C++ application");
+ if (m_bMemoryMap)
+ {
+ dd.SaveText(FILENAME_TEXTDATA2, "memory map of the crashed C/C++ application");
+ }
}
void CLanguageCCpp::Init()
diff --git a/lib/Plugins/CCpp.h b/lib/Plugins/CCpp.h
index ef491d58..e1c2015e 100644
--- a/lib/Plugins/CCpp.h
+++ b/lib/Plugins/CCpp.h
@@ -35,8 +35,9 @@ class CLanguageCCpp : public CLanguage
public:
CLanguageCCpp();
virtual ~CLanguageCCpp() {}
- std::string GetLocalUUID(const std::string& pDebugDumpPath);
- std::string GetReport(const std::string& pDebugDumpPath);
+ std::string GetLocalUUID(const std::string& pDebugDumpDir);
+ std::string GetGlobalUUID(const std::string& pDebugDumpDir);
+ void CreateReport(const std::string& pDebugDumpDir);
void Init();
void DeInit();
void SetSettings(const map_settings_t& pSettings);