Allow stopping run trace when not debugging (#2326)
This commit is contained in:
		
							parent
							
								
									5507b46dc4
								
							
						
					
					
						commit
						6043dcf5a6
					
				|  | @ -486,12 +486,12 @@ void TraceRecordManager::increaseInstructionCounter() | ||||||
| 
 | 
 | ||||||
| bool TraceRecordManager::enableRunTrace(bool enabled, const char* fileName) | bool TraceRecordManager::enableRunTrace(bool enabled, const char* fileName) | ||||||
| { | { | ||||||
|     if(!DbgIsDebugging()) |  | ||||||
|         return false; |  | ||||||
|     if(enabled) |     if(enabled) | ||||||
|     { |     { | ||||||
|         if(rtEnabled) |         if(rtEnabled) | ||||||
|             enableRunTrace(false, NULL); //re-enable run trace
 |             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); |         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) |         if(rtFile != INVALID_HANDLE_VALUE) | ||||||
|         { |         { | ||||||
|  | @ -768,4 +768,4 @@ bool _dbg_dbgenableRunTrace(bool enabled, const char* fileName) | ||||||
| bool _dbg_dbgisRunTraceEnabled() | bool _dbg_dbgisRunTraceEnabled() | ||||||
| { | { | ||||||
|     return TraceRecord.isRunTraceEnabled(); |     return TraceRecord.isRunTraceEnabled(); | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue