Fix debugger crash when using "info thread"
This commit is contained in:
parent
20e5eeb39e
commit
eea36e8a37
2 changed files with 11 additions and 3 deletions
|
@ -554,11 +554,17 @@ namespace Ryujinx.HLE.Debugger
|
||||||
|
|
||||||
void CommandSetThread(char op, ulong? threadId)
|
void CommandSetThread(char op, ulong? threadId)
|
||||||
{
|
{
|
||||||
if (threadId == 0)
|
if (threadId == 0 || threadId == null)
|
||||||
{
|
{
|
||||||
threadId = GetThreads().First().ThreadUid;
|
threadId = GetThreads().First().ThreadUid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (DebugProcess.GetThread(threadId.Value) == null)
|
||||||
|
{
|
||||||
|
ReplyError();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (op)
|
switch (op)
|
||||||
{
|
{
|
||||||
case 'c':
|
case 'c':
|
||||||
|
|
|
@ -1306,7 +1306,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||||
{
|
{
|
||||||
lock (_parent._threadingLock)
|
lock (_parent._threadingLock)
|
||||||
{
|
{
|
||||||
return _parent._threads.Select(x => x.ThreadUid).ToArray();
|
var threads = _parent._threads.Where(x => !x.TerminationRequested).ToArray();
|
||||||
|
return threads.Select(x => x.ThreadUid).ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1314,7 +1315,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||||
{
|
{
|
||||||
lock (_parent._threadingLock)
|
lock (_parent._threadingLock)
|
||||||
{
|
{
|
||||||
return _parent._threads.FirstOrDefault(x => x.ThreadUid == threadUid);
|
var threads = _parent._threads.Where(x => !x.TerminationRequested).ToArray();
|
||||||
|
return threads.FirstOrDefault(x => x.ThreadUid == threadUid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue