Download
https://github.com/XaviDCR92/pcsxr
Installation
Code: Select all
git clone https://github.com/XaviDCR92/pcsxr
cd pcsxr/
mkdir build && cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug .. && cmake --build .
Code: Select all
cd gui && ./pcsxr
pcsxr now has a "-gdb" command line flag that starts the GDB server on port 3333. The same effect can be achieved by starting pcsxr with no flags and selecting "Configuration->CPU->Enable GDB Server". Ensure "Enable Interpreter CPU" is enabled and "Enable Debugger" (the telnet-based server) remains disabled. Once configured, "GDB server started on port 3333." should appear on stdout. Finally, load the .bin/.cue/.exe file that is attached to your .elf file.
Next, execute mipsel-unknown-elf-gdb using a valid .elf file with debug symbol information (available when compiling with mipsel-unknown-elf-gcc with the "-g" or "-ggdb" flags). If using the command line:
Code: Select all
mipsel-unknown-elf-gdb your-game.elf --tui # --tui not needed, but helpful nonetheless
target remote 3333
b main
c
Code: Select all
(gdb) target remote :3333
Remote debugging using :3333
0xbfc00000 in ?? ()
(gdb) b main
Breakpoint 1 at 0x80020000
(gdb) c
Continuing.
Program stopped.
0x80020000 in main ()
Code: Select all
{
"version": "0.2.0",
"configurations":
[
{
"type": "gdb",
"request": "launch",
"name": "Launch Program",
"target": "Set application name e.g.: ${workspaceFolder}/my-game.elf",
"cwd": "${workspaceFolder}",
"gdbpath": "mipsel-unknown-elf-gdb",
"autorun":
[
"target remote :3333",
"b main",
"c",
"d"
],
"valuesFormatting": "prettyPrinters"
}
]
}
- Porting to Windows is not done yet, but should not be too hard. Only Linux (using Kubuntu 20.04 LTS) has been tested so far.
- Running the GDB server might block the GUI, so if you want to close pcsxr please kill the process if blocked.
- CPU usage is high when waiting for continue/break signals as it must look up two different sockets simultaneously. Hint: I think this could be fixed by using select().
- Warning: PCSXr already had a Telnet-based server which I had to do some breaking changes to. If you find any bug, feel free to create a pull request.