|
|
|
@ -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 );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|