Skip to content
Permalink
Browse files

crash report dialog:

* get current context without an exception (eg. Ctrl+\)
* use <pre> around stack
* make report details expandable
* what about threads?
  • Loading branch information
jef-n committed Jul 20, 2017
1 parent 6624561 commit 67f7b3a2df21a8d58662aefafb6126b04cdfd652
Showing with 13 additions and 4 deletions.
  1. +1 −0 src/app/qgscrashdialog.cpp
  2. +4 −0 src/app/qgscrashreport.cpp
  3. +6 −2 src/core/qgsstacktrace.cpp
  4. +2 −2 src/ui/qgscrashdialog.ui
@@ -66,6 +66,7 @@ QString QgsCrashDialog::htmlToMarkdown( const QString &html )
markdown.replace( "<br>", "\n" );
markdown.replace( "<b>", "*" );
markdown.replace( "</b>", "*" );
markdown.replace( "QGIS code revision: ", "QGIS code revision: commit:");
return markdown;
}

@@ -48,15 +48,18 @@ const QString QgsCrashReport::toHtml() const
}
else
{
reportData.append( "<pre>" );
Q_FOREACH ( const QgsStackTrace::StackLine &line, mStackTrace )
{
QFileInfo fileInfo( line.fileName );
QString filename( fileInfo.fileName() );
reportData.append( QString( "(%1) %2 %3:%4" ).arg( line.moduleName, line.symbolName, filename, line.lineNumber ) );
}
reportData.append( "</pre>" );
}
}

#if 0
if ( flags().testFlag( QgsCrashReport::Plugins ) )
{
reportData.append( "<br>" );
@@ -70,6 +73,7 @@ const QString QgsCrashReport::toHtml() const
reportData.append( "<b>Project Info</b>" );
// TODO Get project details
}
#endif

if ( flags().testFlag( QgsCrashReport::QgisInfo ) )
{
@@ -53,7 +53,12 @@ QVector<QgsStackTrace::StackLine> QgsStackTrace::trace( _EXCEPTION_POINTERS *Exc

// StackWalk64() may modify context record passed to it, so we will
// use a copy.
CONTEXT context_record = *ExceptionInfo->ContextRecord;
CONTEXT context_record;
if (ExceptionInfo)
context_record = *ExceptionInfo->ContextRecord;
else
RtlCaptureContext(&context_record);

// Initialize stack walking.
STACKFRAME64 stack_frame;
memset( &stack_frame, 0, sizeof( stack_frame ) );
@@ -133,7 +138,6 @@ QVector<QgsStackTrace::StackLine> QgsStackTrace::trace( _EXCEPTION_POINTERS *Exc
qgsFree( module );
SymCleanup( process );
return stack;

}

QString QgsStackTrace::mSymbolPaths;
@@ -536,14 +536,14 @@
</property>
</widget>
</item>
<item row="6" column="0" colspan="3">
<item row="3" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<width>0</width>
<height>0</height>
</size>
</property>

0 comments on commit 67f7b3a

Please sign in to comment.
You can’t perform that action at this time.