Refactor optimized GDB thread generation

- make the optimization routine accept thread instead of a stacktrace
- add function that takes a stacktrace and return formatted optimized
  stacktrace as a string
- expose those in python

Signed-off-by: Martin Milata <mmilata@redhat.com>
Signed-off-by: Jakub Filak <jfilak@redhat.com>
Short textual representation of frames

These can be concatenated to get short backtrace suitable for inclusion
in bugzilla comment.

Signed-off-by: Martin Milata <mmilata@redhat.com>
Signed-off-by: Jakub Filak <jfilak@redhat.com>
java: add sr_java_find_crash_thread stub

Signed-off-by: Martin Milata <mmilata@redhat.com>
Signed-off-by: Jakub Filak <jfilak@redhat.com>
Add a type member to satyr structures

All frame/thread/stacktrace structures now contain a report type
constant as its first member. This makes it possible to provide
functions that accepts frames/threads/stacktraces of any type (primitive
form of dynamic typing).

This change is split from the following patch in order to make it more
readable and touch less files.

Signed-off-by: Martin Milata <mmilata@redhat.com>
Signed-off-by: Jakub Filak <jfilak@redhat.com>
Add type-agnostic API

Type-agnostic API means that we expose several functions that operate on
frames (or threads or stacktraces) regardless of their problem type.
This is accomplished by looking at the type member of each structure
(introduced in previous patch) and using it to look up the right
function for the type.

Furthermore, the implementations of the type-agnostic functions can
themselves work on multiple structure types, which can prevent some code
duplication.

A sr_stacktrace_to_short_text function is provided as an example,
closing #64. Related to #63 and related to #66 as the requested
functionality should be easier to implement now.

Note:

I've fixed an obvious typo in lib/utils.h
- (assert((type > 0) && (type) < SR_REPORT_NUM
+ (assert((type > SR_REPORT_INVALID) && (type) < SR_REPORT_NUM

Jakub Filak

Signed-off-by: Martin Milata <mmilata@redhat.com>
Signed-off-by: Jakub Filak <jfilak@redhat.com>
Tests for the type-agnostic functions

Signed-off-by: Martin Milata <mmilata@redhat.com>
Signed-off-by: Jakub Filak <jfilak@redhat.com>
Expose to_short_text method in python + tests

Signed-off-by: Martin Milata <mmilata@redhat.com>
Signed-off-by: Jakub Filak <jfilak@redhat.com>
Generic version of thread frame count

The sr_*_get_frame_count functions were replaced by generic version that
works on all problem types. The functions can be called on "stacktrace"
structures for problem types that do not have a separate "thread"
structure.

Signed-off-by: Martin Milata <mmilata@redhat.com>
Signed-off-by: Jakub Filak <jfilak@redhat.com>
abrt: report type from analyzer value

Convenience function for supplying the right first argument to
sr_stacktrace_parse.

Signed-off-by: Martin Milata <mmilata@redhat.com>
Signed-off-by: Jakub Filak <jfilak@redhat.com>