Changeset View
Changeset View
Standalone View
Standalone View
drkonqi/parser/backtraceparser.cpp
Show All 12 Lines | 1 | /* | |||
---|---|---|---|---|---|
13 | 13 | | |||
14 | You should have received a copy of the GNU General Public License along | 14 | You should have received a copy of the GNU General Public License along | ||
15 | with this program; if not, write to the Free Software Foundation, Inc., | 15 | with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | 16 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | */ | 17 | */ | ||
18 | #include "backtraceparser_p.h" | 18 | #include "backtraceparser_p.h" | ||
19 | #include "backtraceparsergdb.h" | 19 | #include "backtraceparsergdb.h" | ||
20 | #include "backtraceparserkdbgwin.h" | 20 | #include "backtraceparserkdbgwin.h" | ||
21 | #include "backtraceparserlldb.h" | ||||
21 | #include "backtraceparsernull.h" | 22 | #include "backtraceparsernull.h" | ||
22 | #include <QtCore/QRegExp> | 23 | #include <QtCore/QRegExp> | ||
23 | #include <QtCore/QMetaEnum> | 24 | #include <QtCore/QMetaEnum> | ||
24 | #include <QtCore/QDebug> | 25 | #include <QtCore/QDebug> | ||
25 | 26 | | |||
26 | //factory | 27 | //factory | ||
27 | BacktraceParser *BacktraceParser::newParser(const QString & debuggerName, QObject *parent) | 28 | BacktraceParser *BacktraceParser::newParser(const QString & debuggerName, QObject *parent) | ||
28 | { | 29 | { | ||
29 | if (debuggerName == QLatin1String("gdb")) { | 30 | if (debuggerName == QLatin1String("gdb")) { | ||
30 | return new BacktraceParserGdb(parent); | 31 | return new BacktraceParserGdb(parent); | ||
31 | } else if (debuggerName == QLatin1String("kdbgwin")) { | 32 | } else if (debuggerName == QLatin1String("kdbgwin")) { | ||
32 | return new BacktraceParserKdbgwin(parent); | 33 | return new BacktraceParserKdbgwin(parent); | ||
34 | } else if (debuggerName == QLatin1String("lldb")) { | ||||
35 | return new BacktraceParserLldb(parent); | ||||
33 | } else { | 36 | } else { | ||
34 | return new BacktraceParserNull(parent); | 37 | return new BacktraceParserNull(parent); | ||
35 | } | 38 | } | ||
36 | } | 39 | } | ||
37 | 40 | | |||
38 | BacktraceParser::BacktraceParser(QObject *parent) : QObject(parent), d_ptr(NULL) {} | 41 | BacktraceParser::BacktraceParser(QObject *parent) : QObject(parent), d_ptr(NULL) {} | ||
39 | BacktraceParser::~BacktraceParser() { delete d_ptr; } | 42 | BacktraceParser::~BacktraceParser() { delete d_ptr; } | ||
40 | 43 | | |||
▲ Show 20 Lines • Show All 152 Lines • ▼ Show 20 Line(s) | 195 | /* This function returns true if the given stack frame line should be ignored from rating | |||
193 | for some reason. Currently it ignores all libc/libstdc++/libpthread functions. */ | 196 | for some reason. Currently it ignores all libc/libstdc++/libpthread functions. */ | ||
194 | static bool lineShouldBeIgnored(const BacktraceLine & line) | 197 | static bool lineShouldBeIgnored(const BacktraceLine & line) | ||
195 | { | 198 | { | ||
196 | if ( line.libraryName().contains(QStringLiteral("libc.so")) | 199 | if ( line.libraryName().contains(QStringLiteral("libc.so")) | ||
197 | || line.libraryName().contains(QStringLiteral("libstdc++.so")) | 200 | || line.libraryName().contains(QStringLiteral("libstdc++.so")) | ||
198 | || line.functionName().startsWith(QLatin1String("*__GI_")) //glibc2.9 uses *__GI_ as prefix | 201 | || line.functionName().startsWith(QLatin1String("*__GI_")) //glibc2.9 uses *__GI_ as prefix | ||
199 | || line.libraryName().contains(QStringLiteral("libpthread.so")) | 202 | || line.libraryName().contains(QStringLiteral("libpthread.so")) | ||
200 | || line.libraryName().contains(QStringLiteral("libglib-2.0.so")) | 203 | || line.libraryName().contains(QStringLiteral("libglib-2.0.so")) | ||
204 | #ifdef Q_OS_MACOS | ||||
205 | || (line.libraryName().startsWith(QStringLiteral("libsystem_")) && line.libraryName().endsWith(QStringLiteral(".dylib"))) | ||||
206 | || line.libraryName().contains(QStringLiteral("Foundation`")) | ||||
207 | #endif | ||||
201 | || line.libraryName().contains(QStringLiteral("ntdll.dll")) | 208 | || line.libraryName().contains(QStringLiteral("ntdll.dll")) | ||
202 | || line.libraryName().contains(QStringLiteral("kernel32.dll")) | 209 | || line.libraryName().contains(QStringLiteral("kernel32.dll")) | ||
203 | || line.functionName().contains(QStringLiteral("_tmain")) | 210 | || line.functionName().contains(QStringLiteral("_tmain")) | ||
204 | || line.functionName() == QLatin1String("WinMain") ) | 211 | || line.functionName() == QLatin1String("WinMain") ) | ||
205 | return true; | 212 | return true; | ||
206 | 213 | | |||
207 | return false; | 214 | return false; | ||
208 | } | 215 | } | ||
▲ Show 20 Lines • Show All 186 Lines • Show Last 20 Lines |