Skip to content

Instantly share code, notes, and snippets.

@manio143
Last active March 15, 2022 00:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manio143/790647a3a948896ba78e02906768a02b to your computer and use it in GitHub Desktop.
Save manio143/790647a3a948896ba78e02906768a02b to your computer and use it in GitHub Desktop.

Debugging Starbreach on Linux

First I had to install dotnet SDK (https://docs.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install)

curl https://dot.net/v1/dotnet-install.sh -O -L
chmod +x dotnet-install.sh
./dotnet-install.sh -c Current
sudo ln -sv /home/manio/.dotnet/dotnet /usr/local/bin/dotnet

You need to compile the Stride game (here Starbreach) with that SDK in Debug config to have access to symbols. Not sure if it works on a version built with another SDK.

For me running Starbreach on ubuntu looks like this:

cd Bin/Linux/Debug/linux-64
LD_LIBRARY_PATH=linux-x64 ./Starbreach.Linux

Then I installed lldb and SOS plugin (https://github.com/dotnet/diagnostics/blob/main/documentation/installing-sos-instructions.md)

sudo apt install lldb
dotnet tool install -g dotnet-sos
DOTNET_ROOT=/home/manio/.dotnet /home/manio/.dotnet/dotnet/tools/dotnet-sos install

Run sudo lldb from ~ and load plugin

(lldb) plugin load .dotnet/sos/libsosplugin.so
(lldb) process attach -p <PID>
(lldb) continue
# when stuck
(lldb) process interrupt
(lldb) clrstack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment