File tree Expand file tree Collapse file tree 3 files changed +35
-3
lines changed Expand file tree Collapse file tree 3 files changed +35
-3
lines changed Original file line number Diff line number Diff line change @@ -470,6 +470,12 @@ int main( int argc, char *argv[] )
470
470
#endif
471
471
472
472
#ifdef Q_OS_WIN
473
+ if ( !QgsApplication::isRunningFromBuildDir () )
474
+ {
475
+ QString symbolPath ( getenv ( " QGIS_PREFIX_PATH" ) );
476
+ symbolPath = symbolPath + " \\ pdb;http://msdl.microsoft.com/download/symbols;http://download.osgeo.org/osgeo4w/symstore " ;
477
+ QgsStackTrace::setSymbolPath ( symbolPath );
478
+ }
473
479
SetUnhandledExceptionFilter ( QgsCrashHandler::handle );
474
480
#endif
475
481
Original file line number Diff line number Diff line change @@ -37,9 +37,19 @@ QVector<QgsStackTrace::StackLine> QgsStackTrace::trace( _EXCEPTION_POINTERS *Exc
37
37
#endif
38
38
39
39
HANDLE process = GetCurrentProcess ();
40
- // TOOD Pull symbols from symbol server.
41
40
SymSetOptions ( SYMOPT_DEFERRED_LOADS | SYMOPT_INCLUDE_32BIT_MODULES | SYMOPT_UNDNAME );
42
- SymInitialize ( process, NULL , TRUE );
41
+
42
+ PCSTR paths;
43
+ if ( QgsStackTrace::mSymbolPaths .isEmpty () )
44
+ {
45
+ paths = NULL ;
46
+ }
47
+ else
48
+ {
49
+ paths = QgsStackTrace::mSymbolPaths .toStdString ().c_str ();
50
+ }
51
+
52
+ BOOL success = SymInitialize ( process, paths, TRUE );
43
53
44
54
// StackWalk64() may modify context record passed to it, so we will
45
55
// use a copy.
@@ -121,10 +131,19 @@ QVector<QgsStackTrace::StackLine> QgsStackTrace::trace( _EXCEPTION_POINTERS *Exc
121
131
qgsFree ( symbol );
122
132
qgsFree ( line );
123
133
qgsFree ( module );
134
+ SymCleanup ( process );
124
135
return stack;
125
136
126
137
}
127
- #endif
138
+
139
+ QString QgsStackTrace::mSymbolPaths ;
140
+
141
+ void QgsStackTrace::setSymbolPath ( QString symbolPaths )
142
+ {
143
+ mSymbolPaths = symbolPaths;
144
+ }
145
+
146
+ #endif // Q_OS_WIN
128
147
129
148
#ifdef Q_OS_LINUX
130
149
QVector<QgsStackTrace::StackLine> QgsStackTrace::trace ( unsigned int maxFrames )
Original file line number Diff line number Diff line change @@ -67,6 +67,12 @@ class CORE_EXPORT QgsStackTrace
67
67
* \note Added in QGIS 3.0
68
68
*/
69
69
static QVector<QgsStackTrace::StackLine> trace ( struct _EXCEPTION_POINTERS *ExceptionInfo );
70
+
71
+ /* *
72
+ * Set the paths to load the PDB symbols from on Windows.
73
+ * @param paths The path, or series of paths separated by a semicolon (;), that is used to search for symbol files.
74
+ */
75
+ static void setSymbolPath ( QString searchPath );
70
76
#endif
71
77
72
78
#ifdef Q_OS_LINUX
@@ -81,6 +87,7 @@ class CORE_EXPORT QgsStackTrace
81
87
82
88
private:
83
89
QgsStackTrace ();
90
+ static QString mSymbolPaths ;
84
91
85
92
};
86
93
You can’t perform that action at this time.
0 commit comments