summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-11-01 22:58:22 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2009-11-01 22:58:22 +0100
commit7a354715cc5b0ef711003b7c9f3a6f806dcaa2f1 (patch)
treef78cd68648acdae43d03f6ab895677e53a4293b0 /lib
parent896f298f20871e782760116da9ac97999920ded3 (diff)
downloadabrt-7a354715cc5b0ef711003b7c9f3a6f806dcaa2f1.tar.gz
abrt-7a354715cc5b0ef711003b7c9f3a6f806dcaa2f1.tar.xz
abrt-7a354715cc5b0ef711003b7c9f3a6f806dcaa2f1.zip
CCpp.conf: add DebugInfoCacheMB option (ignored for now)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Plugins/CCpp.conf8
-rw-r--r--lib/Plugins/CCpp.cpp27
-rw-r--r--lib/Plugins/CCpp.h1
3 files changed, 26 insertions, 10 deletions
diff --git a/lib/Plugins/CCpp.conf b/lib/Plugins/CCpp.conf
index 02c6c1ab..2139274a 100644
--- a/lib/Plugins/CCpp.conf
+++ b/lib/Plugins/CCpp.conf
@@ -1,14 +1,16 @@
# Configuration file for CCpp add-on
-# NONE OF THESE OPTIONS IS SUPPORTED
-# generate memory map too
+# generate memory map too (IGNORED FOR NOW)
MemoryMap = no
# how to get debug-info: install, mount
## install - download and install debug-info packages
## mount - mount fedora NFS with debug info
+## (IGNORED FOR NOW)
DebugInfo = install
+## (IGNORED FOR NOW)
+DebugInfoCacheMB = 4000
+
# With this option set to "yes"
# will be installed debuginfo
InstallDebuginfo = yes
-
diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp
index 849e1699..1d5b79d1 100644
--- a/lib/Plugins/CCpp.cpp
+++ b/lib/Plugins/CCpp.cpp
@@ -41,7 +41,9 @@
#define FILENAME_MEMORYMAP "memorymap"
CAnalyzerCCpp::CAnalyzerCCpp() :
- m_bMemoryMap(false), m_bInstallDebuginfo(true)
+ m_bMemoryMap(false),
+ m_bInstallDebuginfo(true),
+ m_nDebugInfoCacheMB(4000)
{}
static std::string CreateHash(const std::string& pInput)
@@ -243,7 +245,7 @@ static void GetBacktrace(const std::string& pDebugDumpDir, std::string& pBacktra
// when/if gdb supports it:
// (https://bugzilla.redhat.com/show_bug.cgi?id=528668):
args[2] = (char*)"-ex";
- args[3] = "set debug-file-directory /usr/lib/debug:" LOCALSTATEDIR"/cache/abrt-di/usr/lib/debug";
+ args[3] = (char*)"set debug-file-directory /usr/lib/debug:" LOCALSTATEDIR"/cache/abrt-di/usr/lib/debug";
/*
* Unfortunately, "file BINARY_FILE" doesn't work well if BINARY_FILE
* was deleted (as often happens during system updates):
@@ -720,6 +722,11 @@ static void InstallDebugInfos(const std::string& pDebugDumpDir, std::string& bui
wait(NULL);
}
+static void trim_debuginfo_cache(unsigned max_mb)
+{
+ // TODO
+}
+
std::string CAnalyzerCCpp::GetLocalUUID(const std::string& pDebugDumpDir)
{
log(_("Getting local universal unique identification..."));
@@ -809,10 +816,9 @@ void CAnalyzerCCpp::CreateReport(const std::string& pDebugDumpDir, int force)
dd.Close(); /* do not keep dir locked longer than needed */
std::string build_ids;
- map_plugin_settings_t settings = GetSettings();
- if (settings["InstallDebuginfo"] == "yes" &&
- DebuginfoCheckPolkit(atoi(UID.c_str())) )
- {
+ if (m_bInstallDebuginfo && DebuginfoCheckPolkit(atoi(UID.c_str()))) {
+ if (m_nDebugInfoCacheMB > 0)
+ trim_debuginfo_cache(m_nDebugInfoCacheMB);
InstallDebugInfos(pDebugDumpDir, build_ids);
}
else
@@ -883,7 +889,8 @@ void CAnalyzerCCpp::DeInit()
void CAnalyzerCCpp::SetSettings(const map_plugin_settings_t& pSettings)
{
map_plugin_settings_t::const_iterator end = pSettings.end();
- map_plugin_settings_t::const_iterator it = pSettings.find("MemoryMap");
+ map_plugin_settings_t::const_iterator it;
+ it = pSettings.find("MemoryMap");
if (it != end)
{
m_bMemoryMap = it->second == "yes";
@@ -893,6 +900,11 @@ void CAnalyzerCCpp::SetSettings(const map_plugin_settings_t& pSettings)
{
m_sDebugInfo = it->second;
}
+ it = pSettings.find("DebugInfoCacheMB");
+ if (it != end)
+ {
+ m_nDebugInfoCacheMB = atoi(it->second.c_str());
+ }
it = pSettings.find("InstallDebuginfo");
if (it != end)
{
@@ -906,6 +918,7 @@ map_plugin_settings_t CAnalyzerCCpp::GetSettings()
ret["MemoryMap"] = m_bMemoryMap ? "yes" : "no";
ret["DebugInfo"] = m_sDebugInfo;
+ ret["DebugInfoCacheMB"] = to_string(m_nDebugInfoCacheMB);
ret["InstallDebuginfo"] = m_bInstallDebuginfo ? "yes" : "no";
return ret;
diff --git a/lib/Plugins/CCpp.h b/lib/Plugins/CCpp.h
index 3fbe0b9e..70601c20 100644
--- a/lib/Plugins/CCpp.h
+++ b/lib/Plugins/CCpp.h
@@ -32,6 +32,7 @@ class CAnalyzerCCpp : public CAnalyzer
private:
bool m_bMemoryMap;
bool m_bInstallDebuginfo;
+ unsigned m_nDebugInfoCacheMB;
std::string m_sOldCorePattern;
std::string m_sDebugInfo;
public: