From 5d08e9b495a2315e8a4758a8123466665085d044 Mon Sep 17 00:00:00 2001 From: Ac_K Date: Wed, 15 Sep 2021 01:24:49 +0200 Subject: hos: Cleanup the project (#2634) * hos: Cleanup the project Since a lot of changes has been done on the HOS project, there are some leftover here and there, or class just used in one service, things at wrong places, and more. This PR fixes that, additionnally to that, I've realigned some vars because I though it make the code more readable. * Address gdkchan feedback * addresses Thog feedback * Revert ElfSymbol --- .../Exceptions/ServiceNotImplementedException.cs | 32 ++++++++-------------- 1 file changed, 12 insertions(+), 20 deletions(-) (limited to 'Ryujinx.HLE/Exceptions/ServiceNotImplementedException.cs') diff --git a/Ryujinx.HLE/Exceptions/ServiceNotImplementedException.cs b/Ryujinx.HLE/Exceptions/ServiceNotImplementedException.cs index c9247cc1..3dbf48d8 100644 --- a/Ryujinx.HLE/Exceptions/ServiceNotImplementedException.cs +++ b/Ryujinx.HLE/Exceptions/ServiceNotImplementedException.cs @@ -19,37 +19,29 @@ namespace Ryujinx.HLE.Exceptions public IpcMessage Request { get; } public ServiceNotImplementedException(IpcService service, ServiceCtx context) - : this(service, context, "The service call is not implemented.") - { } + : this(service, context, "The service call is not implemented.") { } - public ServiceNotImplementedException(IpcService service, ServiceCtx context, string message) - : base(message) + public ServiceNotImplementedException(IpcService service, ServiceCtx context, string message) : base(message) { Service = service; Context = context; Request = context.Request; } - public ServiceNotImplementedException(IpcService service, ServiceCtx context, string message, Exception inner) - : base(message, inner) + public ServiceNotImplementedException(IpcService service, ServiceCtx context, string message, Exception inner) : base(message, inner) { Service = service; Context = context; Request = context.Request; } - protected ServiceNotImplementedException(SerializationInfo info, StreamingContext context) - : base(info, context) - { } + protected ServiceNotImplementedException(SerializationInfo info, StreamingContext context) : base(info, context) { } public override string Message { get { - return base.Message + - Environment.NewLine + - Environment.NewLine + - BuildMessage(); + return base.Message + Environment.NewLine + Environment.NewLine + BuildMessage(); } } @@ -63,8 +55,7 @@ namespace Ryujinx.HLE.Exceptions if (callingType != null && callingMethod != null) { // If the type is past 0xF, we are using TIPC - var ipcCommands = Request.Type > IpcMessageType.TipcCloseSession ? - Service.TipcCommands : Service.HipcCommands; + var ipcCommands = Request.Type > IpcMessageType.TipcCloseSession ? Service.TipcCommands : Service.HipcCommands; // Find the handler for the method called var ipcHandler = ipcCommands.FirstOrDefault(x => x.Value == callingMethod); @@ -82,9 +73,9 @@ namespace Ryujinx.HLE.Exceptions sb.AppendLine(Context.Thread.GetGuestStackTrace()); // Print buffer information - if (Request.PtrBuff.Count > 0 || - Request.SendBuff.Count > 0 || - Request.ReceiveBuff.Count > 0 || + if (Request.PtrBuff.Count > 0 || + Request.SendBuff.Count > 0 || + Request.ReceiveBuff.Count > 0 || Request.ExchangeBuff.Count > 0 || Request.RecvListBuff.Count > 0) { @@ -149,11 +140,12 @@ namespace Ryujinx.HLE.Exceptions return sb.ToString(); } - private (Type, MethodBase) WalkStackTrace(StackTrace trace) + private static (Type, MethodBase) WalkStackTrace(StackTrace trace) { int i = 0; StackFrame frame; + // Find the IIpcService method that threw this exception while ((frame = trace.GetFrame(i++)) != null) { @@ -169,4 +161,4 @@ namespace Ryujinx.HLE.Exceptions return (null, null); } } -} +} \ No newline at end of file -- cgit v1.2.3