Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: be551e1d21be
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 83feba995997
Choose a head ref
  • 5 commits
  • 2 files changed
  • 2 contributors

Commits on May 12, 2019

  1. dbghelp

    eggrobin committed May 12, 2019
    Copy the full SHA
    6e7c973 View commit details
  2. Copy the full SHA
    623bada View commit details
  3. what was that about

    eggrobin committed May 12, 2019
    Copy the full SHA
    6a7419e View commit details
  4. what year is this

    eggrobin committed May 12, 2019
    Copy the full SHA
    b18f267 View commit details
  5. Merge pull request #2167 from eggrobin/improve-the-stacktrace-decoder

    Improve the stacktrace decoder
    pleroy authored May 12, 2019
    Copy the full SHA
    83feba9 View commit details
Showing with 35 additions and 6 deletions.
  1. +27 −6 stacktrace_decoder/stacktrace_decoder.cs
  2. +8 −0 stacktrace_decoder/stacktrace_decoder.csproj
33 changes: 27 additions & 6 deletions stacktrace_decoder/stacktrace_decoder.cs
Original file line number Diff line number Diff line change
@@ -56,9 +56,10 @@ private static string ParseLine(IntPtr handle, IMAGEHLP_LINEW64 line,
start_line_number = line.LineNumber;
}

string url = $@"https://github.com/mockingbirdnest/Principia/blob/{
commit}/{file}#{(start_line_number.HasValue ? $"L{start_line_number}-"
: "")}L{line_number}";
string url = System.Uri.EscapeUriString(
$@"https://github.com/mockingbirdnest/Principia/blob/{commit}/{file}#{
(start_line_number.HasValue ? $"L{start_line_number}-"
: "")}L{line_number}");
// Snippets should not be separated by new lines, as they are on their own
// line anyway, so that a new line spaces them more than necessary. In
// order to keep the Markdown readable, hide a new line in a comment.
@@ -78,6 +79,13 @@ private static void Win32Check(bool success,
}
}

private static void Check(bool condition, string message) {
if (!condition) {
Console.WriteLine(message);
Environment.Exit(1);
}
}

private static string Comment(string comment) {
// Put the new line in the comment in order to avoid introducing
// new lines in the Markdown.
@@ -89,6 +97,14 @@ private static void Main(string[] args) {
Func<string, string> comment = Comment;
bool snippets = true;
string commit = null;

if (args.Length < 2) {
PrintUsage();
return;
}
string info_file_uri = args[0];
string principia_directory = args[1];

for (int i = 2; i < args.Length; ++i) {
string flag = args[i];
var match = Regex.Match(flag, "--unity-crash-at-commit=([0-9a-f]{40})");
@@ -105,21 +121,26 @@ private static void Main(string[] args) {
}
}

string info_file_uri = args[0];
string principia_directory = args[1];
var web_client = new WebClient();
var stream = new StreamReader(web_client.OpenRead(info_file_uri),
Encoding.UTF8);
if (!unity_crash) {
var version_regex = new Regex(
@"^I.*\] Principia version " +
@"([0-9]{10}-\w+)-[0-9]+-g([0-9a-f]{40}) built");
@"([0-9]{10}-\w+)-[0-9]+-g([0-9a-f]{40})(-dirty)? built");
Match version_match;
do {
Check(!stream.EndOfStream,
$"Could not find Principia version line in {info_file_uri}");
version_match = version_regex.Match(stream.ReadLine());
} while (!version_match.Success);
string tag = version_match.Groups[1].ToString();
commit = version_match.Groups[2].ToString();
bool dirty = version_match.Groups[3].Success;
if (dirty) {
Console.Write(comment(
$"Warning: version is dirty; line numbers may be incorrect."));
}
}
Int64 principia_base_address =
GetBaseAddress(unity_crash,
8 changes: 8 additions & 0 deletions stacktrace_decoder/stacktrace_decoder.csproj
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -31,6 +32,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@@ -49,6 +51,12 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Content Include="C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\dbghelp.dll">
<Link>dbghelp.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.