Commit Graph

7629 Commits

Author SHA1 Message Date
emoose 5917554324 [App] Update gdbstub setting description 2024-10-24 00:28:38 +01:00
emoose 2e9c9f403d [GDBStub] Forward `DbgPrint` & `DmSendNotificationString` messages
TODO: see if there's any other debug-string-output functions that we can
pass to debugger?

Might be worth adding a custom GDB command for toggling these too, some
games could be spammy
2024-10-24 00:27:59 +01:00
emoose 220324b463 [GDBStub] Fix debugger showing invalid symbols after pausing/continuing 2024-10-24 00:04:38 +01:00
emoose c17261abf7 [GDBStub] Return error for code / unimpl. reg writes, small fixups 2024-10-24 00:04:38 +01:00
emoose e260d0a110 [GDBStub] Provide exception type to debugger 2024-10-24 00:04:38 +01:00
emoose a4187736ad [GDBStub] Add RegisterWriteAll 2024-10-24 00:04:38 +01:00
emoose ea9cf0c8f9 [GDBStub] Allow register writes, disable ctx promotion for --debug
Register changes won't always register if context promotion pass is enabled,
fortunately this was noted by benvanik at
3d30b2eec3/src/xenia/debug/ui/debug_window.cc (L1004)

Disabling context promotion pass if --debug is set seems to allow register
updates fine, without too much performance loss on my end.

Still need to implement PC and CR reg writes, and the WriteRegistersAll cmd

Not completely sure if all register writes actually take effect yet, seems
GPR are fine at least but unsure about others
2024-10-24 00:04:32 +01:00
emoose 0acc46e52e [GDBStub] Add MemoryWrite, extra checks in memory cmds 2024-10-24 00:00:33 +01:00
emoose 2ee35a2054 [GDBStub] Remove duplicated code, minor fixups 2024-10-24 00:00:33 +01:00
emoose c9778a4032 [GDBStub] Use main thread as default thread ID 2024-10-24 00:00:33 +01:00
emoose 26cfa69497 [GDBStub] Add memory map, MSR/FPSCR, handle Kill request
IDA seems to ignore the map though, sad!
2024-10-24 00:00:33 +01:00
emoose 0469ae2aee [GDBStub] Use xe::SocketServer instead of winsock, allow detaching
Detach will clear breakpoints and resume execution
Reconnecting should now work fine, could probably have multiple connections
too (may be some threading issues with that though...)
2024-10-24 00:00:33 +01:00
emoose b7ab7e966f [GDBStub] Prevent adding BP if other BP shares same host addr
Fixes assert error with BPs set very close to each other
(in IDA the failed BP will also show different color)
2024-10-24 00:00:33 +01:00
emoose bfa6eee936 [Debug] Processor: breakpoint address fixes
- Update OnThreadBreakpointHit to use bp->ContainsHostAddress

Sometimes guest PC doesn't map to the x64 exactly, so ResolveStack may return
a guest PC different to the breakpoint that triggered it

Processor code would just skip the breakpoint entirely if PC didn't match
so any debugger wouldn't know what BP caused it

Luckily BP does have a ContainsHostAddress func which seems perfect, but was
somehow left unused

Also added a hack to nudge the PC we tell GDB about to the BP's PC

- Update StepGuest/HostInstruction to add step BP to front of map

Fixes an issue where a different BP might get triggered before the step BP
which could cause debugger to step again, causing assert error as a step BP
already existed

I noticed one more issue, if BPs are set on instructions very close together
it might act on the same x64 instruction, causing assert when a BP is already
placed and another BP tries to set on the same addr...

Not really sure what best way to fix that is yet, for now just don't place
BPs too close together!
2024-10-24 00:00:33 +01:00
emoose 2204259781 [Debug] GDBStub: add info for each command 2024-10-24 00:00:33 +01:00
emoose 733fe04426 [Debug] Add PoC GDBStub server, fix breakpoints
Fixed issue in processor.cc which prevented resuming from a breakpoint

BPs would set 2 bytes of the x64 JIT opcode to an invalid opcode & then catch
the exception from it - BP handler then restored the original opcode, but
then advanced RIP by 2 bytes into that opcode for some reason?

It would also suspend the thread just prior to this RIP change,
causing some strange effects... moving suspend after it (and removing the
offset) appears to work fine, though I didn't test the imgui debugger yet

To use GDBStub run xenia with "--debug --gdbport 12345" args

Tested with IDA 9 + idaxex loader, BPs can be set and resumed fine, suspend
& resume also works - memory/registers are viewable but can't be changed yet

