summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-05-08 16:54:41 -0500
committerSlávek Banko <slavek.banko@axis.cz>2013-05-09 19:56:12 +0200
commitfd31f20cfb50e5b2039fa30eb72302070de44498 (patch)
tree1d5d853e0e66f2b4438e711bb8293f5e70320b8d
parentedcb2b0e8185d4620bf07fac50d818cb3c272644 (diff)
downloadtdebase-fd31f20cfb50e5b2039fa30eb72302070de44498.tar.gz
tdebase-fd31f20cfb50e5b2039fa30eb72302070de44498.zip
Update drkonqi to collect data on threaded programs and CPU type/speed/core number
(part of the original commit) (cherry picked from commit 1fbdb78d932e66263f82a1a306b5900cc44b7107)
-rw-r--r--drkonqi/backtrace.cpp54
-rw-r--r--drkonqi/debuggers/gdbrc5
-rw-r--r--drkonqi/krashconf.cpp1
-rw-r--r--drkonqi/krashconf.h2
4 files changed, 44 insertions, 18 deletions
diff --git a/drkonqi/backtrace.cpp b/drkonqi/backtrace.cpp
index 7fa052e76..213e666b5 100644
--- a/drkonqi/backtrace.cpp
+++ b/drkonqi/backtrace.cpp
@@ -201,20 +201,42 @@ bool BackTrace::usefulBacktrace()
// remove stack frames added because of KCrash
void BackTrace::processBacktrace()
{
- if( !m_krashconf->kcrashRegExp().isEmpty())
- {
- TQRegExp kcrashregexp( m_krashconf->kcrashRegExp());
- int pos = kcrashregexp.search( m_strBt );
- if( pos >= 0 )
- {
- int len = kcrashregexp.matchedLength();
- if( m_strBt[ pos ] == '\n' )
- {
- ++pos;
- --len;
- }
- m_strBt.remove( pos, len );
- m_strBt.insert( pos, TQString::fromLatin1( "[KCrash handler]\n" ));
- }
- }
+ if( !m_krashconf->kcrashRegExp().isEmpty()) {
+ TQRegExp kcrashregexp( m_krashconf->kcrashRegExp());
+ int pos = -1;
+ while ((pos = kcrashregexp.search( m_strBt )) >= 0) {
+ pos = kcrashregexp.search( m_strBt );
+ if( pos >= 0 ) {
+ int len = kcrashregexp.matchedLength();
+ int nextinfochunkpos = m_strBt.find("====", pos);
+ if (nextinfochunkpos >= 0) {
+ // Trying to delete too much!
+ int chunkpos = pos;
+ TQString limitedstrBt = m_strBt.mid(pos, nextinfochunkpos - pos);
+ pos = kcrashregexp.search( limitedstrBt ) + chunkpos;
+ len = kcrashregexp.matchedLength();
+ }
+ if (pos >= 0) {
+ if( m_strBt[ pos ] == '\n' ) {
+ ++pos;
+ --len;
+ }
+ m_strBt.remove( pos, len );
+ m_strBt.insert( pos, TQString::fromLatin1( "[KCrash handler]\n" ));
+ }
+ }
+ }
+ }
+ if( !m_krashconf->kcrashRegExpSingle().isEmpty()) {
+ TQRegExp kcrashregexp( m_krashconf->kcrashRegExpSingle());
+ int pos = kcrashregexp.search( m_strBt );
+ if( pos >= 0 ) {
+ int len = kcrashregexp.matchedLength();
+ if( m_strBt[ pos ] == '\n' ) {
+ ++pos;
+ --len;
+ }
+ m_strBt.remove( pos, len );
+ }
+ }
}
diff --git a/drkonqi/debuggers/gdbrc b/drkonqi/debuggers/gdbrc
index 5254aafe6..476f4fd3f 100644
--- a/drkonqi/debuggers/gdbrc
+++ b/drkonqi/debuggers/gdbrc
@@ -158,9 +158,10 @@ Comment[zu]=Umcoshi wamaphutha osekelwe umbhalo osuka kwi-GNU kwikhonsoli
Exec=konsole -e gdb -nw %execname %pid
ExecBatch=gdb -nw -n -batch -x %tempfile %execname %pid
TryExec=gdb
-BacktraceCommand=bt
+BacktraceCommand=echo \\n\necho ==== (gdb) bt ====\\n\nbt\necho \\n\\n\necho ==== (gdb) bt full ====\\n\nbt full\necho\\n\\n\necho ==== (gdb) thread apply all bt ====\\n\nthread apply all bt
RemoveFromBacktraceRegExp=\(no debugging symbols found\)\.\.\.\\n?
InvalidStackFrameRegExp=\\n#[0-9]+\\s+0x[0-9A-Fa-f]+ \w* \?\?
FrameRegExp=\\n#[0-9]+\\s+0x[0-9A-Fa-f]+
NeededInValidBacktraceRegExp=\\n#5
-KCrashRegExp=\\n0x[0123456789abcdefABCDEF]+.*<signal handler called>[ ]*\\n
+KCrashRegExp=\\n#0[ ]*0x[0123456789abcdefABCDEF]+.*<signal handler called>[ ]*\\n
+KCrashRegExpSingle=\\n0x[0123456789abcdefABCDEF][^\\n]*\\n
diff --git a/drkonqi/krashconf.cpp b/drkonqi/krashconf.cpp
index 4faccc956..bb263b32e 100644
--- a/drkonqi/krashconf.cpp
+++ b/drkonqi/krashconf.cpp
@@ -111,6 +111,7 @@ void KrashConfig :: readConfig()
m_frameRegExp = debuggers.readEntry("FrameRegExp");
m_neededInValidBacktraceRegExp = debuggers.readEntry("NeededInValidBacktraceRegExp");
m_kcrashRegExp = debuggers.readEntry("KCrashRegExp");
+ m_kcrashRegExpSingle = debuggers.readEntry("KCrashRegExpSingle");
KConfig preset(TQString::fromLatin1("presets/%1rc").arg(configname),
true, false, "appdata");
diff --git a/drkonqi/krashconf.h b/drkonqi/krashconf.h
index 236083f76..57d2efa67 100644
--- a/drkonqi/krashconf.h
+++ b/drkonqi/krashconf.h
@@ -66,6 +66,7 @@ public:
TQString frameRegExp() const { return m_frameRegExp; }
TQString neededInValidBacktraceRegExp() const { return m_neededInValidBacktraceRegExp; }
TQString kcrashRegExp() const { return m_kcrashRegExp; }
+ TQString kcrashRegExpSingle() const { return m_kcrashRegExpSingle; }
bool showBacktrace() const { return m_showbacktrace; };
bool showDebugger() const { return m_showdebugger && !m_debugger.isNull(); };
bool showBugReport() const { return m_showbugreport; };
@@ -108,6 +109,7 @@ private:
TQString m_frameRegExp;
TQString m_neededInValidBacktraceRegExp;
TQString m_kcrashRegExp;
+ TQString m_kcrashRegExpSingle;
};
#endif