mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-05-22 05:05:47 +00:00
[ci skip] chore: Fix usage of var
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Memory;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ryujinx.HLE.Debugger
|
||||
{
|
||||
@@ -52,7 +53,7 @@ namespace Ryujinx.HLE.Debugger
|
||||
return false;
|
||||
}
|
||||
|
||||
var originalInstruction = new byte[length];
|
||||
byte[] originalInstruction = new byte[length];
|
||||
if (!ReadMemory(address, originalInstruction))
|
||||
{
|
||||
Logger.Error?.Print(LogClass.GdbStub, $"Failed to read memory at 0x{address:X16} to set breakpoint.");
|
||||
@@ -65,7 +66,7 @@ namespace Ryujinx.HLE.Debugger
|
||||
return false;
|
||||
}
|
||||
|
||||
var breakpoint = new Breakpoint(originalInstruction);
|
||||
Breakpoint breakpoint = new(originalInstruction);
|
||||
if (_breakpoints.TryAdd(address, breakpoint))
|
||||
{
|
||||
Logger.Debug?.Print(LogClass.GdbStub, $"Breakpoint set at 0x{address:X16}");
|
||||
@@ -106,7 +107,7 @@ namespace Ryujinx.HLE.Debugger
|
||||
/// </summary>
|
||||
public void ClearAll()
|
||||
{
|
||||
foreach (var bp in _breakpoints)
|
||||
foreach (KeyValuePair<ulong, Breakpoint> bp in _breakpoints)
|
||||
{
|
||||
if (!WriteMemory(bp.Key, bp.Value.OriginalData))
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.HOS.Kernel.Process;
|
||||
using Ryujinx.HLE.HOS.Kernel.Threading;
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
@@ -25,11 +26,11 @@ namespace Ryujinx.HLE.Debugger
|
||||
|
||||
public string GetMinidump()
|
||||
{
|
||||
var response = new StringBuilder();
|
||||
StringBuilder response = new();
|
||||
response.AppendLine("=== Begin Minidump ===\n");
|
||||
response.AppendLine(GetProcessInfo());
|
||||
|
||||
foreach (var thread in GetThreads())
|
||||
foreach (KThread thread in GetThreads())
|
||||
{
|
||||
response.AppendLine($"=== Thread {thread.ThreadUid} ===");
|
||||
try
|
||||
@@ -66,7 +67,7 @@ namespace Ryujinx.HLE.Debugger
|
||||
if (Process is not { } kProcess)
|
||||
return "No application process found\n";
|
||||
|
||||
var sb = new StringBuilder();
|
||||
StringBuilder sb = new();
|
||||
|
||||
sb.AppendLine($"Program Id: 0x{kProcess.TitleId:x16}");
|
||||
sb.AppendLine($"Application: {(kProcess.IsApplication ? 1 : 0)}");
|
||||
@@ -81,7 +82,7 @@ namespace Ryujinx.HLE.Debugger
|
||||
$" Stack: 0x{kProcess.MemoryManager.StackRegionStart:x10} - 0x{kProcess.MemoryManager.StackRegionEnd - 1:x10}");
|
||||
|
||||
sb.AppendLine("Modules:");
|
||||
var debugger = kProcess.Debugger;
|
||||
HleProcessDebugger debugger = kProcess.Debugger;
|
||||
if (debugger != null)
|
||||
{
|
||||
foreach (HleProcessDebugger.Image image in debugger.GetLoadedImages())
|
||||
|
||||
@@ -194,7 +194,7 @@ namespace Ryujinx.HLE.Debugger.Gdb
|
||||
{
|
||||
try
|
||||
{
|
||||
var data = new byte[len];
|
||||
byte[] data = new byte[len];
|
||||
Debugger.DebugProcess.CpuMemory.Read(addr, data);
|
||||
Processor.Reply(Helpers.ToHex(data));
|
||||
}
|
||||
@@ -211,7 +211,7 @@ namespace Ryujinx.HLE.Debugger.Gdb
|
||||
{
|
||||
try
|
||||
{
|
||||
var data = new byte[len];
|
||||
byte[] data = new byte[len];
|
||||
for (ulong i = 0; i < len; i++)
|
||||
{
|
||||
data[i] = (byte)ss.ReadLengthAsHex(2);
|
||||
|
||||
Reference in New Issue
Block a user