2019-12-26 15:32:37 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3209340 on 2016/11/23 by Ben.Marsh
Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h.
Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms.
* Every header now includes everything it needs to compile.
* There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first.
* There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h.
* Every .cpp file includes its matching .h file first.
* This helps validate that each header is including everything it needs to compile.
* No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more.
* You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there.
* There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible.
* No engine code explicitly includes a precompiled header any more.
* We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies.
* PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files.
Tool used to generate this transform is at Engine\Source\Programs\IncludeTool.
[CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
|
|
|
#include "CrashDebugHelper.h"
|
|
|
|
|
#include "HAL/FileManager.h"
|
|
|
|
|
#include "Misc/Parse.h"
|
|
|
|
|
#include "Misc/CommandLine.h"
|
|
|
|
|
#include "Misc/FileHelper.h"
|
|
|
|
|
#include "Misc/Paths.h"
|
|
|
|
|
#include "Stats/StatsMisc.h"
|
|
|
|
|
#include "Misc/ConfigCacheIni.h"
|
|
|
|
|
#include "Misc/App.h"
|
|
|
|
|
#include "CrashDebugHelperPrivate.h"
|
|
|
|
|
#include "Misc/EngineVersion.h"
|
Copying //UE4/Dev-Core to //UE4/Main
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2783106 on 2015/11/30 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2
Introduced GC UObject clusters. GC clusters provide means to create disregard for GC subsets at load time (e.g. Materials with material expressions and their textures).
- Saves about 25ms in reachability analysis (58ms -> 33ms)
- UObject classes/instances can now be marked as cluster root objects with CanBeClusterRoot() function override.
- Cluster creation is automatic. Clusters don't require any manual handling for GC to collect them when nothing is referencing them.
- Moved token stream processing to a new class FFastReferenceFinder to make it more generic and re-usable by other code
- Removed REFERENCE_INFO macro from GC code and replaced it with a local variable (saves about ~1.9ms: 33.2ms -> 31.3ms)
Change 2773094 on 2015/11/19 by Steve.Robb@Dev-Core
Multicast script delegate check for existing bindings replaced with ensure.
Multicast native delegate no longer checks for existing bindings.
Removal of old delegate code.
Some FORCEINLINEing to improve debugging experience of stepping into delegate code.
Change 2782180 on 2015/11/27 by Graeme.Thornton@GThornton_DesktopMaster
Make scoped seconds timer class available outside of stats build. Normal usage macros still remain guarded
Added SCOPE_SECONDS_COUNTER_RECURSION_SAFE which only times during the outmost instance of a recursive function
Added SCOPE_SECONDS_COUNTER_RECURSION_SAFE_BASE and SCOPE_SECONDS_COUNTER_BASE which are defined in all build types, for easy temporary timing in Test/Shipping builds.
Added a boolean parameter to the timer class which can be used to disable it without having to mess around with scoping the calling code
Change 2782635 on 2015/11/30 by Graeme.Thornton@GThornton_DesktopMaster
Added GetTimeStampPair() to the filemanager and platformfile interfaces. Requests timestamps for a pair of files where we assume that both files would always exist at the same wrapper level. Allows us to skip file system queries for localization package lookups where the native file is in a pak but the localized file doesn't exist.
Change 2775153 on 2015/11/20 by Jaroslaw.Surowiec@Stream.1.JarekSurowiec
CrashReportServer moved out of the not for licencees, a few fixes, removed RegisterPII
Change 2775560 on 2015/11/20 by Steve.Robb@Dev-Core
FDelegateBase::GetDelegateInstance deprecated and replaced with FDelegateBase::GetDelegateInstanceProtected.
Change 2781138 on 2015/11/25 by Jaroslaw.Surowiec@Stream.1.JarekSurowiec
Stats - Converted is using a new stats reader, a few more optimizations, should be 10x times faster
Change 2772990 on 2015/11/19 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2
Fixing potential dead lock when suspending and resuming async loading multiple times
Change 2773023 on 2015/11/19 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2
Support for references added through AddReferencedObjects in FArchiveReplaceObjectRef
Change 2781055 on 2015/11/25 by Steve.Robb@Dev-Core
Changes to IDelegateInstance reverted to allow licensees an easier time when upgrading their use of the now-deprecated GetDelegateInstance() code path.
New TryGetBoundFunctionName() to aid the debugging of delegate bindings in non-shipping configs.
Change 2773114 on 2015/11/19 by Steve.Robb@Dev-Core
FMath::IsPowerOfTwo is now templated to take any type.
Change 2773643 on 2015/11/19 by Steve.Robb@Dev-Core
GetDelegateInstance() calls replaced - delegate instances never compare equal unless you are comparing two unbound delegates (both null) or comparing a delegate with itself.
Change 2777686 on 2015/11/23 by Steve.Robb@Dev-Core
GitHub #1793 - File write flags argument
Change 2780590 on 2015/11/25 by Steve.Robb@Dev-Core
Fix for FArchiveProxy::operator<< overloads.
Change 2780845 on 2015/11/25 by Jaroslaw.Surowiec@Stream.1.JarekSurowiec
#jira UE-23358 - MDD relies on hard-coded P4 depot paths (fixed source context for streams)
Change 2780962 on 2015/11/25 by Jaroslaw.Surowiec@Stream.1.JarekSurowiec
Stats - Added FStatsWriteStream for basic saving stat messages into a stream, initial support for reading a regular stats file, minor performance optimization, coding standard fixes
#jira UECORE-170 - Improve profiler loading performance (wip)
Change 2781887 on 2015/11/26 by Jaroslaw.Surowiec@Stream.1.JarekSurowiec
Profiler/ProfilerClient - Removed unneeded synchronization points, replaces with task graph SendTo jobs, removed PROFILER_THREADED_LOAD, replaced with new stats loading mechanism, should be around 2x times faster (4x since the optimization pass)
#jira UECORE-170 - Improve profiler loading performance (wip)
Change 2781893 on 2015/11/26 by Steve.Robb@Dev-Core
TCachedOSPageAllocator abstracted from MallocBinned2.
Misc tidy-ups.
Change 2782198 on 2015/11/27 by Jaroslaw.Surowiec@Stream.1.JarekSurowiec
Profiler - Better indication of the loading progress, should no longer freeze without a progress bar
#jira UECORE-170 - Improve profiler loading performance (wip)
Change 2782446 on 2015/11/29 by Steve.Robb@Dev-Core
Warn when calling delegates' Create* functions when they're not assigned to anything.
#codereview robert.manuszewski
Change 2782538 on 2015/11/30 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1
#UE4 Removed DiskCachedAssetDataBuffer as it was not strictly necessary and was triggering a crash when loading the cached registry from disk. This data is now stored directly in DiskCachedAssetDataMap. It was already true that this map does not change outside of SerializeCache but now it is critical since NewCachedAssetDataMap keeps pointers directly to its values.
Asset registry fixes by Bob Tellez. Possible fix for UE-23783.
Change 2782564 on 2015/11/30 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1
FReferenceCollector::AddReferenceObjects performance improvements for TArrays. ARO will no longer call HandleObjectReference multiple times but instead will call HandleObjectReferences just once (currently only implemented for FGCCollector). Reduces the number of virtual function calls while GC'ing.
Change 2782716 on 2015/11/30 by Steve.Robb@Dev-Core
UObject serial number array initialized for debug visualization.
Change 2782933 on 2015/11/30 by Steve.Robb@Dev-Core
Critical sections are no longer copyable.
Change 2783061 on 2015/11/30 by Steve.Robb@Dev-Core
2015-12-03 14:21:29 -05:00
|
|
|
|
|
|
|
|
/*-----------------------------------------------------------------------------
|
|
|
|
|
ICrashDebugHelper
|
|
|
|
|
-----------------------------------------------------------------------------*/
|
2014-07-14 06:53:12 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
bool ICrashDebugHelper::Init()
|
|
|
|
|
{
|
|
|
|
|
bInitialized = true;
|
|
|
|
|
|
2015-03-02 07:52:38 -05:00
|
|
|
// Check if we have a valid EngineVersion, if so use it.
|
|
|
|
|
FString CmdEngineVersion;
|
|
|
|
|
const bool bHasEngineVersion = FParse::Value( FCommandLine::Get(), TEXT( "EngineVersion=" ), CmdEngineVersion );
|
|
|
|
|
if( bHasEngineVersion )
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2015-03-02 07:52:38 -05:00
|
|
|
FEngineVersion EngineVersion;
|
|
|
|
|
FEngineVersion::Parse( CmdEngineVersion, EngineVersion );
|
|
|
|
|
|
|
|
|
|
// Clean branch name.
|
|
|
|
|
CrashInfo.DepotName = EngineVersion.GetBranch();
|
|
|
|
|
CrashInfo.BuiltFromCL = (int32)EngineVersion.GetChangelist();
|
|
|
|
|
|
|
|
|
|
CrashInfo.EngineVersion = CmdEngineVersion;
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-12-07 15:08:59 -05:00
|
|
|
// Use the current values.
|
|
|
|
|
const FEngineVersion& EngineVersion = FEngineVersion::Current();
|
|
|
|
|
CrashInfo.DepotName = EngineVersion.GetBranch();
|
|
|
|
|
CrashInfo.BuiltFromCL = (int32)EngineVersion.GetChangelist();
|
|
|
|
|
CrashInfo.EngineVersion = EngineVersion.ToString();
|
2015-03-02 07:52:38 -05:00
|
|
|
}
|
2015-05-12 09:31:16 -04:00
|
|
|
|
2016-07-28 09:52:56 -04:00
|
|
|
// Check if we have a valid BuildVersion, if so use it.
|
|
|
|
|
FString CmdBuildVersion;
|
|
|
|
|
const bool bHasBuildVersion = FParse::Value(FCommandLine::Get(), TEXT("BuildVersion="), CmdBuildVersion);
|
|
|
|
|
if (bHasBuildVersion)
|
|
|
|
|
{
|
|
|
|
|
CrashInfo.BuildVersion = CmdBuildVersion;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
CrashInfo.BuildVersion = FApp::GetBuildVersion();
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-02 17:19:00 -05:00
|
|
|
FString PlatformName;
|
|
|
|
|
const bool bHasPlatformName = FParse::Value(FCommandLine::Get(), TEXT("PlatformName="), PlatformName);
|
|
|
|
|
if (bHasPlatformName)
|
|
|
|
|
{
|
|
|
|
|
CrashInfo.PlatformName = PlatformName;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Use the current values.
|
|
|
|
|
CrashInfo.PlatformName = FPlatformProperties::PlatformName();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FString PlatformVariantName;
|
|
|
|
|
const bool bHasPlatformVariantName = FParse::Value(FCommandLine::Get(), TEXT("PlatformVariantName="), PlatformVariantName);
|
|
|
|
|
if (bHasPlatformVariantName)
|
|
|
|
|
{
|
|
|
|
|
CrashInfo.PlatformVariantName = PlatformVariantName;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Use the basic platform name.
|
|
|
|
|
CrashInfo.PlatformVariantName = CrashInfo.PlatformName;
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-12 09:31:16 -04:00
|
|
|
UE_LOG( LogCrashDebugHelper, Log, TEXT( "DepotName: %s" ), *CrashInfo.DepotName );
|
|
|
|
|
UE_LOG( LogCrashDebugHelper, Log, TEXT( "BuiltFromCL: %i" ), CrashInfo.BuiltFromCL );
|
|
|
|
|
UE_LOG( LogCrashDebugHelper, Log, TEXT( "EngineVersion: %s" ), *CrashInfo.EngineVersion );
|
2016-07-28 09:52:56 -04:00
|
|
|
UE_LOG( LogCrashDebugHelper, Log, TEXT( "BuildVersion: %s" ), *CrashInfo.BuildVersion );
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
return bInitialized;
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-07 06:46:11 -05:00
|
|
|
bool ICrashDebugHelper::ReadSourceFile( TArray<FString>& OutStrings )
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2019-11-25 12:03:09 -05:00
|
|
|
const FString FilePath = FPaths::RootDir() / CrashInfo.SourceFile;
|
2015-03-07 06:46:11 -05:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
FString Line;
|
2015-05-20 11:21:58 -04:00
|
|
|
if (FFileHelper::LoadFileToString( Line, *FilePath ))
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
Line = Line.Replace( TEXT( "\r" ), TEXT( "" ) );
|
2015-03-02 15:51:37 -05:00
|
|
|
Line.ParseIntoArray( OutStrings, TEXT( "\n" ), false );
|
2015-05-20 11:21:58 -04:00
|
|
|
UE_LOG( LogCrashDebugHelper, Log, TEXT( "Reading a single source file: %s" ), *FilePath );
|
2014-03-14 14:13:41 -04:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-03-07 06:46:11 -05:00
|
|
|
UE_LOG( LogCrashDebugHelper, Warning, TEXT( "Failed to open source file: %s" ), *FilePath );
|
2014-03-14 14:13:41 -04:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-14 06:53:12 -04:00
|
|
|
void ICrashDebugHelper::AddSourceToReport()
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-07-14 06:53:12 -04:00
|
|
|
if( CrashInfo.SourceFile.Len() > 0 && CrashInfo.SourceLineNumber != 0 )
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
TArray<FString> Lines;
|
2015-03-07 06:46:11 -05:00
|
|
|
ReadSourceFile( Lines );
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2015-03-02 07:52:38 -05:00
|
|
|
const uint32 MinLine = FMath::Clamp( CrashInfo.SourceLineNumber - 15, (uint32)1, (uint32)Lines.Num() );
|
|
|
|
|
const uint32 MaxLine = FMath::Clamp( CrashInfo.SourceLineNumber + 15, (uint32)1, (uint32)Lines.Num() );
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2015-03-02 07:52:38 -05:00
|
|
|
for( uint32 Line = MinLine; Line < MaxLine; Line++ )
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-07-14 06:53:12 -04:00
|
|
|
if( Line == CrashInfo.SourceLineNumber - 1 )
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2015-03-07 06:46:11 -05:00
|
|
|
CrashInfo.SourceContext.Add( FString::Printf( TEXT( "%5u ***** %s" ), Line, *Lines[Line] ) );
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-03-07 06:46:11 -05:00
|
|
|
CrashInfo.SourceContext.Add( FString::Printf( TEXT( "%5u %s" ), Line, *Lines[Line] ) );
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FCrashInfo::Log( FString Line )
|
|
|
|
|
{
|
|
|
|
|
UE_LOG( LogCrashDebugHelper, Warning, TEXT("%s"), *Line );
|
|
|
|
|
Report += Line + LINE_TERMINATOR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const TCHAR* FCrashInfo::GetProcessorArchitecture( EProcessorArchitecture PA )
|
|
|
|
|
{
|
|
|
|
|
switch( PA )
|
|
|
|
|
{
|
|
|
|
|
case PA_X86:
|
|
|
|
|
return TEXT( "x86" );
|
|
|
|
|
case PA_X64:
|
|
|
|
|
return TEXT( "x64" );
|
|
|
|
|
case PA_ARM:
|
|
|
|
|
return TEXT( "ARM" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return TEXT( "Unknown" );
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-25 12:03:09 -05:00
|
|
|
void FCrashInfo::WriteLine( FArchive* ReportFile, const TCHAR* Line )
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2019-11-25 12:03:09 -05:00
|
|
|
if (Line)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2019-11-25 12:03:09 -05:00
|
|
|
FTCHARToUTF8 UTF8Line(Line);
|
|
|
|
|
ReportFile->Serialize((void*)UTF8Line.Get(), UTF8Line.Length());
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
2019-11-25 12:03:09 -05:00
|
|
|
ReportFile->Serialize(TCHAR_TO_UTF8(LINE_TERMINATOR), FCStringWide::Strlen(LINE_TERMINATOR));
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2019-11-25 12:03:09 -05:00
|
|
|
void FCrashInfo::WriteLine(FArchive* ReportFile, const FString& Line)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2019-11-25 12:03:09 -05:00
|
|
|
FTCHARToUTF8 UTF8Line(*Line, Line.Len());
|
|
|
|
|
ReportFile->Serialize((void*)UTF8Line.Get(), UTF8Line.Length());
|
|
|
|
|
ReportFile->Serialize(TCHAR_TO_UTF8(LINE_TERMINATOR), FCStringWide::Strlen(LINE_TERMINATOR));
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FCrashInfo::GenerateReport( const FString& DiagnosticsPath )
|
|
|
|
|
{
|
|
|
|
|
FArchive* ReportFile = IFileManager::Get().CreateFileWriter( *DiagnosticsPath );
|
|
|
|
|
if( ReportFile != NULL )
|
|
|
|
|
{
|
|
|
|
|
FString Line;
|
|
|
|
|
|
2019-11-25 12:03:09 -05:00
|
|
|
WriteLine( ReportFile, TEXT( "Generating report for minidump" ) );
|
2014-03-14 14:13:41 -04:00
|
|
|
WriteLine( ReportFile );
|
|
|
|
|
|
2015-03-02 07:52:38 -05:00
|
|
|
if ( EngineVersion.Len() > 0 )
|
2014-09-08 09:01:00 -04:00
|
|
|
{
|
2015-03-02 07:52:38 -05:00
|
|
|
Line = FString::Printf( TEXT( "Application version %s" ), *EngineVersion );
|
2019-11-25 12:03:09 -05:00
|
|
|
WriteLine( ReportFile, Line );
|
2014-09-08 09:01:00 -04:00
|
|
|
}
|
|
|
|
|
else if( Modules.Num() > 0 )
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-07-14 06:53:12 -04:00
|
|
|
Line = FString::Printf( TEXT( "Application version %d.%d.%d" ), Modules[0].Major, Modules[0].Minor, Modules[0].Patch );
|
2019-11-25 12:03:09 -05:00
|
|
|
WriteLine( ReportFile, Line );
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2015-01-22 08:03:55 -05:00
|
|
|
Line = FString::Printf( TEXT( " ... built from changelist %d" ), BuiltFromCL );
|
2019-11-25 12:03:09 -05:00
|
|
|
WriteLine( ReportFile, Line );
|
2014-03-14 14:13:41 -04:00
|
|
|
if( LabelName.Len() > 0 )
|
|
|
|
|
{
|
|
|
|
|
Line = FString::Printf( TEXT( " ... based on label %s" ), *LabelName );
|
2019-11-25 12:03:09 -05:00
|
|
|
WriteLine( ReportFile, Line );
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
WriteLine( ReportFile );
|
|
|
|
|
|
|
|
|
|
Line = FString::Printf( TEXT( "OS version %d.%d.%d.%d" ), SystemInfo.OSMajor, SystemInfo.OSMinor, SystemInfo.OSBuild, SystemInfo.OSRevision );
|
2019-11-25 12:03:09 -05:00
|
|
|
WriteLine( ReportFile, Line );
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
Line = FString::Printf( TEXT( "Running %d %s processors" ), SystemInfo.ProcessorCount, GetProcessorArchitecture( SystemInfo.ProcessorArchitecture ) );
|
2019-11-25 12:03:09 -05:00
|
|
|
WriteLine( ReportFile, Line );
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
Line = FString::Printf( TEXT( "Exception was \"%s\"" ), *Exception.ExceptionString );
|
2019-11-25 12:03:09 -05:00
|
|
|
WriteLine( ReportFile, Line );
|
2014-03-14 14:13:41 -04:00
|
|
|
WriteLine( ReportFile );
|
|
|
|
|
|
|
|
|
|
Line = FString::Printf( TEXT( "Source context from \"%s\"" ), *SourceFile );
|
2019-11-25 12:03:09 -05:00
|
|
|
WriteLine( ReportFile, Line );
|
2014-03-14 14:13:41 -04:00
|
|
|
WriteLine( ReportFile );
|
|
|
|
|
|
|
|
|
|
Line = FString::Printf( TEXT( "<SOURCE START>" ) );
|
2019-11-25 12:03:09 -05:00
|
|
|
WriteLine( ReportFile, Line );
|
2014-03-14 14:13:41 -04:00
|
|
|
for( int32 LineIndex = 0; LineIndex < SourceContext.Num(); LineIndex++ )
|
|
|
|
|
{
|
|
|
|
|
Line = FString::Printf( TEXT( "%s" ), *SourceContext[LineIndex] );
|
2019-11-25 12:03:09 -05:00
|
|
|
WriteLine( ReportFile, Line );
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
Line = FString::Printf( TEXT( "<SOURCE END>" ) );
|
2019-11-25 12:03:09 -05:00
|
|
|
WriteLine( ReportFile, Line );
|
2014-03-14 14:13:41 -04:00
|
|
|
WriteLine( ReportFile );
|
|
|
|
|
|
|
|
|
|
Line = FString::Printf( TEXT( "<CALLSTACK START>" ) );
|
2019-11-25 12:03:09 -05:00
|
|
|
WriteLine( ReportFile, Line );
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
for( int32 StackIndex = 0; StackIndex < Exception.CallStackString.Num(); StackIndex++ )
|
|
|
|
|
{
|
|
|
|
|
Line = FString::Printf( TEXT( "%s" ), *Exception.CallStackString[StackIndex] );
|
2019-11-25 12:03:09 -05:00
|
|
|
WriteLine( ReportFile, Line );
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Line = FString::Printf( TEXT( "<CALLSTACK END>" ) );
|
2019-11-25 12:03:09 -05:00
|
|
|
WriteLine( ReportFile, Line );
|
2014-03-14 14:13:41 -04:00
|
|
|
WriteLine( ReportFile );
|
|
|
|
|
|
|
|
|
|
Line = FString::Printf( TEXT( "%d loaded modules" ), Modules.Num() );
|
2019-11-25 12:03:09 -05:00
|
|
|
WriteLine( ReportFile, Line );
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
for( int32 ModuleIndex = 0; ModuleIndex < Modules.Num(); ModuleIndex++ )
|
|
|
|
|
{
|
|
|
|
|
FCrashModuleInfo& Module = Modules[ModuleIndex];
|
|
|
|
|
|
|
|
|
|
FString ModuleDirectory = FPaths::GetPath(Module.Name);
|
|
|
|
|
FString ModuleName = FPaths::GetBaseFilename( Module.Name, true ) + FPaths::GetExtension( Module.Name, true );
|
|
|
|
|
|
|
|
|
|
FString ModuleDetail = FString::Printf( TEXT( "%40s" ), *ModuleName );
|
2014-07-14 06:53:12 -04:00
|
|
|
FString Version = FString::Printf( TEXT( " (%d.%d.%d.%d)" ), Module.Major, Module.Minor, Module.Patch, Module.Revision );
|
2014-03-14 14:13:41 -04:00
|
|
|
ModuleDetail += FString::Printf( TEXT( " %22s" ), *Version );
|
|
|
|
|
ModuleDetail += FString::Printf( TEXT( " 0x%016x 0x%08x" ), Module.BaseOfImage, Module.SizeOfImage );
|
|
|
|
|
ModuleDetail += FString::Printf( TEXT( " %s" ), *ModuleDirectory );
|
|
|
|
|
|
2019-11-25 12:03:09 -05:00
|
|
|
WriteLine( ReportFile, ModuleDetail );
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WriteLine( ReportFile );
|
|
|
|
|
|
|
|
|
|
// Write out the processor debugging log
|
2019-11-25 12:03:09 -05:00
|
|
|
WriteLine( ReportFile, Report );
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
Line = FString::Printf( TEXT( "Report end!" ) );
|
2019-11-25 12:03:09 -05:00
|
|
|
WriteLine( ReportFile, Line );
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
ReportFile->Close();
|
|
|
|
|
delete ReportFile;
|
|
|
|
|
}
|
|
|
|
|
}
|