PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
Other
10.63k stars 1.55k forks source link

[Debugger bug] Function lists/highlight effects aren't refreshed when multi-ELF games switch between ELFs. #2065

Open Aced14 opened 6 years ago

Aced14 commented 6 years ago

PCSX2 version: v1.5.0-dev-2174-g9c8a48f38 (2017-08-14; 9c8a48f38c46059263607b81217ca87ebc787b70)

PCSX2 options: Defaults.

Plugins used: Defaults (GSdx32-SSE4, LilyPad, SPU2-X, cdvdGigaherz, USBnull, FWnull and DEV9ghzdrk).

Description of the issue: PCSX2's debugger is capable of listing ELF function names and highlighting each function's associated MIPS instructions (by changing their background colours), But those are currently only done for a game's default ELF file. That's fine for games that only use a single ELF file.

However, various games contain multiple ELF files. The debugger isn't currently capable of refreshing function names/highlighting effects when those games switch between ELF files.

Any chance the debugger could be enhanced to automatically refresh function lists/highlighting effects when multi-ELF games switch between ELF files and when loading save states originating from secondary ELF files?

How to reproduce the issue:

  1. Launch PCSX2 and fast boot any game that contains multiple ELF files. For example, a multi-game demo disc, an online game with a built-in network configuration utility or a game compilation.
  2. Open the debugger.
  3. In the debugger window, switch to the "R5900" tab's "Functions" sub-tab and take note of what's listed.
  4. In the game, perform an action that'll launch a new ELF file (such as starting a game from a demo disc/compilation's main menu or starting an online game's network configuration utility).
  5. In the debugger window, the list of functions will remain unchanged compared to step 3.
  6. Double-click on a few function names and check out the background colours of their associated MIPS instructions.
  7. Steps 5 and 6 didn't work as expected. In step 5, the list of functions continued to reflect the game's default ELF file. In step 6, background colours continued to be based on the game's default ELF file, despite the "blocks" of MIPS instructions no longer corresponding to the "blocks" of background colours. The list and background colours should've been refreshed to reflect the new ELF file that was launched in step 4.

Last known version to work:

PC specifications: CPU: Intel Core i7 2600K @ 3.4GHz; GPU: XFX Radeon HD 6970 2GB; GPU driver: Crimson 16.2.1 Beta; OS: Windows 7 SP1.

Other comments: @Kingcom @NZJenkins @turtleli FYI.

Aced14 commented 6 years ago

Would it be possible for a project maintainer to add a "Debugger" label to this issue? It might also warrant "GUI/WX" and/or "Bug" labels.

F0bes commented 2 years ago

I made this a few months back. It works if the main elf uses the syscall LoadExecPS2 (0x06) https://github.com/f0bes/pcsx2/tree/haha-help

refractionpcsx2 commented 2 years ago

That could be good for loading patches/gamefixes on demo/compilation discs since right now we have to relate it to the main ELF and doing patches is pretty much out of the question.

MrCK1 commented 1 year ago

@F0bes Is this something to be addressed in your PR/Qt?

refractionpcsx2 commented 1 year ago

This needs more than just some debugger changes, it would need a lot of ELF loading redesign, but I'll update the tags.