Denys Vlasenko <dvlasenk(a)redhat.com> writes:
On Sat, 2011-03-26 at 15:01 +0100, Karel Klic wrote:
+ /* Read backtrace */
+ /* NB: get_backtrace() closes dd */
+ char *backtrace_str = dd_load_text(dd, FILENAME_BACKTRACE);
+ if (!backtrace_str)
+ {
+ backtrace_str = xstrdup("");
+ log("Backtrace file is missing");
+ }
(1) The "NB: get_backtrace() closes dd" comment is out of place.
(2) dd_load_text() never returns NULL. grep for
DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE to see how to do what you want.
Ok. I have modified the tool to exit with failure when the backtrace
file is missing. This makes sense, as the tool is named
"abrt-action-analyze-backtrace", and it should work well this way in
Ccpp analyze events.
+ /*
+ * The parser failed. Compute the UUID from the executable
+ * and package only. This is not supposed to happen often.
+ */
+ VERB1 log(_("Backtrace parsing failed for %s"), dump_dir_name);
+ VERB1 log("%d:%d: %s", location.line, location.column,
location.message);
Since it is not supposed to happen often, perhaps it's better
to log it *unconditionally*, that is, without VERB1?
Agreed.
Pushed to git.
Thanks,
Karel