Closed spacehamster closed 4 years ago
A simple implementation of UnresolvedSymbolException
that I mentioned in my review comments could be:
public sealed class UnresolvedSymbolException : Exception
{
const string DefaultMessage = "Symbol has not been resolved.";
public string SymbolName { get; }
public UnresolvedSymbolException()
: base(DefaultMessage)
{
}
public UnresolvedSymbolException(string message, Exception inner)
: base(message, inner)
{
}
public UnresolvedSymbolException(string symbol)
: base(DefaultMessage)
{
SymbolName = symbol;
}
public UnresolvedSymbolException(string symbol, string message)
: base(message)
{
SymbolName = symbol;
}
public UnresolvedSymbolException(string symbol, string message, Exception inner)
: base(message, inner)
{
SymbolName = symbol;
}
public override string Message
{
get
{
var message = base.Message;
if (!string.IsNullOrEmpty(message) && !string.IsNullOrEmpty(SymbolName))
message += $" ({SymbolName})";
return message;
}
}
}
This doesn't seem to actually catch exceptions.
AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
I did a bit of reading to try and figure out why this happens, and it turns out that this doesn't work for exceptions thrown in unmanaged threads, so we need to wrap AfterEverythingLoaded
's call to Dump
in a try
/catch
and handle any exceptions manually.
Looks good, merging now. Thanks for the changes!
Adds struct export support for unity versions 2017.1 to 2020.2. Some notes:
This doesn't seem to actually catch exceptions. https://github.com/DaZombieKiller/TypeTreeDumper/blob/627380d48855bd0827206711f97c9512675a85ad/TypeTreeDumper.Client/EntryPoint.cs#L40
Create nodes cannot be called until after getTypeTree/generateTypeTree is called. I put those in a factory because it felt a bit redundant repeating it for each type tree version, but its a bit awkward, so perhaps they should be moved to the type tree constructor. https://github.com/DaZombieKiller/TypeTreeDumper/blob/627380d48855bd0827206711f97c9512675a85ad/Unity/TypeTree.V1.cs#L26
After changing GetTypeTree's return type to bool from WinBool, it sometimes returns false but still gives what seems to be a valid type tree.
Export stalls when running on unity 5.6.7.