From 432df42f6036da0e2425a1369ad19e5527e7d5b5 Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Wed, 3 Feb 2010 21:43:15 +0100 Subject: Fix to successfully parse a backtrace from rhbz#550642 --- src/Backtrace/parser.y | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/Backtrace/parser.y b/src/Backtrace/parser.y index 76dd7de..36a8e34 100644 --- a/src/Backtrace/parser.y +++ b/src/Backtrace/parser.y @@ -300,6 +300,7 @@ function_args : '(' wsa ')' function_args_sequence : function_args_char | function_args_sequence wsa '(' wsa ')' + | function_args_sequence wsa '(' wsa function_args_string wsa ')' | function_args_sequence wsa '(' wsa function_args_sequence wsa ')' | function_args_sequence wsa function_args_char | function_args_sequence wsa function_args_string -- cgit From fca632faa0c0ce211a74787d688be7cd6627cd30 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Wed, 3 Feb 2010 22:06:07 +0100 Subject: GUI: fixed windows icons and titles rhbz#537240, rhbz#560964 --- src/Gui/ccgui.glade | 2 ++ src/Gui/settings.glade | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Gui/ccgui.glade b/src/Gui/ccgui.glade index 65ad9fe..237f23a 100644 --- a/src/Gui/ccgui.glade +++ b/src/Gui/ccgui.glade @@ -9,6 +9,7 @@ True center-on-parent 470 + /usr/share/pixmaps/abrt.png main_window3 @@ -76,6 +77,7 @@ About ABRT False center-on-parent + /usr/share/pixmaps/abrt.png dialog False ABRT diff --git a/src/Gui/settings.glade b/src/Gui/settings.glade index 655c15b..a9a14f4 100644 --- a/src/Gui/settings.glade +++ b/src/Gui/settings.glade @@ -3,11 +3,12 @@ - Settings + Plugins True center-on-parent 450 400 + /usr/share/pixmaps/abrt.png True @@ -254,11 +255,12 @@ - Global Settings + Preferences True center-on-parent 450 400 + /usr/share/pixmaps/abrt.png True @@ -706,7 +708,7 @@ end - gtk-cancel + gtk-cancel True True True @@ -720,7 +722,7 @@ - gtk-ok + gtk-ok True False True @@ -753,6 +755,7 @@ center-on-parent 400 400 + /usr/share/pixmaps/abrt.png wGlobalSettings -- cgit From ac9988a068b184689228dfaf18759cc2f67464ae Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Wed, 3 Feb 2010 23:01:20 +0100 Subject: GUI: fixed scrolling in reporter dialog rhbz#559687 --- src/Gui/report.glade | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/Gui/report.glade b/src/Gui/report.glade index 13e4c14..e7f37ec 100644 --- a/src/Gui/report.glade +++ b/src/Gui/report.glade @@ -374,16 +374,10 @@ automatic automatic - + True - queue - - - True - True - word-char - - + True + word-char @@ -417,16 +411,10 @@ automatic automatic - + True - queue - - - True - True - word-char - - + True + word-char -- cgit From 80f3d6ddc8ed631e463c80c5d7c98d03c7b74f57 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Wed, 3 Feb 2010 23:05:11 +0100 Subject: swapped lines, iterator is not defined after erase() is called - and this makes valgrind unhappy --- src/Daemon/PluginManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp index 273cceb..15e9bee 100644 --- a/src/Daemon/PluginManager.cpp +++ b/src/Daemon/PluginManager.cpp @@ -261,8 +261,8 @@ void CPluginManager::UnLoadPlugin(const char *pName) m_mapPlugins.erase(it_plugin); } log("UnRegistered %s plugin %s", plugin_type_str[it_module->second->GetType()], pName); - m_mapLoadedModules.erase(it_module); delete it_module->second; + m_mapLoadedModules.erase(it_module); } } -- cgit From eb7483e262e29fdebb676c18453447247f3c0545 Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Wed, 3 Feb 2010 23:50:50 +0100 Subject: Fixed parsing backtrace from rhbz#549293 --- src/Backtrace/parser.y | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/Backtrace/parser.y b/src/Backtrace/parser.y index 36a8e34..1903282 100644 --- a/src/Backtrace/parser.y +++ b/src/Backtrace/parser.y @@ -267,12 +267,12 @@ variables_line : variables_char_no_framestart variables_char : '#' | variables_char_no_framestart ; -/* Manually synchronized with function_args_char, except the first line. */ -variables_char_no_framestart : digit | nondigit | '"' | '(' | ')' +/* Manually synchronized with function_args_char_base, except the first line. */ +variables_char_no_framestart : digit | nondigit | '"' | '(' | ')' | '\\' | '+' | '-' | '<' | '>' | '/' | '.' | '[' | ']' | '?' | '\'' | '`' | ',' | '=' | '{' | '}' | '^' | '&' | '$' - | ':' | ';' | '\\' | '!' | '@' | '*' + | ':' | ';' | '!' | '@' | '*' | '%' | '|' | '~' ; @@ -313,13 +313,21 @@ function_args_string : '"' wsa function_args_string_sequence wsa '"' /* Manually synchronized with variables_char_no_framestart, * except the first line. */ -function_args_char : digit | nondigit | '#' +function_args_char_base : digit | nondigit | '#' | '+' | '-' | '<' | '>' | '/' | '.' | '[' | ']' | '?' | '\'' | '`' | ',' | '=' | '{' | '}' | '^' | '&' | '$' - | ':' | ';' | '\\' | '!' | '@' | '*' + | ':' | ';' | '!' | '@' | '*' | '%' | '|' | '~' ; +function_args_escaped_char : '\\' function_args_char_base + | '\\' '\\' + | '\\' '"' +; +function_args_char : function_args_char_base + | function_args_escaped_char +; + function_args_string_sequence : function_args_string_char | function_args_string_sequence function_args_string_char @@ -329,7 +337,6 @@ function_args_string_sequence : function_args_string_char function_args_string_char : function_args_char | '(' | ')' ; - file_name : file_name_char { $$ = strbuf_new(); strbuf_append_char($$, $1); } | file_name file_name_char { $$ = strbuf_append_char($1, $2); } ; @@ -408,6 +415,11 @@ identifier_braces_inside : identifier_braces_inside_char %dprec 1 strbuf_free($3); $$ = strbuf_append_char($1, $4); } + | identifier_braces_inside '(' ')' %dprec 1 + { + $$ = strbuf_append_char($1, $2); + $$ = strbuf_append_char($1, $3); + } | identifier_braces_inside identifier_template %dprec 2 { $$ = strbuf_append_str($1, $2->buf); -- cgit From abf9af670cd605ec2fb631219e9493f619773db3 Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Thu, 4 Feb 2010 10:11:40 +0100 Subject: Skip bugs without backtrace; +some notes; run ./abrt-backtrace instead of system one --- src/Backtrace/abrt-bz-dupchecker | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Backtrace/abrt-bz-dupchecker b/src/Backtrace/abrt-bz-dupchecker index 01cafa0..4484d39 100755 --- a/src/Backtrace/abrt-bz-dupchecker +++ b/src/Backtrace/abrt-bz-dupchecker @@ -10,6 +10,14 @@ # # Please do not run this script unless it's neccessary to do so. # It forces Bugzilla to send data related to thousands of bug reports. +# +# +# Useful text to be pasted to Bugzilla: +""" +This bug appears to have been filled using a buggy version of ABRT, because +it contains unusable backtrace. Sorry for the inconvenience. +Closing as INSUFFICIENT_DATA. +""" from bugzilla import RHBugzilla from optparse import OptionParser @@ -62,16 +70,24 @@ for buginfo in buginfos: else: # Get backtrace from bug and store it as a file. bug = bz.getbug(buginfo.bug_id) + downloaded = False for attachment in bug.attachments: if attachment['filename'] == 'backtrace': data = bz.openattachment(attachment['id']) f = open(filename, 'w') f.write(data.read()) f.close() + downloaded = True if options.verbose: print "Attachment {0} downloaded.".format(filename) + + # Silently skip bugs without backtrace. + # Those are usually duplicates of bugs; the duplication copies + # abrt_hash, but it does not copy the attachment. + if not downloaded: + continue - command = ["/usr/bin/abrt-backtrace"] + command = ["./abrt-backtrace"] command.append(filename) command.append("--single-thread") command.append("--frame-depth=5") -- cgit From 823b800110c01df95085a7d19e815ed441611dd1 Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Thu, 4 Feb 2010 10:12:44 +0100 Subject: Show abrt-btrc stderr; show stats at the end --- src/Backtrace/check-bt-parsability | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Backtrace/check-bt-parsability b/src/Backtrace/check-bt-parsability index 39913fe..a5018bf 100755 --- a/src/Backtrace/check-bt-parsability +++ b/src/Backtrace/check-bt-parsability @@ -6,7 +6,7 @@ FAIL=0 for file in *.bt do #echo "$file" - ./abrt-backtrace $file &> /dev/null + ./abrt-backtrace $file 1> /dev/null if [ "$?" -eq "0" ] then echo -n "." @@ -17,3 +17,4 @@ do fi done echo "" +echo "Passed $PASS and failed $FAIL." -- cgit From 148e19105577984a7fa3b6da97ec9ba565a9cfa7 Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Thu, 4 Feb 2010 10:13:31 +0100 Subject: comments --- src/Daemon/Daemon.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index 5bcbe23..185ff7f 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -294,7 +294,7 @@ static void FindNewDumps(const char* pPath) struct stat stats; DIR *dp; vector_string_t dirs; - // get potential unsaved debugdumps + /* Get all debugdump directories in the pPath directory. */ dp = opendir(pPath); if (dp == NULL) { @@ -305,7 +305,7 @@ static void FindNewDumps(const char* pPath) while ((ep = readdir(dp))) { if (dot_or_dotdot(ep->d_name)) - continue; + continue; /* skip "." and ".." */ std::string dname = ssprintf("%s/%s", pPath, ep->d_name); if (lstat(dname.c_str(), &stats) == 0) { @@ -317,6 +317,7 @@ static void FindNewDumps(const char* pPath) } closedir(dp); + // get potential unsaved debugdumps vector_string_t::iterator itt = dirs.begin(); for (; itt != dirs.end(); ++itt) { -- cgit From 766273aebc09766eb40be905180242db94aabdda Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Thu, 4 Feb 2010 10:14:29 +0100 Subject: TODO mark --- src/Backtrace/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Backtrace/main.c b/src/Backtrace/main.c index 5e69338..f2fe1ba 100644 --- a/src/Backtrace/main.c +++ b/src/Backtrace/main.c @@ -249,7 +249,9 @@ int main(int argc, char **argv) * #2 0x0000000000423e6b in refresh_folder (stub=0x1b77f10 [MailStubExchange], * ... */ - char *empty_line = btnoheader; + char *empty_line = btnoheader; +/* TODO SPACES ON LINES AS WELL, rhbz#555251 !!!!!!!! +/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ while ((empty_line = strstr(empty_line, "\n\n")) != NULL) { if (0 != strncmp(empty_line, "\n\nThread", strlen("\n\nThread"))) -- cgit From 7c7be9f40f84a685975536f3b8e8bbe620dde398 Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Thu, 4 Feb 2010 11:53:47 +0100 Subject: Remove lines containing only spaces from backtrace. --- src/Backtrace/main.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Backtrace/main.c b/src/Backtrace/main.c index f2fe1ba..6683aa9 100644 --- a/src/Backtrace/main.c +++ b/src/Backtrace/main.c @@ -232,7 +232,7 @@ int main(int argc, char **argv) ++thread_fixer; } - /* Bug fixing hack for GDB. + /* Bug fixing hack for GDB - remove wrongly placed newlines from the backtrace. * Sometimes there is a newline in the local variable section. * This is caused by some GDB hooks. * Example: rhbz#538440 @@ -248,10 +248,26 @@ int main(int argc, char **argv) * __PRETTY_FUNCTION__ = "sync_deletions" * #2 0x0000000000423e6b in refresh_folder (stub=0x1b77f10 [MailStubExchange], * ... + * + * The code removes every empty line (also those containing only spaces), + * which is not followed by a new Thread section. + * + * rhbz#555251 contains empty lines with spaces */ char *empty_line = btnoheader; -/* TODO SPACES ON LINES AS WELL, rhbz#555251 !!!!!!!! -/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ + char *c = btnoheader; + while (*c) + { + if (*c == '\n') + { + char *cend = c + 1; + while (*cend == ' ' || *cend == '\t') + ++cend; + if (*cend == '\n' && 0 != strncmp(cend, "\nThread", strlen("\nThread"))) + memmove(c, cend, strlen(cend) + 1); + } + ++c; + } while ((empty_line = strstr(empty_line, "\n\n")) != NULL) { if (0 != strncmp(empty_line, "\n\nThread", strlen("\n\nThread"))) -- cgit From f42baa45204bfb1df7219242d7ebcc102ad494be Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 4 Feb 2010 16:34:38 +0100 Subject: abrtd: fix rhbz#560642 - don't die on bad plugin names Signed-off-by: Denys Vlasenko --- src/Daemon/ABRTPlugin.cpp | 46 ------------- src/Daemon/ABRTPlugin.h | 161 ------------------------------------------- src/Daemon/Makefile.am | 1 - src/Daemon/PluginManager.cpp | 63 +++++++++++++++-- src/Daemon/PluginManager.h | 3 +- 5 files changed, 58 insertions(+), 216 deletions(-) delete mode 100644 src/Daemon/ABRTPlugin.cpp delete mode 100644 src/Daemon/ABRTPlugin.h (limited to 'src') diff --git a/src/Daemon/ABRTPlugin.cpp b/src/Daemon/ABRTPlugin.cpp deleted file mode 100644 index eb0b50d..0000000 --- a/src/Daemon/ABRTPlugin.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - ABRTPlugin.cpp - - Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com) - Copyright (C) 2009 RedHat inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "abrtlib.h" -#include "ABRTPlugin.h" -#include - -CLoadedModule::CLoadedModule(const char* pLibPath) -{ - /* All errors are fatal */ - m_pHandle = dlopen(pLibPath, RTLD_NOW); - if (!m_pHandle) - error_msg_and_die("can't load '%s': %s", pLibPath, dlerror()); - -#define LOADSYM(fp, handle, name) do { \ - fp = (typeof(fp)) (dlsym(handle, name)); \ - if (!fp) \ - error_msg_and_die("'%s' has no %s entry", pLibPath, name); \ -} while (0) - - LOADSYM(m_pPluginInfo, m_pHandle, "plugin_info"); - LOADSYM(m_pFnPluginNew, m_pHandle, "plugin_new"); -} - -CLoadedModule::~CLoadedModule() -{ - dlclose(m_pHandle); -} diff --git a/src/Daemon/ABRTPlugin.h b/src/Daemon/ABRTPlugin.h deleted file mode 100644 index 57d87f0..0000000 --- a/src/Daemon/ABRTPlugin.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - ABRTPlugin.h - header file for abrt plugin. - - Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com) - Copyright (C) 2009 RedHat inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - - -#ifndef ABRTPLUGIN_H_ -#define ABRTPLUGIN_H_ - -#include -#include "Plugin.h" - -/** - * CLoadedModule class. A class which contains a loaded plugin. - */ -class CLoadedModule -{ - private: - /** - * dlopen'ed library - */ - void* m_pHandle; - /** - * A pointer to struc containing information about plugin. - */ - const plugin_info_t* m_pPluginInfo; - /** - * A pointer to function, which creates new instances of plugin. - */ - CPlugin* (*m_pFnPluginNew)(); - - public: - /** - * A constructor. - * The constructor loads a plugin - * @param pLibPath a path to a plugin - */ - CLoadedModule(const char* pLibPath); - /** - * A destructor. - */ - ~CLoadedModule(); - /** - * It is used for getting loaded plugin's version. - * @return plugin version - */ - const char* GetVersion(); - /** - * It is used for getting loaded plugin's magic number. - * @return magic number - */ - int GetMagicNumber(); - /** - * It is used for getting loaded plugin's name. - * @return magic number - */ - const char* GetName(); - /** - * It is used for getting loaded plugin's description. - * @return magic number - */ - const char* GetDescription(); - /** - * It is used for getting an author email of loaded plugin. - * @return description - */ - const char* GetEmail(); - /** - * It is used for getting a home page of loaded plugin. - * @return home page - */ - const char* GetWWW(); - /** - * It is used for getting a path to gui description. - * @return home page - */ - const char* GetGTKBuilder(); - /** - * It is used for getting loaded plugin's type. - * @return type - */ - plugin_type_t GetType(); - /** - * It is used fot getting of a new instance of loaded plugin - * @return pointer to new allocated instance of plugin. A caller - * has to delete it. - */ - CPlugin* PluginNew(); -}; - -inline -const char* CLoadedModule::GetVersion() -{ - return m_pPluginInfo->m_sVersion; -} - -inline -int CLoadedModule::GetMagicNumber() -{ - return m_pPluginInfo->m_nMagicNumber; -} - -inline -const char* CLoadedModule::GetName() -{ - return m_pPluginInfo->m_sName; -} - -inline -const char* CLoadedModule::GetDescription() -{ - return m_pPluginInfo->m_sDescription; -} - -inline -const char* CLoadedModule::GetEmail() -{ - return m_pPluginInfo->m_sEmail; -} - -inline -const char* CLoadedModule::GetWWW() -{ - return m_pPluginInfo->m_sWWW; -} - -inline -const char* CLoadedModule::GetGTKBuilder() -{ - return m_pPluginInfo->m_sGTKBuilder; -} - -inline -plugin_type_t CLoadedModule::GetType() -{ - return m_pPluginInfo->m_Type; -} - -inline -CPlugin* CLoadedModule::PluginNew() -{ - return m_pFnPluginNew(); -} - -#endif /*ABRTPLUGIN_H_*/ diff --git a/src/Daemon/Makefile.am b/src/Daemon/Makefile.am index 235b01b..cb44027 100644 --- a/src/Daemon/Makefile.am +++ b/src/Daemon/Makefile.am @@ -4,7 +4,6 @@ sbin_PROGRAMS = abrtd # disabled: CommLayerServerSocket.h CommLayerServerSocket.cpp abrtd_SOURCES = \ - ABRTPlugin.h ABRTPlugin.cpp \ PluginManager.h PluginManager.cpp \ RPM.h RPM.cpp \ MiddleWare.h MiddleWare.cpp \ diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp index 15e9bee..5166c6a 100644 --- a/src/Daemon/PluginManager.cpp +++ b/src/Daemon/PluginManager.cpp @@ -21,6 +21,7 @@ #include #include +#include #include "abrtlib.h" #include "ABRTException.h" #include "CommLayerInner.h" @@ -29,6 +30,48 @@ using namespace std; + +/** + * CLoadedModule class. A class which contains a loaded plugin. + */ +class CLoadedModule +{ + private: + /* dlopen'ed library */ + void *m_pHandle; + const plugin_info_t *m_pPluginInfo; + CPlugin* (*m_pFnPluginNew)(); + + public: + CLoadedModule(void *handle, const char *mod_name); + ~CLoadedModule() { dlclose(m_pHandle); } + int GetMagicNumber() { return m_pPluginInfo->m_nMagicNumber; } + const char *GetVersion() { return m_pPluginInfo->m_sVersion; } + const char *GetName() { return m_pPluginInfo->m_sName; } + const char *GetDescription() { return m_pPluginInfo->m_sDescription; } + const char *GetEmail() { return m_pPluginInfo->m_sEmail; } + const char *GetWWW() { return m_pPluginInfo->m_sWWW; } + const char *GetGTKBuilder() { return m_pPluginInfo->m_sGTKBuilder; } + plugin_type_t GetType() { return m_pPluginInfo->m_Type; } + CPlugin *PluginNew() { return m_pFnPluginNew(); } +}; +CLoadedModule::CLoadedModule(void *handle, const char *mod_name) +{ + m_pHandle = handle; + /* All errors are fatal */ +#define LOADSYM(fp, handle, name) \ + do { \ + fp = (typeof(fp)) (dlsym(handle, name)); \ + if (!fp) \ + error_msg_and_die("'%s' has no %s entry", mod_name, name); \ + } while (0) + + LOADSYM(m_pPluginInfo, handle, "plugin_info"); + LOADSYM(m_pFnPluginNew, handle, "plugin_new"); +#undef LOADSYM +} + + /** * Text representation of plugin types. */ @@ -200,7 +243,13 @@ CPlugin* CPluginManager::LoadPlugin(const char *pName, bool enabled_only) } string libPath = ssprintf(PLUGINS_LIB_DIR"/"PLUGINS_LIB_PREFIX"%s."PLUGINS_LIB_EXTENSION, pName); - CLoadedModule* module = new CLoadedModule(libPath.c_str()); + void *handle = dlopen(libPath.c_str(), RTLD_NOW); + if (!handle) + { + error_msg("Can't load '%s': %s", libPath.c_str(), dlerror()); + return NULL; /* error */ + } + CLoadedModule *module = new CLoadedModule(handle, pName); if (module->GetMagicNumber() != PLUGINS_MAGIC_NUMBER || module->GetType() < 0 || module->GetType() > MAX_PLUGIN_TYPE @@ -214,7 +263,7 @@ CPlugin* CPluginManager::LoadPlugin(const char *pName, bool enabled_only) } VERB3 log("Loaded plugin %s v.%s", pName, module->GetVersion()); - CPlugin* plugin = NULL; + CPlugin *plugin = NULL; try { plugin = module->PluginNew(); @@ -297,7 +346,7 @@ void CPluginManager::UnRegisterPluginDBUS(const char *pName, const char *pDBUSSe CAnalyzer* CPluginManager::GetAnalyzer(const char *pName) { - CPlugin* plugin = LoadPlugin(pName); + CPlugin *plugin = LoadPlugin(pName); if (!plugin) { error_msg("Plugin '%s' is not registered", pName); @@ -313,7 +362,7 @@ CAnalyzer* CPluginManager::GetAnalyzer(const char *pName) CReporter* CPluginManager::GetReporter(const char *pName) { - CPlugin* plugin = LoadPlugin(pName); + CPlugin *plugin = LoadPlugin(pName); if (!plugin) { error_msg("Plugin '%s' is not registered", pName); @@ -329,7 +378,7 @@ CReporter* CPluginManager::GetReporter(const char *pName) CAction* CPluginManager::GetAction(const char *pName, bool silent) { - CPlugin* plugin = LoadPlugin(pName); + CPlugin *plugin = LoadPlugin(pName); if (!plugin) { error_msg("Plugin '%s' is not registered", pName); @@ -346,7 +395,7 @@ CAction* CPluginManager::GetAction(const char *pName, bool silent) CDatabase* CPluginManager::GetDatabase(const char *pName) { - CPlugin* plugin = LoadPlugin(pName); + CPlugin *plugin = LoadPlugin(pName); if (!plugin) { throw CABRTException(EXCEP_PLUGIN, "Plugin '%s' is not registered", pName); @@ -360,7 +409,7 @@ CDatabase* CPluginManager::GetDatabase(const char *pName) plugin_type_t CPluginManager::GetPluginType(const char *pName) { - CPlugin* plugin = LoadPlugin(pName); + CPlugin *plugin = LoadPlugin(pName); if (!plugin) { throw CABRTException(EXCEP_PLUGIN, "Plugin '%s' is not registered", pName); diff --git a/src/Daemon/PluginManager.h b/src/Daemon/PluginManager.h index 22cc387..8eebe7d 100644 --- a/src/Daemon/PluginManager.h +++ b/src/Daemon/PluginManager.h @@ -24,13 +24,14 @@ #define PLUGINMANAGER_H_ #include "abrt_types.h" -#include "ABRTPlugin.h" #include "Plugin.h" #include "Analyzer.h" #include "Reporter.h" #include "Database.h" #include "Action.h" +class CLoadedModule; /* opaque */ + /** * A class. It takes care of loading, registering and manipulating with * plugins. When a plugin is loaded, its library is opened, but no plugin -- cgit