1/*******************************************************************
2* parsebugbacktraces.h
3* Copyright 2011 Matthias Fuchs <mat69@gmx.net>
4*
5* This program is free software; you can redistribute it and/or
6* modify it under the terms of the GNU General Public License as
7* published by the Free Software Foundation; either version 2 of
8* the License, or (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17*
18******************************************************************/
19
20#ifndef PARSE_BUG_BACKTRACES_H
21#define PARSE_BUG_BACKTRACES_H
22
23#include "parser/backtraceline.h"
24#include "bugzillalib.h"
25
26class BacktraceParser;
27
28/**
29 * Parses a Bugreport to find all the backtraces listed there
30 * NOTE it assumes that the backtraces provided were created
31 * by gdb
32 */
33class ParseBugBacktraces : QObject
34{
35 Q_OBJECT
36 public:
37 explicit ParseBugBacktraces(const BugReport &bug, QObject *parent = 0);
38
39 void parse();
40
41 enum DuplicateRating {
42 PerfectDuplicate,//functionnames and stackframe numer match
43 MostLikelyDuplicate,//functionnames and stackframe numer match >=90%
44 MaybeDuplicate,//functionnames and stackframe numer match >=60%
45 NoDuplicate//functionnames and stackframe numer match <60%
46 };
47
48 DuplicateRating findDuplicate(const QList<BacktraceLine> &backtrace);
49
50 signals:
51 void starting();
52 void newLine(const QString &line);
53
54 private:
55 void parse(const QString &comment);
56
57 private:
58 BacktraceParser *m_parser;
59 const BugReport m_bug;
60 QList<QList<BacktraceLine> > m_backtraces;
61};
62
63#endif
64