MCPcopy Create free account
hub / github.com/bwapi/bwapi / saveDebug

Method saveDebug

bwapi/BWScriptEmulator/ScriptThread.cpp:232–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232void aithread::saveDebug(const char prefix, int iOpcode, const char *pszFormat, ...)
233{
234 if ( retryBlock )
235 return;
236
237 char szFinalBuffer[512];
238 char szBuffer[256];
239
240 szFinalBuffer[0] = 0;
241 szBuffer[0] = 0;
242
243 if ( pszFormat )
244 {
245 va_list ap;
246 va_start(ap, pszFormat);
247 vsnprintf_s(szBuffer, 256, 256, pszFormat, ap);
248 va_end(ap);
249 }
250 sprintf_s(szFinalBuffer, 512, "%c%s %s", prefix, AISCRIPT::getOpcodeName(iOpcode), szBuffer);
251
252 char *tmp = (char*)malloc(strlen(szFinalBuffer)+1);
253 strcpy_s(tmp, strlen(szFinalBuffer)+1, szFinalBuffer);
254
255 if ( this->debugQueue.size() > 32 )
256 {
257 char *front = this->debugQueue.front();
258 free(front);
259 this->debugQueue.pop_front();
260 }
261 this->debugQueue.push_back(tmp);
262}
263bool aithread::retry()
264{
265 this->dwScriptOffset -= this->dwBytesRead;

Callers 15

executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80

Calls 2

getOpcodeNameFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected