Hello guys,
I have worked on a documentation of the EE recompiler: http://wiki.pcsx2.net/index.php/PCSX2_Do...Recompiler
It isn't yet finish but it gives you already a good overview of the recompiler. Feel free to improve it (or give your feedback)
I would like also to concentrate others doc in this wiki. I think it will be interesting to port http://forums.pcsx2.net/Thread-How-to-cr...er-GS-dump
And also this draft:
Who would like to help?
I have worked on a documentation of the EE recompiler: http://wiki.pcsx2.net/index.php/PCSX2_Do...Recompiler
It isn't yet finish but it gives you already a good overview of the recompiler. Feel free to improve it (or give your feedback)
I would like also to concentrate others doc in this wiki. I think it will be interesting to port http://forums.pcsx2.net/Thread-How-to-cr...er-GS-dump
And also this draft:
Code:
Here an overview of severals way to debug PCSX2 on Linux (quick and dirty post).
*************************************************
1/ Debugging PCSX2 or generate a backtrace
* use dev or debug build to have debug information
* If the backtrace contains ???, it means you miss debug symbol from external libraries. Hint: search -dbg packages of your distribution.
# Use this command to start gdb (adapt the path to your executable)
gdb ./bin/pcsx2-dbg
# inside the gdb prompt you need to disable segmentation fault
(gdb) handle SIGSEGV noprint
# Now you can run the program
(gdb) run
# Do the action that trigger the crash
# If you can't access the gdb prompt, hit CTRL-C to stop PCSX2
# Then you can dump the trace with
(gdb) thread apply all bt
# Same with extra printing of local variable
(gdb) thread apply all bt full
WARNING: I'm not sure gdb will stop correctly if you hit a SIGSEGV in plugins
2/ Address Sanitizer
PCSX2 supports a special build mode to check wrong memory access (which often lead to segmentation fault)
It can be enabled with the --asan flags
./build.sh --asan
PCSX2 uses a special handler for SIGSEGV signal so you need to notify the checker at run-time. Typically you must start the executable this way
ASAN_OPTIONS=allow_user_segv_handler=1 ./bin/pcsx2-dbg
3/ GS dump
3a/ generate GS dump
* few frames: CTRL+F8
* more frames: CTRL+SHIFT+F8, hold SHIFT
The dump will be created in your snapshot directory. Hint check .gs extension files.
3b/ replay the GS dump
* Build PCSX2 with this option -DBUILD_REPLAY_LOADERS=TRUE
It will create the pcsx2_GSReplayLoader executable
Note: I would advice to save it somewhere.
* The executable requires 3 arguments
1/ the GSdx plugin => bin/plugins/libGSdx-0.1.16.so
2/ the .gs file => bin/snaps/god_of_war.gs
3/ the directory that contains the ini file => bin/inis
3c/ Useful option to analysis the dump
* linux_replay = n <= replay the trace n times
* dump = 1 <= Enable dumping infrastructure
* save = 1 <= dump render target
* savez = 1 <= dump depth target
* saven = nnn <= first texture to dump
3d/ For the record it is possible to replay GS dump in GPU debugger such as Apitrace
* if you know any other debugger on Linux, rise your hand.
Who would like to help?