@@ -82,17 +82,8 @@ void xrDebug::SetBugReportFile(const char* fileName) { strcpy_s(BugReportFile, f
82
82
83
83
bool xrDebug::GetNextStackFrameString (LPSTACKFRAME stackFrame, PCONTEXT threadCtx, xr_string& frameStr)
84
84
{
85
- BOOL result = StackWalk (
86
- MACHINE_TYPE,
87
- GetCurrentProcess (),
88
- GetCurrentThread (),
89
- stackFrame,
90
- threadCtx,
91
- nullptr ,
92
- SymFunctionTableAccess,
93
- SymGetModuleBase,
94
- nullptr
95
- );
85
+ BOOL result = StackWalk (MACHINE_TYPE, GetCurrentProcess (), GetCurrentThread (), stackFrame, threadCtx, nullptr ,
86
+ SymFunctionTableAccess, SymGetModuleBase, nullptr );
96
87
97
88
if (result == FALSE || stackFrame->AddrPC .Offset == 0 )
98
89
{
@@ -127,12 +118,7 @@ bool xrDebug::GetNextStackFrameString(LPSTACKFRAME stackFrame, PCONTEXT threadCt
127
118
functionInfo->MaxNameLength = sizeof (arrSymBuffer) - sizeof (*functionInfo) + 1 ;
128
119
DWORD_PTR dwFunctionOffset;
129
120
130
- result = SymGetSymFromAddr (
131
- GetCurrentProcess (),
132
- stackFrame->AddrPC .Offset ,
133
- &dwFunctionOffset,
134
- functionInfo
135
- );
121
+ result = SymGetSymFromAddr (GetCurrentProcess (), stackFrame->AddrPC .Offset , &dwFunctionOffset, functionInfo);
136
122
137
123
if (result)
138
124
{
@@ -154,25 +140,14 @@ bool xrDebug::GetNextStackFrameString(LPSTACKFRAME stackFrame, PCONTEXT threadCt
154
140
IMAGEHLP_LINE sourceInfo = { 0 };
155
141
sourceInfo.SizeOfStruct = sizeof (sourceInfo);
156
142
157
- result = SymGetLineFromAddr (
158
- GetCurrentProcess (),
159
- stackFrame->AddrPC .Offset ,
160
- &dwLineOffset,
161
- &sourceInfo
162
- );
143
+ result = SymGetLineFromAddr (GetCurrentProcess (), stackFrame->AddrPC .Offset , &dwLineOffset, &sourceInfo);
163
144
164
145
if (result)
165
146
{
166
147
if (dwLineOffset)
167
148
{
168
- xr_sprintf (
169
- formatBuff,
170
- _countof (formatBuff),
171
- " in %s line %u + %u byte(s)" ,
172
- sourceInfo.FileName ,
173
- sourceInfo.LineNumber ,
174
- dwLineOffset
175
- );
149
+ xr_sprintf (formatBuff, _countof (formatBuff), " in %s line %u + %u byte(s)" , sourceInfo.FileName ,
150
+ sourceInfo.LineNumber , dwLineOffset);
176
151
}
177
152
else
178
153
{
@@ -242,11 +217,7 @@ xr_vector<xr_string> xrDebug::BuildStackTrace(PCONTEXT threadCtx, u16 maxFramesC
242
217
# error CPU architecture is not supported.
243
218
#endif
244
219
245
- while (
246
- GetNextStackFrameString (&stackFrame, threadCtx, frameStr)
247
- &&
248
- traceResult.size () <= maxFramesCount
249
- )
220
+ while (GetNextStackFrameString (&stackFrame, threadCtx, frameStr) && traceResult.size () <= maxFramesCount)
250
221
{
251
222
traceResult.push_back (frameStr);
252
223
}
0 commit comments