RPCS3 / rpcs3

PlayStation 3 emulator and debugger
https://rpcs3.net/
GNU General Public License v2.0
15.33k stars 1.91k forks source link

[Feature Request] improve callstack dump for windows #10654

Open sunnyqeen opened 3 years ago

sunnyqeen commented 3 years ago

I got several random crashes like ·F 0:21:15.506754 {PPU[0x1000000] Thread (main_thread) [0x00cd6a60]} VM: Access violation reading location 0xb3b98c00 (unmapped memory) [type=u0] which will freeze the emu, but the current callstack info from the log could not help much, as it just show the address. Call stack:

0x00cd6a60 (0x0) called

from 0x00cd6a60 (sp=0xd003f760) from 0x00c9d1e4 (sp=0xd003f940) from 0x00c9dd1c (sp=0xd003fc90) from 0x00c9f448 (sp=0xd003ff30) from 0x0038c438 (sp=0xd003ffe0) from 0x00027040 (sp=0xd00400f0) from 0x004c4f0c (sp=0xd0040290) from 0x000118e8 (sp=0xd0040370) from 0x000119a0 (sp=0xd0040810) from 0x00011e8c (sp=0xd0040cb0) from 0x00011c20 (sp=0xd0040d50)

It would be good we could show also the function names, and maybe even show the source file and line if the .pdb files are packed to the binaries.

From my limit understanding of the emu. We just need to add some code to Utilities/Thread.cpp

AniLeo commented 3 years ago

The pdb file is almost 200MB last time I checked, it's not viable to include it with the binaries

sunnyqeen commented 3 years ago

Could we just put the zipped pdb to a second package for download? Then users could choose if they need them for bug report.

And for the full callstack dump , there is a lib already exist and easy to use. https://github.com/JochenKalmbach/StackWalker

elad335 commented 3 years ago

This is a PPU callstack, not x86.

sunnyqeen commented 3 years ago

@elad335 Thanks for point it out. Then the x86 callstack logging is completely missing. see static LONG exception_handler(PEXCEPTION_POINTERS pExp) noexcept and static LONG exception_filter(PEXCEPTION_POINTERS pExp) noexcept inside Utilities/Thread.cpp