1
0
Fork 0

Allow stopping run trace when not debugging (#2326)

This commit is contained in:
Torusrxxx 2020-05-15 12:31:12 +00:00 committed by GitHub
parent 5507b46dc4
commit 6043dcf5a6
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -486,12 +486,12 @@ void TraceRecordManager::increaseInstructionCounter()
bool TraceRecordManager::enableRunTrace(bool enabled, const char* fileName)
{
if(!DbgIsDebugging())
return false;
if(enabled)
{
if(rtEnabled)
enableRunTrace(false, NULL); //re-enable run trace
if(!DbgIsDebugging())
return false;
rtFile = CreateFileW(StringUtils::Utf8ToUtf16(fileName).c_str(), FILE_APPEND_DATA, FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if(rtFile != INVALID_HANDLE_VALUE)
{
@ -768,4 +768,4 @@ bool _dbg_dbgenableRunTrace(bool enabled, const char* fileName)
bool _dbg_dbgisRunTraceEnabled()
{
return TraceRecord.isRunTraceEnabled();
}
}