Skip to content

Commit 67f7b3a

Browse files
committed
crash report dialog:
* get current context without an exception (eg. Ctrl+\) * use <pre> around stack * make report details expandable * what about threads?
1 parent 6624561 commit 67f7b3a

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

src/app/qgscrashdialog.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ QString QgsCrashDialog::htmlToMarkdown( const QString &html )
6666
markdown.replace( "<br>", "\n" );
6767
markdown.replace( "<b>", "*" );
6868
markdown.replace( "</b>", "*" );
69+
markdown.replace( "QGIS code revision: ", "QGIS code revision: commit:");
6970
return markdown;
7071
}
7172

src/app/qgscrashreport.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,18 @@ const QString QgsCrashReport::toHtml() const
4848
}
4949
else
5050
{
51+
reportData.append( "<pre>" );
5152
Q_FOREACH ( const QgsStackTrace::StackLine &line, mStackTrace )
5253
{
5354
QFileInfo fileInfo( line.fileName );
5455
QString filename( fileInfo.fileName() );
5556
reportData.append( QString( "(%1) %2 %3:%4" ).arg( line.moduleName, line.symbolName, filename, line.lineNumber ) );
5657
}
58+
reportData.append( "</pre>" );
5759
}
5860
}
5961

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

7478
if ( flags().testFlag( QgsCrashReport::QgisInfo ) )
7579
{

src/core/qgsstacktrace.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ QVector<QgsStackTrace::StackLine> QgsStackTrace::trace( _EXCEPTION_POINTERS *Exc
5353

5454
// StackWalk64() may modify context record passed to it, so we will
5555
// use a copy.
56-
CONTEXT context_record = *ExceptionInfo->ContextRecord;
56+
CONTEXT context_record;
57+
if (ExceptionInfo)
58+
context_record = *ExceptionInfo->ContextRecord;
59+
else
60+
RtlCaptureContext(&context_record);
61+
5762
// Initialize stack walking.
5863
STACKFRAME64 stack_frame;
5964
memset( &stack_frame, 0, sizeof( stack_frame ) );
@@ -133,7 +138,6 @@ QVector<QgsStackTrace::StackLine> QgsStackTrace::trace( _EXCEPTION_POINTERS *Exc
133138
qgsFree( module );
134139
SymCleanup( process );
135140
return stack;
136-
137141
}
138142

139143
QString QgsStackTrace::mSymbolPaths;

src/ui/qgscrashdialog.ui

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,14 +536,14 @@
536536
</property>
537537
</widget>
538538
</item>
539-
<item row="6" column="0" colspan="3">
539+
<item row="3" column="1">
540540
<spacer name="verticalSpacer">
541541
<property name="orientation">
542542
<enum>Qt::Vertical</enum>
543543
</property>
544544
<property name="sizeHint" stdset="0">
545545
<size>
546-
<width>20</width>
546+
<width>0</width>
547547
<height>0</height>
548548
</size>
549549
</property>

0 commit comments

Comments
 (0)