Changeset View
Changeset View
Standalone View
Standalone View
src/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 "drkonqi_parser_debug.h" | 23 | #include "drkonqi_parser_debug.h" | ||
23 | #include <QRegExp> | 24 | #include <QRegExp> | ||
24 | #include <QMetaEnum> | 25 | #include <QMetaEnum> | ||
25 | #include <QDebug> | 26 | #include <QDebug> | ||
26 | 27 | | |||
27 | //factory | 28 | //factory | ||
28 | BacktraceParser *BacktraceParser::newParser(const QString & debuggerName, QObject *parent) | 29 | BacktraceParser *BacktraceParser::newParser(const QString & debuggerName, QObject *parent) | ||
29 | { | 30 | { | ||
30 | if (debuggerName == QLatin1String("gdb")) { | 31 | if (debuggerName == QLatin1String("gdb")) { | ||
31 | return new BacktraceParserGdb(parent); | 32 | return new BacktraceParserGdb(parent); | ||
32 | } else if (debuggerName == QLatin1String("kdbgwin")) { | 33 | } else if (debuggerName == QLatin1String("kdbgwin")) { | ||
33 | return new BacktraceParserKdbgwin(parent); | 34 | return new BacktraceParserKdbgwin(parent); | ||
35 | } else if (debuggerName == QLatin1String("lldb")) { | ||||
36 | return new BacktraceParserLldb(parent); | ||||
34 | } else { | 37 | } else { | ||
35 | return new BacktraceParserNull(parent); | 38 | return new BacktraceParserNull(parent); | ||
36 | } | 39 | } | ||
37 | } | 40 | } | ||
38 | 41 | | |||
39 | BacktraceParser::BacktraceParser(QObject *parent) : QObject(parent), d_ptr(nullptr) {} | 42 | BacktraceParser::BacktraceParser(QObject *parent) : QObject(parent), d_ptr(nullptr) {} | ||
40 | BacktraceParser::~BacktraceParser() { delete d_ptr; } | 43 | BacktraceParser::~BacktraceParser() { delete d_ptr; } | ||
41 | 44 | | |||
▲ Show 20 Lines • Show All 151 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 |