Commit graph

621 commits

Author SHA1 Message Date
svc64
20e5eeb39e 32-bit debugger support 2024-08-24 18:54:58 +03:00
svc64
bca3939a65 Kill the message handler thread when killing the debugger 2024-08-24 18:54:58 +03:00
svc64
6b74bcec7c Refactor stepping code, fix stepping over a breakpoint 2024-08-24 18:54:58 +03:00
svc64
cc32ac251b Improve debugger interface code 2024-08-24 18:54:58 +03:00
svc64
e401097e1e Fix crash after sending a kill command 2024-08-24 18:54:58 +03:00
svc64
0396997c17 Bring back the debugger message handler thread 2024-08-24 18:54:58 +03:00
svc64
5f5cb73baa Formatting 2024-08-24 18:54:58 +03:00
svc64
652423cfeb Debug settings in the Avalonia UI 2024-08-24 18:54:36 +03:00
svc64
64206c7c5e Fix GDB stub port in the GTK UI 2024-08-24 18:51:12 +03:00
svc64
13c53657cc Fix the kill command, improve stepping 2024-08-24 18:51:12 +03:00
svc64
055ac70eaa Kill command - stop emulation 2024-08-24 18:50:51 +03:00
svc64
38c15faacf Remove useless definitions 2024-08-24 17:53:09 +03:00
svc64
1684a9d7a2 Fix GDB server crashes 2024-08-24 17:53:09 +03:00
svc64
e3b8060417 Refactor the debugger interface
Also support stepping through blocking syscalls
2024-08-24 17:53:09 +03:00
svc64
0f50273d4f Fix GDB stub settings 2024-08-24 17:53:09 +03:00
svc64
f934d23de4 (Hopefully) Properly check if the thread is blocked when stepping 2024-08-24 17:53:09 +03:00
svc64
144aa2f5b1 Fix stepping with JIT 2024-08-24 17:53:09 +03:00
svc64
edbd4bfc29 Revert "Return the address of the current instruction in EmitSynchronization"
This reverts commit 1331589a22ccf21c02951db96d0335a10738ae4c.
2024-08-24 17:53:09 +03:00
svc64
5d42332d75 Don't step when the thread is blocked 2024-08-24 17:53:09 +03:00
svc64
de4ec65bd7 Handle GDB server reconnections 2024-08-24 17:53:09 +03:00
svc64
5e65fd8808 Reply with an error if we fail to step 2024-08-24 17:53:09 +03:00
svc64
6ecc829516 Clarify StepBarrier 2024-08-24 17:53:09 +03:00
svc64
bc0ba93e92 Remove old variable 2024-08-24 17:53:09 +03:00
svc64
0c57663ea3 Add comments on debug stuff & fix warnings 2024-08-24 17:53:09 +03:00
svc64
65d7a16a87 Debugger refactor 2024-08-24 17:53:09 +03:00
svc64
81c399ec3e Better locking in debug methods 2024-08-24 17:53:09 +03:00
svc64
40584e0e45 HvExecutionContext: fix DebugPc 2024-08-24 17:53:09 +03:00
svc64
ac438d6572 KThread based debug
This commit starts a big refactor to the original debugger PR by merryhime. The debugger now interfaces with KThreads instead of the ExecutionContext.

The corresponding KThread debug functions properly suspend/resume the thread and call the underlying debug related function in the ExecutionContext.

