You've already forked linux-packaging-mono
Imported Upstream version 6.12.0.86
Former-commit-id: 7a84ce7d08c42c458ac8e74b27186ca863315d79
This commit is contained in:
parent
92747312ea
commit
0b380204a4
@@ -27,6 +27,7 @@
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
@@ -255,6 +256,43 @@ namespace Mono {
|
||||
}
|
||||
}
|
||||
|
||||
static string get_breadcrumb_value (string file_prefix, string directory_str, bool clear)
|
||||
{
|
||||
var allfiles = Directory.GetFiles (directory_str, $"{file_prefix}_*" );
|
||||
if (allfiles.Length == 0)
|
||||
return string.Empty;
|
||||
|
||||
if (allfiles.Length > 1) {
|
||||
// it's impossible to tell which breadcrumb is the last one (let's not trust filesystem timestamps)
|
||||
// delete the multiple files so at least next crash can make sense
|
||||
try {
|
||||
Array.ForEach (allfiles, f => File.Delete (f) );
|
||||
} catch (Exception) { }
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
if (clear)
|
||||
File.Delete (allfiles [0]);
|
||||
|
||||
var filename = Path.GetFileName (allfiles [0]);
|
||||
return filename.Substring (file_prefix.Length + 1);
|
||||
}
|
||||
|
||||
static long CheckCrashReportHash (string directory_str, bool clear)
|
||||
{
|
||||
var value = get_breadcrumb_value ("crash_hash", directory_str, clear);
|
||||
if (value == string.Empty)
|
||||
return 0;
|
||||
else
|
||||
return Convert.ToInt64 (value, 16);
|
||||
}
|
||||
|
||||
static string CheckCrashReportReason (string directory_str, bool clear)
|
||||
{
|
||||
return get_breadcrumb_value ("crash_reason", directory_str, clear);
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
static extern void AnnotateMicrosoftTelemetry_internal (IntPtr key, IntPtr val);
|
||||
|
||||
|
Reference in New Issue
Block a user