The socket code here is very basic and only allows a single connection for
the session, if you disconnect you'll need to restart emulator
2024-10-24 00:00:33 +01:00
Hendi 764f230dd9 [XAM] XMP: Implement playback 2024-10-23 22:04:47 +02:00
Hendi 5a76cac218 [APU] Refactor audio system to work with different frequencies/channel layouts 2024-10-23 22:04:47 +02:00
Gliniak da6afabf60 [XAM] XMP: Adjusted/Fixed size returned in message 0x0007002E 2024-10-23 20:38:37 +02:00
Xphalnos c42a54ddec [3PP] Updated: Half, Xbyak, SDL2 2024-10-22 22:16:26 +02:00
Gliniak 1c4527c1e7 [Kernel] Fixed applying TUs to multi disc games 2024-10-22 20:05:35 +02:00
Gliniak 32cebd7a11 [UI] Fixed assertion caused by style push/pop mismatch 2024-10-22 19:49:16 +02:00
Gliniak 77b6ad1de7 [3PP] Fixed incorrect FFmpeg repo 2024-10-22 19:34:57 +02:00
Gliniak dddd26e657 [3PP] Uplifted FFmpeg - Include avformat for XMP 2024-10-20 22:23:44 +02:00
Xphalnos 1c9783ca3c [imgui] Makes the window edges rounded 2024-10-20 20:22:37 +02:00
EmiGITs 0712132ed0 [CPU] Added disable_context_promotion option
This disable ContextPromotionPass that causes instability in some games
2024-10-20 20:08:56 +02:00
Margen67 8af296a200 [GPU] Custom resolution
Does not work without patches.
2024-10-19 03:38:21 -07:00
Margen67 6c0f026824 [GPU] Fix internal_display_resolution condition 2024-10-18 13:05:16 -07:00
Gliniak d2921a09eb [UI] Fixed inconsistency in slot id 2024-10-18 21:12:17 +02:00
Margen67 58098aa6bf [CI] Fix release condition 2024-10-18 11:02:55 -07:00
Gliniak 0949ebfb38 [XAM] Fixed issue with removing savefiles and searching for header in specific condition 2024-10-18 17:48:54 +02:00
Margen67 a5d58a1243 [Docs] Raise minimum Python+Visual Studio 2024-10-16 03:59:23 -07:00
Margen67 90259bef6a [CPU] Add note to cpu option 2024-10-16 03:40:53 -07:00
Margen67 b93ad3e82a [Emulator] Tie window size to resolution 2024-10-16 03:40:53 -07:00
Margen67 06763a9e4a CI: Only create releases for canary_experimental 2024-10-16 02:50:41 -07:00
Margen67 ea762e9f1b Add back VS2022 builds 2024-10-13 16:19:37 -07:00
Margen67 b39f1fbe60 Raise minimum Python version
This was accidentally lowered in 5d3240d492 and 3.8 has gone EOL since then.
2024-10-13 16:19:37 -07:00
Margen67 731c6057de Canaryize
Co-Authored-By: illusion0001 <37698908+illusion0001@users.noreply.github.com>
2024-10-13 15:11:47 -07:00
Gliniak 85458c811f [XAM] Fixed issues with reading savefiles that are loaded via: XamContentAggregate 2024-10-13 15:29:04 +02:00
NicknineTheEagle e85a59ca90 [Input] Update last controller var in GetKeystroke as well 2024-10-13 10:15:21 +02:00
NicknineTheEagle 060954f0c3 [XAM] Implement XamShowSigninUI 2024-10-12 18:51:36 +02:00
NicknineTheEagle 842161ca9b [Input] Add last used controller tracker 2024-10-12 18:51:36 +02:00
Gliniak 0a0cd2a882 [XAM] Fixed license for extracted XBLA games
This fixes bug introduced few days ago that prevented XBLA games from going into full game mode.
2024-10-12 16:54:47 +02:00
Gliniak 5a5fe97efb [XAM] Added XamMediaVerification stubs
- Create
- Close
- Verify
- FailedBlocks
- Inject

Thanks: Nicknine & Adrian
2024-10-09 18:48:00 +02:00
Gliniak 36453829df [XAM] Added overlap to XamContentGetLicenseMask
Also added logic for skipping "discs" as they don't have a license
2024-10-07 18:45:16 +02:00
Gliniak 06dc06b8ca [XAM] Fallback to config license_mask in case of old header version 2024-10-07 18:31:41 +02:00
Gliniak 5696d55575 [XAM] Auto login freshly created profiles if possible 2024-10-06 21:47:28 +02:00
Gliniak 9e4b2e343f [XAM] Allow content to read license from header 2024-10-06 21:15:50 +02:00
Gliniak 1cda06d5bf [UI] Added info in profile menu about not signed in profiles
Also changed slot ordering to start from 1 instead of 0
2024-10-06 20:12:21 +02:00
Gliniak 32b3151132 [Profile] UI: Skip current draw in case of failure.
This should resolve random crash while removing profile
2024-10-05 14:27:43 +02:00