I also added debugging support to the AppleHV ExecutionContext.
2024-08-24 17:53:09 +03:00
svc64
841aa89581 Return the address of the current instruction in EmitSynchronization 2024-08-24 17:53:09 +03:00
svc64
fc361f82a7 Don't recreate the GDB server socket 2024-08-24 17:53:09 +03:00
svc64
917a292256 Initialize the debugger before HOS 2024-08-24 17:53:09 +03:00
merry
5583a60ace stepping is less screwed up now 2024-08-24 17:53:09 +03:00
merry
8bd4417b24 Implement qThreadExtraInfo 2024-08-24 17:53:09 +03:00
svc64
7e4944cc88 Make DebugState public and remove AppleHV's DebugState 2024-08-24 17:53:09 +03:00
merry
5a34d80f98 Restart socket when able 2024-08-24 17:53:09 +03:00
merry
1cef40131a Support vectors in write registers
# Conflicts:
#	src/Ryujinx.HLE/Debugger/Debugger.cs
2024-08-24 17:53:09 +03:00
merry
a9538a54ff cleanup 2024-08-24 17:53:09 +03:00
merry
3bdf9d9805 Implement binary data escaping 2024-08-24 17:53:09 +03:00
merry
09a63ba2b5 Notify debugger on BRK instruction
# Conflicts:
#	src/Ryujinx.HLE/Debugger/Debugger.cs
#	src/Ryujinx.HLE/Debugger/Message/ThreadBreakMessage.cs
#	src/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs
2024-08-24 17:53:09 +03:00
svc64
9b9137bf0a Log GDB server exceptions 2024-08-24 17:53:09 +03:00
svc64
a366890cb5 Fix spacing 2024-08-24 17:53:09 +03:00
svc64
a6cbb89996 Don't store ThreadUid in the shadow context and/or vcpu 2024-08-24 17:53:09 +03:00
svc64
d0fbcced57 Put ThreadUid in the execution context classes 2024-08-24 17:53:09 +03:00
merry
54bf7507d7 Call InvalidateCacheRegion
# Conflicts:
#	Ryujinx.HLE/HOS/ArmProcessContext.cs
#	src/Ryujinx.HLE/Debugger/Debugger.cs
#	src/Ryujinx.HLE/Debugger/IDebuggableProcess.cs
#	src/Ryujinx.HLE/HOS/Horizon.cs
#	src/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs
2024-08-24 17:53:09 +03:00
merry
1b9753d42a Debugger: Fixups from testing with GDB
# Conflicts:
#	src/Ryujinx.HLE/Debugger/Debugger.cs
2024-08-24 17:53:09 +03:00
merry
a1de4f1b5b Debugger: Do more stuff
# Conflicts:
#	src/Ryujinx.HLE/Debugger/Debugger.cs
#	src/Ryujinx.HLE/Debugger/GdbXml/aarch64-core.xml
#	src/Ryujinx.HLE/Debugger/GdbXml/aarch64-fpu.xml
#	src/Ryujinx.HLE/Debugger/GdbXml/target.xml
#	src/Ryujinx.HLE/Debugger/RegisterInformation.cs
2024-08-24 17:53:09 +03:00
merry
1bb8f6381c Debugger: Add replies for qGDBServerVersion, qHostInfo, qProcessInfo, qfThreadInfo, qsThreadInfo 2024-08-24 17:53:09 +03:00
merry
deccf05e60 SDL2: Add GDB stub options to SDL2 frontend
# Conflicts:
#	src/Ryujinx.Headless.SDL2/Program.cs
2024-08-24 17:53:09 +03:00
merry
6edc00ec9c Debugger: Initial implementation
# Conflicts:
#	src/Ryujinx.HLE/Debugger/Debugger.cs
#	src/Ryujinx.HLE/Debugger/GdbSignal.cs
#	src/Ryujinx.HLE/Debugger/Message/AbortMessage.cs
#	src/Ryujinx.HLE/Debugger/Message/BreakInMessage.cs
#	src/Ryujinx.HLE/Debugger/Message/CommandMessage.cs
#	src/Ryujinx.HLE/Debugger/Message/IMessage.cs
#	src/Ryujinx.HLE/Debugger/Message/SendNackMessage.cs
#	src/Ryujinx.HLE/Debugger/StringStream.cs
#	src/Ryujinx.HLE/Switch.cs
2024-08-24 17:53:09 +03:00
merry
2a17f1314d Configuration: Add GDB stub related configuration
# Conflicts:
#	Ryujinx/Configuration/ConfigurationState.cs
#	src/Ryujinx.HLE/HLEConfiguration.cs
#	src/Ryujinx.Ui.Common/Configuration/ConfigurationFileFormat.cs
#	src/Ryujinx/Ui/MainWindow.cs
#	src/Ryujinx/Ui/Windows/SettingsWindow.cs
#	src/Ryujinx/Ui/Windows/SettingsWindow.glade
2024-08-24 17:53:09 +03:00