From 35e5d37931a4548df96d0d49f6bd0138e65e4b5b Mon Sep 17 00:00:00 2001 From: danny Date: Mon, 9 Nov 2009 15:34:19 +0100 Subject: fix and update rating --- lib/Plugins/CCpp.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lib/Plugins/CCpp.cpp') diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index 6d6edd5..1ab0e64 100644 --- a/lib/Plugins/CCpp.cpp +++ b/lib/Plugins/CCpp.cpp @@ -164,6 +164,8 @@ static LineRating rate_line(const char *line) { #define FOUND(x) (strstr(line, x) != NULL) /* see the "enum LineRating" comments for possible combinations */ + if (FOUND(" at ")) + return Good; const char *function = strstr(line, " in "); if (function) { @@ -171,12 +173,6 @@ static LineRating rate_line(const char *line) { function = NULL; } - else - { - bool source_file = FOUND(" at "); - if (source_file) - return Good; - } } bool library = FOUND(" from "); if (function && library) @@ -193,7 +189,7 @@ static LineRating rate_line(const char *line) /* returns number of "stars" to show */ static int rate_backtrace(const char *backtrace) { - int i, len; + int i, j, len; int multiplier = 0; int rating = 0; int best_possible_rating = 0; @@ -210,6 +206,9 @@ static int rate_backtrace(const char *backtrace) if (backtrace[i] == '#') /* this separates frames from each other */ { std::string s(backtrace + i + 1, len); + for (j=0; j Date: Mon, 9 Nov 2009 16:33:15 +0100 Subject: prevent gdb from i18izing its output Signed-off-by: Denys Vlasenko --- lib/Plugins/CCpp.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/Plugins/CCpp.cpp') diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index 1ab0e64..5f87235 100644 --- a/lib/Plugins/CCpp.cpp +++ b/lib/Plugins/CCpp.cpp @@ -127,6 +127,18 @@ static pid_t ExecVP(char** pArgs, uid_t uid, std::string& pOutput) setreuid(uid, uid); setsid(); + /* Nuke everything which may make setlocale() switch to non-POSIX locale: + * we need to avoid having gdb output in some obscure language. + */ + unsetenv("LANG"); + unsetenv("LC_ALL"); + unsetenv("LC_COLLATE"); + unsetenv("LC_CTYPE"); + unsetenv("LC_MESSAGES"); + unsetenv("LC_MONETARY"); + unsetenv("LC_NUMERIC"); + unsetenv("LC_TIME"); + execvp(pArgs[0], pArgs); /* VERB1 since sometimes we expect errors here */ VERB1 perror_msg("Can't execute '%s'", pArgs[0]); -- cgit From c0ee9dabb895e9079a6367a823187f9e687c3e4a Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 10 Nov 2009 14:25:40 +0100 Subject: remove getSettings from most plugins (inherited one is ok) Also move parse_release() to abrtlib, it's shared among Bugzilla and Catcut. Tested Bugzilla and Catcut, both work. Signed-off-by: Denys Vlasenko --- lib/Plugins/CCpp.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'lib/Plugins/CCpp.cpp') diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index 5f87235..82c5677 100644 --- a/lib/Plugins/CCpp.cpp +++ b/lib/Plugins/CCpp.cpp @@ -980,7 +980,7 @@ void CAnalyzerCCpp::SetSettings(const map_plugin_settings_t& pSettings) it = pSettings.find("MemoryMap"); if (it != end) { - m_bMemoryMap = it->second == "yes"; + m_bMemoryMap = string_to_bool(it->second.c_str()); } it = pSettings.find("DebugInfo"); if (it != end) @@ -997,19 +997,20 @@ void CAnalyzerCCpp::SetSettings(const map_plugin_settings_t& pSettings) it = pSettings.find("InstallDebuginfo"); if (it != end) { - m_bInstallDebugInfo = it->second == "yes"; + m_bInstallDebugInfo = string_to_bool(it->second.c_str()); } } -const map_plugin_settings_t& CAnalyzerCCpp::GetSettings() -{ - m_pSettings["MemoryMap"] = m_bMemoryMap ? "yes" : "no"; - m_pSettings["DebugInfo"] = m_sDebugInfo; - m_pSettings["DebugInfoCacheMB"] = to_string(m_nDebugInfoCacheMB); - m_pSettings["InstallDebugInfo"] = m_bInstallDebugInfo ? "yes" : "no"; - - return m_pSettings; -} +//ok to delete? +//const map_plugin_settings_t& CAnalyzerCCpp::GetSettings() +//{ +// m_pSettings["MemoryMap"] = m_bMemoryMap ? "yes" : "no"; +// m_pSettings["DebugInfo"] = m_sDebugInfo; +// m_pSettings["DebugInfoCacheMB"] = to_string(m_nDebugInfoCacheMB); +// m_pSettings["InstallDebugInfo"] = m_bInstallDebugInfo ? "yes" : "no"; +// +// return m_pSettings; +//} PLUGIN_INFO(ANALYZER, CAnalyzerCCpp, -- cgit