Add a C++ demangler (#119)

* Add a C++ demangler for PrintStackTrace

This is a simple C++ demangler (only supporting name demangling) that will
probably be enough for any stacktrace cases.

* Create Ryujinx.Core.OsHle.Diagnostics.Demangler and move DemangleName

* Rename Demangler -> Demangle + Fix coding style

* Starting a real parsing for demangler (still simple and no compression support yet)

* Partially implement decompression

* Improve compression support (still need to fix errored compression indexing)

* Some cleanup

* Fix Demangle.Parse call in PrintStackTrace

* Trim parameters result to get more clear prototypes

* Rename Demangle -> Demangler and fix access level

* Fix substitution possible issues also improve code readability

* Redo compression indexing to be more accurate

* Add support of not nested function name
This commit is contained in:
Thomas Guillemard 2018-05-22 22:40:02 +02:00 committed by gdkchan
parent 7ac5f40532
commit fa4b34bd19
2 changed files with 423 additions and 0 deletions

View file

@ -5,6 +5,7 @@ using ChocolArm64.State;
using Ryujinx.Core.Loaders;
using Ryujinx.Core.Loaders.Executables;
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Diagnostics;
using Ryujinx.Core.OsHle.Exceptions;
using Ryujinx.Core.OsHle.Handles;
using Ryujinx.Core.OsHle.Kernel;
@ -306,6 +307,10 @@ namespace Ryujinx.Core.OsHle
{
SubName = $"Sub{Position:x16}";
}
else if (SubName.StartsWith("_Z"))
{
SubName = Demangler.Parse(SubName);
}
Trace.AppendLine(" " + SubName + " (" + GetNsoNameAndAddress(Position) + ")");
}