diff options
author | Zdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com> | 2009-02-04 17:04:38 +0100 |
---|---|---|
committer | Zdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com> | 2009-02-04 17:04:38 +0100 |
commit | 0390d41b39350a361735e8a9f712cc25f3adaab4 (patch) | |
tree | e2bf16e555215b77a7f086ccd74104e60d2d6136 /lib | |
parent | 8e22569ec4300041788ca216b532bf559e7968db (diff) | |
download | abrt-0390d41b39350a361735e8a9f712cc25f3adaab4.tar.gz abrt-0390d41b39350a361735e8a9f712cc25f3adaab4.tar.xz abrt-0390d41b39350a361735e8a9f712cc25f3adaab4.zip |
reflect new plugin interface
added new setting in the conf file
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Plugins/CCpp.conf | 9 | ||||
-rw-r--r-- | lib/Plugins/CCpp.cpp | 40 | ||||
-rw-r--r-- | lib/Plugins/CCpp.h | 7 |
3 files changed, 38 insertions, 18 deletions
diff --git a/lib/Plugins/CCpp.conf b/lib/Plugins/CCpp.conf index 1d15667b..9b6dcaca 100644 --- a/lib/Plugins/CCpp.conf +++ b/lib/Plugins/CCpp.conf @@ -1,3 +1,10 @@ # Configuration file for CCpp add-on Enabled = yes -MemoryMap = no
\ No newline at end of file + +# generate memory map too +MemoryMap = no + +# how to get debug-info: install, mount +## install - download and install debug-info packages +## mount - mount fedora NFS with debug info +DebugInfo = install
\ No newline at end of file diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index 54ec0907..ce65acdc 100644 --- a/lib/Plugins/CCpp.cpp +++ b/lib/Plugins/CCpp.cpp @@ -22,6 +22,8 @@ #include "CCpp.h" #include <fstream> #include <ctype.h> +#include "DebugDump.h" +#include <sstream> #define CORE_PATTERN_IFACE "/proc/sys/kernel/core_pattern" #define CORE_PATTERN CCPP_HOOK_PATH" %p %t %s" @@ -30,20 +32,28 @@ CLanguageCCpp::CLanguageCCpp() : m_bMemoryMap(false) {} -std::string CLanguageCCpp::GetUUID(void* pData) +std::string CLanguageCCpp::GetLocalUUID(const std::string& pDebugDumpPath) { - if (m_bMemoryMap) - return "UUID a memory map"; - else - return "UUID bez memory map"; + std::stringstream ss; + char* core; + unsigned int size; + CDebugDump dd; + dd.Open(pDebugDumpPath); + dd.LoadBinary(FILENAME_BINARYDATA1, &core, &size); + + // TODO: write proper handler + ss << size; + return ss.str(); } -std::string CLanguageCCpp::GetReport(void* pData) +std::string CLanguageCCpp::GetReport(const std::string& pDebugDumpPath) { - return "reportuju jak blazen"; + // TODO: install or mount debug-infos + // TODO: + return "report"; } -void CLanguageCCpp::Init(const map_settings_t& pSettings) +void CLanguageCCpp::Init() { std::ifstream fInCorePattern; fInCorePattern.open(CORE_PATTERN_IFACE); @@ -59,12 +69,6 @@ void CLanguageCCpp::Init(const map_settings_t& pSettings) fOutCorePattern << CORE_PATTERN << std::endl; fOutCorePattern.close(); } - - if (pSettings.find("MemoryMap")!= pSettings.end()) - { - m_bMemoryMap = pSettings.find("MemoryMap")->second == "yes"; - } - } @@ -78,3 +82,11 @@ void CLanguageCCpp::DeInit() fOutCorePattern.close(); } } + +void CLanguageCCpp::SetSettings(const map_settings_t& pSettings) +{ + if (pSettings.find("MemoryMap")!= pSettings.end()) + { + m_bMemoryMap = pSettings.find("MemoryMap")->second == "yes"; + } +} diff --git a/lib/Plugins/CCpp.h b/lib/Plugins/CCpp.h index 904ac7c5..ef491d58 100644 --- a/lib/Plugins/CCpp.h +++ b/lib/Plugins/CCpp.h @@ -35,10 +35,11 @@ class CLanguageCCpp : public CLanguage public: CLanguageCCpp(); virtual ~CLanguageCCpp() {} - std::string GetUUID(void* pData); - std::string GetReport(void* pData); - void Init(const map_settings_t& pSettings); + std::string GetLocalUUID(const std::string& pDebugDumpPath); + std::string GetReport(const std::string& pDebugDumpPath); + void Init(); void DeInit(); + void SetSettings(const map_settings_t& pSettings); }; |