summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2010-02-04 11:28:18 +0100
committerKarel Klic <kklic@redhat.com>2010-02-04 11:28:18 +0100
commit7832c5a66672c63ebda91554bd463b85669755bb (patch)
treea0164bbd558399128a8329f13f0f32121ab7f4e0 /src
parente45356512a661c4dd1d4d18bc40c37a3ffb3b989 (diff)
parenta50985f228686b8eecd7025a0851001f216c71d6 (diff)
downloadabrt-7832c5a66672c63ebda91554bd463b85669755bb.tar.gz
abrt-7832c5a66672c63ebda91554bd463b85669755bb.tar.xz
abrt-7832c5a66672c63ebda91554bd463b85669755bb.zip
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'src')
-rwxr-xr-xsrc/Backtrace/abrt-bz-dupchecker18
-rwxr-xr-xsrc/Backtrace/check-bt-parsability3
-rw-r--r--src/Backtrace/main.c4
-rw-r--r--src/Backtrace/parser.y25
-rw-r--r--src/CLI/report.cpp16
-rw-r--r--src/Daemon/Daemon.cpp5
-rw-r--r--src/Daemon/PluginManager.cpp9
-rw-r--r--src/Gui/PluginsSettingsDialog.py16
-rw-r--r--src/Gui/ccgui.glade2
-rw-r--r--src/Gui/report.glade24
-rw-r--r--src/Gui/settings.glade11
11 files changed, 86 insertions, 47 deletions
diff --git a/src/Backtrace/abrt-bz-dupchecker b/src/Backtrace/abrt-bz-dupchecker
index 01cafa01..4484d399 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")
diff --git a/src/Backtrace/check-bt-parsability b/src/Backtrace/check-bt-parsability
index 39913fe0..a5018bfa 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."
diff --git a/src/Backtrace/main.c b/src/Backtrace/main.c
index 5e693380..f2fe1ba4 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")))
diff --git a/src/Backtrace/parser.y b/src/Backtrace/parser.y
index 76dd7de4..19032829 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 | '"' | '(' | ')' | '\\'
| '+' | '-' | '<' | '>' | '/' | '.'
| '[' | ']' | '?' | '\'' | '`' | ','
| '=' | '{' | '}' | '^' | '&' | '$'
- | ':' | ';' | '\\' | '!' | '@' | '*'
+ | ':' | ';' | '!' | '@' | '*'
| '%' | '|' | '~'
;
@@ -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
@@ -312,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
@@ -328,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); }
;
@@ -407,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);
diff --git a/src/CLI/report.cpp b/src/CLI/report.cpp
index 76cd3d5a..2bcd52af 100644
--- a/src/CLI/report.cpp
+++ b/src/CLI/report.cpp
@@ -38,26 +38,25 @@
* Trims whitespace characters both from left and right side of a string.
* Modifies the string in-place. Returns the trimmed string.
*/
-char *trim(char *str)
+static char *trim(char *str)
{
if (!str)
return NULL;
// Remove leading spaces.
char *ibuf;
- for (ibuf = str; *ibuf && isspace(*ibuf); ++ibuf)
- continue;
+ ibuf = skip_whitespace(str);
+ int i = strlen(ibuf);
if (str != ibuf)
- memmove(str, ibuf, ibuf - str);
+ memmove(str, ibuf, i + 1);
// Remove trailing spaces.
- int i = strlen(str);
while (--i >= 0)
{
if (!isspace(str[i]))
break;
}
- str[++i] = NULL;
+ str[++i] = '\0';
return str;
}
@@ -198,6 +197,8 @@ static void write_crash_report(const map_crash_data_t &report, FILE *fp)
_("# How to reproduce the crash?"));
write_crash_report_field(fp, report, FILENAME_BACKTRACE,
_("# Stack trace: a list of active stack frames at the time the crash occurred\n# Check that it does not contain any sensitive data such as passwords."));
+ write_crash_report_field(fp, report, FILENAME_KERNELOOPS,
+ _("# Kernel oops: kernel log snippet\n# Check that it does not contain any sensitive data such as passwords."));
write_crash_report_field(fp, report, CD_DUPHASH, "# DUPHASH");
write_crash_report_field(fp, report, FILENAME_ARCHITECTURE, _("# Architecture"));
write_crash_report_field(fp, report, FILENAME_CMDLINE, _("# Command line"));
@@ -221,7 +222,7 @@ static void write_crash_report(const map_crash_data_t &report, FILE *fp)
static int read_crash_report_field(const char *text, map_crash_data_t &report,
const char *field)
{
- char separator[strlen("\n" FIELD_SEP) + strlen(field) + 2]; // 2 = '\n\0'
+ char separator[sizeof("\n" FIELD_SEP)-1 + strlen(field) + 2]; // 2 = '\n\0'
sprintf(separator, "\n%s%s\n", FIELD_SEP, field);
const char *textfield = strstr(text, separator);
if (!textfield)
@@ -285,6 +286,7 @@ static int read_crash_report(map_crash_data_t &report, const char *text)
result |= read_crash_report_field(text, report, FILENAME_COMMENT);
result |= read_crash_report_field(text, report, FILENAME_REPRODUCE);
result |= read_crash_report_field(text, report, FILENAME_BACKTRACE);
+ result |= read_crash_report_field(text, report, FILENAME_KERNELOOPS);
result |= read_crash_report_field(text, report, CD_DUPHASH);
result |= read_crash_report_field(text, report, FILENAME_ARCHITECTURE);
result |= read_crash_report_field(text, report, FILENAME_CMDLINE);
diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp
index 5bcbe232..185ff7f0 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)
{
diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp
index c552880c..15e9bee8 100644
--- a/src/Daemon/PluginManager.cpp
+++ b/src/Daemon/PluginManager.cpp
@@ -159,16 +159,15 @@ void CPluginManager::UnLoadPlugins()
CPlugin* CPluginManager::LoadPlugin(const char *pName, bool enabled_only)
{
- map_string_t plugin_info;
-
- plugin_info["Name"] = pName;
-
map_plugin_t::iterator it_plugin = m_mapPlugins.find(pName);
if (it_plugin != m_mapPlugins.end())
{
return it_plugin->second; /* ok */
}
+ map_string_t plugin_info;
+ plugin_info["Name"] = pName;
+
const char *conf_name = pName;
if (strncmp(pName, "Kerneloops", sizeof("Kerneloops")-1) == 0)
{
@@ -262,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);
}
}
diff --git a/src/Gui/PluginsSettingsDialog.py b/src/Gui/PluginsSettingsDialog.py
index 611a8c59..0ba390da 100644
--- a/src/Gui/PluginsSettingsDialog.py
+++ b/src/Gui/PluginsSettingsDialog.py
@@ -97,22 +97,34 @@ class PluginsSettingsDialog:
# don't force refresh as it will overwrite settings if g-k is not available
pluginlist = getPluginInfoList(self.ccdaemon)
except Exception, e:
- print e
+ log("Error while loading plugins info: %s", e)
#gui_error_message("Error while loading plugins info, please check if abrt daemon is running\n %s" % e)
return
plugin_rows = {}
+ group_empty = {}
for plugin_type in PluginInfo.types.keys():
it = self.pluginsListStore.append(None,
+ # cell_text, toggle_active, toggle_visible, group_name_visible, color, plugin
["<b>%s</b>" % PluginInfo.types[plugin_type], 0, 0, 1, "gray", None])
plugin_rows[plugin_type] = it
+ group_empty[plugin_type] = 1
for entry in pluginlist:
if entry.Description:
text = "<b>%s</b>\n%s" % (entry.getName(), entry.Description)
else:
# non-loaded plugins have empty description
text = "<b>%s</b>" % entry.getName()
- self.pluginsListStore.append(plugin_rows[entry.getType()],
+ plugin_type = entry.getType()
+ self.pluginsListStore.append(plugin_rows[plugin_type],
+ # cell_text, toggle_active, toggle_visible, group_name_visible, color, plugin
[text, entry.Enabled == "yes", 1, 0, "white", entry])
+ group_empty[plugin_type] = 0
+ # rhbz#560971 "Don't show empty 'Not loaded plugins' section"
+ for plugin_type in group_empty.keys():
+ if group_empty[plugin_type]:
+ self.pluginsListStore.append(plugin_rows[plugin_type],
+ # cell_text, toggle_active, toggle_visible, group_name_visible, color, plugin
+ ["(none)", 0, 1, 0, "white", None])
self.pluginlist.expand_all()
def dehydrate(self):
diff --git a/src/Gui/ccgui.glade b/src/Gui/ccgui.glade
index 65ad9fe6..237f23a1 100644
--- a/src/Gui/ccgui.glade
+++ b/src/Gui/ccgui.glade
@@ -9,6 +9,7 @@
<property name="modal">True</property>
<property name="window_position">center-on-parent</property>
<property name="default_width">470</property>
+ <property name="icon">/usr/share/pixmaps/abrt.png</property>
<property name="transient_for">main_window3</property>
<child>
<widget class="GtkVBox" id="vbox1">
@@ -76,6 +77,7 @@
<property name="title" translatable="yes">About ABRT</property>
<property name="resizable">False</property>
<property name="window_position">center-on-parent</property>
+ <property name="icon">/usr/share/pixmaps/abrt.png</property>
<property name="type_hint">dialog</property>
<property name="has_separator">False</property>
<property name="program_name">ABRT</property>
diff --git a/src/Gui/report.glade b/src/Gui/report.glade
index 13e4c14e..e7f37ec0 100644
--- a/src/Gui/report.glade
+++ b/src/Gui/report.glade
@@ -374,16 +374,10 @@
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<child>
- <object class="GtkViewport" id="viewport1">
+ <object class="GtkTextView" id="tevHowToReproduce">
<property name="visible">True</property>
- <property name="resize_mode">queue</property>
- <child>
- <object class="GtkTextView" id="tevHowToReproduce">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="wrap_mode">word-char</property>
- </object>
- </child>
+ <property name="can_focus">True</property>
+ <property name="wrap_mode">word-char</property>
</object>
</child>
</object>
@@ -417,16 +411,10 @@
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<child>
- <object class="GtkViewport" id="viewport2">
+ <object class="GtkTextView" id="tvComment">
<property name="visible">True</property>
- <property name="resize_mode">queue</property>
- <child>
- <object class="GtkTextView" id="tvComment">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="wrap_mode">word-char</property>
- </object>
- </child>
+ <property name="can_focus">True</property>
+ <property name="wrap_mode">word-char</property>
</object>
</child>
</object>
diff --git a/src/Gui/settings.glade b/src/Gui/settings.glade
index 655c15b2..a9a14f43 100644
--- a/src/Gui/settings.glade
+++ b/src/Gui/settings.glade
@@ -3,11 +3,12 @@
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkWindow" id="wPluginsSettings">
- <property name="title" translatable="yes">Settings</property>
+ <property name="title" translatable="yes">Plugins</property>
<property name="modal">True</property>
<property name="window_position">center-on-parent</property>
<property name="default_width">450</property>
<property name="default_height">400</property>
+ <property name="icon">/usr/share/pixmaps/abrt.png</property>
<child>
<object class="GtkVBox" id="vboxabc1">
<property name="visible">True</property>
@@ -254,11 +255,12 @@
</child>
</object>
<object class="GtkWindow" id="wGlobalSettings">
- <property name="title" translatable="yes">Global Settings</property>
+ <property name="title" translatable="yes">Preferences</property>
<property name="modal">True</property>
<property name="window_position">center-on-parent</property>
<property name="default_width">450</property>
<property name="default_height">400</property>
+ <property name="icon">/usr/share/pixmaps/abrt.png</property>
<child>
<object class="GtkVBox" id="gsvbox1">
<property name="visible">True</property>
@@ -706,7 +708,7 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="bCancelSettings">
- <property name="label" translatable="yes">gtk-cancel</property>
+ <property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -720,7 +722,7 @@
</child>
<child>
<object class="GtkButton" id="bSaveSettings">
- <property name="label" translatable="yes">gtk-ok</property>
+ <property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
@@ -753,6 +755,7 @@
<property name="window_position">center-on-parent</property>
<property name="default_width">400</property>
<property name="default_height">400</property>
+ <property name="icon">/usr/share/pixmaps/abrt.png</property>
<property name="transient_for">wGlobalSettings</property>
<child>
<object class="GtkVBox" id="gpgkeys_vbox">