Skip to content

Commit b7a8955

Browse files
committed
Adds more fixes to follow coding convention
1 parent 8380d87 commit b7a8955

File tree

1 file changed

+7
-36
lines changed

1 file changed

+7
-36
lines changed

src/xrCore/xrDebug.cpp

Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,8 @@ void xrDebug::SetBugReportFile(const char* fileName) { strcpy_s(BugReportFile, f
8282

8383
bool xrDebug::GetNextStackFrameString(LPSTACKFRAME stackFrame, PCONTEXT threadCtx, xr_string& frameStr)
8484
{
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);
9687

9788
if (result == FALSE || stackFrame->AddrPC.Offset == 0)
9889
{
@@ -127,12 +118,7 @@ bool xrDebug::GetNextStackFrameString(LPSTACKFRAME stackFrame, PCONTEXT threadCt
127118
functionInfo->MaxNameLength = sizeof(arrSymBuffer) - sizeof(*functionInfo) + 1;
128119
DWORD_PTR dwFunctionOffset;
129120

130-
result = SymGetSymFromAddr(
131-
GetCurrentProcess(),
132-
stackFrame->AddrPC.Offset,
133-
&dwFunctionOffset,
134-
functionInfo
135-
);
121+
result = SymGetSymFromAddr(GetCurrentProcess(), stackFrame->AddrPC.Offset, &dwFunctionOffset, functionInfo);
136122

137123
if (result)
138124
{
@@ -154,25 +140,14 @@ bool xrDebug::GetNextStackFrameString(LPSTACKFRAME stackFrame, PCONTEXT threadCt
154140
IMAGEHLP_LINE sourceInfo = { 0 };
155141
sourceInfo.SizeOfStruct = sizeof(sourceInfo);
156142

157-
result = SymGetLineFromAddr(
158-
GetCurrentProcess(),
159-
stackFrame->AddrPC.Offset,
160-
&dwLineOffset,
161-
&sourceInfo
162-
);
143+
result = SymGetLineFromAddr(GetCurrentProcess(), stackFrame->AddrPC.Offset, &dwLineOffset, &sourceInfo);
163144

164145
if (result)
165146
{
166147
if (dwLineOffset)
167148
{
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);
176151
}
177152
else
178153
{
@@ -242,11 +217,7 @@ xr_vector<xr_string> xrDebug::BuildStackTrace(PCONTEXT threadCtx, u16 maxFramesC
242217
# error CPU architecture is not supported.
243218
#endif
244219

245-
while (
246-
GetNextStackFrameString(&stackFrame, threadCtx, frameStr)
247-
&&
248-
traceResult.size() <= maxFramesCount
249-
)
220+
while (GetNextStackFrameString(&stackFrame, threadCtx, frameStr) && traceResult.size() <= maxFramesCount)
250221
{
251222
traceResult.push_back(frameStr);
252223
}

0 commit comments

Comments
 (0)