Skip to content

Commit

Permalink
Stream demo messages
Browse files Browse the repository at this point in the history
This entirely eliminates the demo memory overhead.
  • Loading branch information
glebm committed Sep 2, 2023
1 parent 65e0ad8 commit 70ff515
Show file tree
Hide file tree
Showing 4 changed files with 205 additions and 167 deletions.
2 changes: 2 additions & 0 deletions Packaging/OpenDingux/profile-generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ SAVE_DIR="$(mktemp -d)"
ln -s "${PWD}/demo_0_reference_spawn_0_sv" "${SAVE_DIR}/"
ln -s "${PWD}/demo_0.dmo" "${SAVE_DIR}/"
cp -r "${PWD}/spawn_0_sv" "${SAVE_DIR}/"
rm -rf "${HOME}/devilutionx-profile"
mkdir -p "${HOME}/devilutionx-profile"
./devilutionx --diablo --spawn --demo 0 --timedemo --save-dir "$SAVE_DIR" --data-dir ~/.local/share/diasurgical/devilution
rm -rf "$SAVE_DIR"
55 changes: 55 additions & 0 deletions Packaging/OpenDingux/rg99-pgo.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,58 @@ Here are the instructions for producing a PGO'd build.
```

7. The final package is at `build-rg99/devilutionx-rg99.opk`.

## Remote Debugging with VS Code

If the demo crashes and you cannot reproduce this on PC, you can
use a remote debugger to diagnose the issue.

Unpack the package and copy it to the RG99:

```bash
cd build-rg99
rm -rf squashfs-root
unsquashfs devilutionx-rg99.opk
ssh rg99 'rm -rf /media/data/local/home/squashfs-root'
scp -r -O squashfs-root/ rg99:/media/data/local/home/squashfs-root
```

Then, on RG99, prepare the demo files and run `gdbserver`:

```bash
mkdir -p demo
cp -r squashfs-root/demo_0* demo
cp -r squashfs-root/spawn_0_sv demo
cd squashfs-root
gdbserver 10.1.1.1:8001 devilutionx --diablo --spawn --demo 0 --timedemo \
--save-dir ~/demo --data-dir ~/.local/share/diasurgical/devilution
```

Then, on the PC, add the following VS Code configuration to `.vscode/launch.json`:

```json
{
"name": "rg99 remote debug",
"type": "cppdbg",
"request": "launch",
"program": "build-rg99/devilutionx",
"stopAtEntry": true,
"miDebuggerPath": "/opt/rs90-toolchain/bin/mipsel-linux-gdb",
"miDebuggerArgs": "-ix /opt/rs90-toolchain/mipsel-rs90-linux-musl/sysroot/usr/share/buildroot/gdbinit",
"MIMode": "gdb",
"miDebuggerServerAddress": "10.1.1.3:8001",
"targetArchitecture": "mips",
"additionalSOLibSearchPath": "/opt/rs90-toolchain/mipsel-rs90-linux-musl/sysroot",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"externalConsole": false,
"cwd": "${workspaceFolder}"
}
```

Finally, run the configuration from the "Run and Debug" VS Code tab.
Loading

0 comments on commit 70ff515

Please sign in to comment.