Debugging PMDO: Difference between revisions
mNo edit summary |
refactor steps to debug |
||
Line 2: | Line 2: | ||
= Windows Setup = | = Windows Setup = | ||
# Recursively clone the PMDO repository using <code>git clone --recurse-submodules -j8 https://github.com/audinowho/PMDODump.git</code>. | # Recursively clone the PMDO repository using <code>git clone --recurse-submodules -j8 https://github.com/audinowho/PMDODump.git</code>. | ||
# | # Download the [https://dotnet.microsoft.com/en-us/download/dotnet/8.0 .NET 8.0 SDK]. You want to download the x64 version for windows. Confirm that it is installed using the command <code>dotnet --list-runtimes</code>. | ||
# Download [https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&channel=Release&version=VS2022&source=VSLandingPage&cid=2030&passive=false Visual Studio 2022] or later. | |||
# Open PMDOData.sln using Visual Studio 2022. | |||
# Set your configuration to Debug, Any CPU. Build the entire solution | # Set your configuration to Debug, Any CPU. Build the entire solution | ||
# Set PMDC as the startup project and hit Debug. | # Set PMDC as the startup project and hit Debug. | ||
= Linux Setup = | = Linux Setup = | ||
Currently, only x64 architecture is supported for Linux. | |||
# Recursively clone the PMDO repository using <code>git clone --recurse-submodules -j8 https://github.com/audinowho/PMDODump.git</code>. | # Recursively clone the PMDO repository using <code>git clone --recurse-submodules -j8 https://github.com/audinowho/PMDODump.git</code>. | ||
# | # Download the [https://dotnet.microsoft.com/en-us/download/dotnet/8.0 .NET 8.0 SDK]. You want to download the x64 version for Linux. Confirm that it is installed using the command <code>dotnet --list-runtimes</code>. | ||
# Install the [https://code.visualstudio.com/docs/csharp/debugging C# Dev Kit] | # Download and install [https://code.visualstudio.com/download Visual Studio Code] for Linux. We recommend using the .deb installer. | ||
# | # Install the [https://code.visualstudio.com/docs/csharp/debugging C# Dev Kit]. This can be found in the Extensions tab. | ||
## Choose C#. | # Open the PMDOData folder with VSCode. You can do this by starting with a blank VSCode window, open a folder, select the PMDODump folder. | ||
# With the C# Dev Kit installed, you now have the option to open the PMDOData.sln: check the Solution Explorer tab, then right click PMDOData.sln and choose "Open Solution". | |||
# With the C# Dev Kit installed, you also have the option to open the Command Palette <code>Ctrl+Shift+P</code>. In the command palette, type/choose <code>Debug: Select and Start Debugging</code>. | |||
## Choose "C#" from the dropdown. If you've properly opened the PMDOData.sln solution, you should have several Launch Configurations available. Choose "C#: PMDC". | |||
# Debug will start. If the console complains about not being able to find the correct file from path, you may need to change the relative paths specified for the <code>-asset</code> argument in the <code>PMDC/PMDC/Properties/launchSettings.json</code> file. | # Debug will start. If the console complains about not being able to find the correct file from path, you may need to change the relative paths specified for the <code>-asset</code> argument in the <code>PMDC/PMDC/Properties/launchSettings.json</code> file. | ||
# Once this debug configuration is chosen, you can start debugging quickly by going to the Debug tab and selecting the green button next to "Run and Debug". | # Once this debug configuration is chosen, you can start debugging quickly by going to the Debug tab and selecting the green button next to "Run and Debug". | ||
Line 22: | Line 25: | ||
= Mac Setup = | = Mac Setup = | ||
Apple machines made a transition from x64 to ARM64 with [https://en.wikipedia.org/wiki/Mac_transition_to_Apple_silicon Apple Silicon] in 2020-2024, with any Macs running on M1 Chips or later using ARM64. PMDO runs and deploys on x64 only; this normally means that PMDO entirely would not be able to run on M1+ Macs, but [https://en.wikipedia.org/wiki/Rosetta_(software) Rosetta 2] translates applications meant for x64 to run on ARM64. This works normally when attempting to play published versions of PMDO, but makes things tricky for debugging. | |||
If your machine predates the ARM64 transition (IE, predates M1 Macs), it uses x64 architecture, and there should be no issues debugging. The setup for Visual Studio Code should work exactly as it did for Linux. Use the instructions there if so. Otherwise, use the modified instructions below: | |||
== Visual Studio Code (Arm64) == | |||
# Recursively clone the PMDO repository using <code>git clone --recurse-submodules -j8 https://github.com/audinowho/PMDODump.git</code>. | |||
# Download the [https://dotnet.microsoft.com/en-us/download/dotnet/8.0 .NET 8.0 SDK]. You want to download the x64 (Not Arm64!) version for MacOS. Confirm that it is installed using the command <code>dotnet --list-runtimes</code>. | |||
## If you've previously installed dotnet, it's likely the version for Arm64. You must [https://learn.microsoft.com/en-us/dotnet/core/install/remove-runtime-sdk-versions uninstall] it beforehand. | |||
## If <code>dotnet</code> command does not work after x64 installation, you may need to specify the path of dotnet directly: check <code>/etc/paths.d/dotnet</code> and make sure it points to <code>/usr/local/share/dotnet/x64</code>. | |||
# Download and install [https://code.visualstudio.com/download Visual Studio Code] for MacOS. Specifically choose the zip for Intel Chip. | |||
## If you have an existing VSCode installation under Arm64, it must be uninstalled. You should be able to do this by sending the VSCode app to the trash. | |||
# Install the [https://code.visualstudio.com/docs/csharp/debugging C# Dev Kit]. This can be found in the Extensions tab. | |||
## If you had a previous installation of VSCode under Arm64, it's likely that the extension was also installed as an arm64 version. You will need to uninstall it and reinstall to get the x64 version. Do this for both the C# Dev Kit as well as the C# extension it depends on. | |||
# Open the PMDOData folder with VSCode. You can do this by starting with a blank VSCode window, open a folder, select the PMDODump folder. | |||
# With the C# Dev Kit installed, you now have the option to open the PMDOData.sln: check the Solution Explorer tab, then right click PMDOData.sln and choose "Open Solution". | |||
# With the C# Dev Kit installed, you also have the option to open the Command Palette <code>Ctrl+Shift+P</code>. In the command palette, type/choose <code>Debug: Select and Start Debugging</code>. | |||
## Choose "C#" from the dropdown. If you've properly opened the PMDOData.sln solution, you should have several Launch Configurations available. Choose "C#: PMDC". | |||
# Debug will start. If the console complains about not being able to find the correct file from path, you may need to change the relative paths specified for the <code>-asset</code> argument in the <code>PMDC/PMDC/Properties/launchSettings.json</code> file. | |||
# Once this debug configuration is chosen, you can start debugging quickly by going to the Debug tab and selecting the green button next to "Run and Debug". | |||
== Jetbrains Rider == | |||
Made by: Trio-#4442 | Made by: Trio-#4442 | ||
Line 29: | Line 54: | ||
# Recursively clone the PMDO repository using <code>git clone --recurse-submodules -j8 https://github.com/audinowho/PMDODump.git</code>. | # Recursively clone the PMDO repository using <code>git clone --recurse-submodules -j8 https://github.com/audinowho/PMDODump.git</code>. | ||
# Copy all of the <code>.dylib</code> files in <code>PMDC/PMDC/runtimes</code> folders to <code>PMDC/PMDC</code>. Here’s what your file structure should look like: [[File:Debug_Mac_FolderStructure.png|frameless]] | # Copy all of the <code>.dylib</code> files in <code>PMDC/PMDC/runtimes</code> folders to <code>PMDC/PMDC</code>. Here’s what your file structure should look like: [[File:Debug_Mac_FolderStructure.png|frameless]] | ||
# In your <code>~/.gitignore_global</code> file, add the following files for git to ignore: | |||
Jetbrains Rider requires a paid subscription. | |||
# Debug should run out of the box. Set the configuration to PMDC and click "Debug", and you should be all ready to go!</br>[[File:Debug_Mac_Rider.png|frameless]] | |||
== Gitignore considerations == | |||
In your <code>~/.gitignore_global</code> file, add the following files for git to ignore: | |||
<pre> | <pre> | ||
# Debug logs (npm, yarn) | # Debug logs (npm, yarn) | ||
Line 46: | Line 82: | ||
</pre> | </pre> | ||
You may want to include more. Modified from [https://www.mashupgarage.com/playbook/git/gitignore.html here]. | You may want to include more. Modified from [https://www.mashupgarage.com/playbook/git/gitignore.html here]. | ||
[[Category: Engine]] | [[Category: Engine]] |
Revision as of 21:06, 9 November 2024
See also: Contributing Code, Building PMDO
Windows Setup
- Recursively clone the PMDO repository using
git clone --recurse-submodules -j8 https://github.com/audinowho/PMDODump.git
. - Download the .NET 8.0 SDK. You want to download the x64 version for windows. Confirm that it is installed using the command
dotnet --list-runtimes
. - Download Visual Studio 2022 or later.
- Open PMDOData.sln using Visual Studio 2022.
- Set your configuration to Debug, Any CPU. Build the entire solution
- Set PMDC as the startup project and hit Debug.
Linux Setup
Currently, only x64 architecture is supported for Linux.
- Recursively clone the PMDO repository using
git clone --recurse-submodules -j8 https://github.com/audinowho/PMDODump.git
. - Download the .NET 8.0 SDK. You want to download the x64 version for Linux. Confirm that it is installed using the command
dotnet --list-runtimes
. - Download and install Visual Studio Code for Linux. We recommend using the .deb installer.
- Install the C# Dev Kit. This can be found in the Extensions tab.
- Open the PMDOData folder with VSCode. You can do this by starting with a blank VSCode window, open a folder, select the PMDODump folder.
- With the C# Dev Kit installed, you now have the option to open the PMDOData.sln: check the Solution Explorer tab, then right click PMDOData.sln and choose "Open Solution".
- With the C# Dev Kit installed, you also have the option to open the Command Palette
Ctrl+Shift+P
. In the command palette, type/chooseDebug: Select and Start Debugging
.- Choose "C#" from the dropdown. If you've properly opened the PMDOData.sln solution, you should have several Launch Configurations available. Choose "C#: PMDC".
- Debug will start. If the console complains about not being able to find the correct file from path, you may need to change the relative paths specified for the
-asset
argument in thePMDC/PMDC/Properties/launchSettings.json
file. - Once this debug configuration is chosen, you can start debugging quickly by going to the Debug tab and selecting the green button next to "Run and Debug".
Mac Setup
Apple machines made a transition from x64 to ARM64 with Apple Silicon in 2020-2024, with any Macs running on M1 Chips or later using ARM64. PMDO runs and deploys on x64 only; this normally means that PMDO entirely would not be able to run on M1+ Macs, but Rosetta 2 translates applications meant for x64 to run on ARM64. This works normally when attempting to play published versions of PMDO, but makes things tricky for debugging.
If your machine predates the ARM64 transition (IE, predates M1 Macs), it uses x64 architecture, and there should be no issues debugging. The setup for Visual Studio Code should work exactly as it did for Linux. Use the instructions there if so. Otherwise, use the modified instructions below:
Visual Studio Code (Arm64)
- Recursively clone the PMDO repository using
git clone --recurse-submodules -j8 https://github.com/audinowho/PMDODump.git
. - Download the .NET 8.0 SDK. You want to download the x64 (Not Arm64!) version for MacOS. Confirm that it is installed using the command
dotnet --list-runtimes
.- If you've previously installed dotnet, it's likely the version for Arm64. You must uninstall it beforehand.
- If
dotnet
command does not work after x64 installation, you may need to specify the path of dotnet directly: check/etc/paths.d/dotnet
and make sure it points to/usr/local/share/dotnet/x64
.
- Download and install Visual Studio Code for MacOS. Specifically choose the zip for Intel Chip.
- If you have an existing VSCode installation under Arm64, it must be uninstalled. You should be able to do this by sending the VSCode app to the trash.
- Install the C# Dev Kit. This can be found in the Extensions tab.
- If you had a previous installation of VSCode under Arm64, it's likely that the extension was also installed as an arm64 version. You will need to uninstall it and reinstall to get the x64 version. Do this for both the C# Dev Kit as well as the C# extension it depends on.
- Open the PMDOData folder with VSCode. You can do this by starting with a blank VSCode window, open a folder, select the PMDODump folder.
- With the C# Dev Kit installed, you now have the option to open the PMDOData.sln: check the Solution Explorer tab, then right click PMDOData.sln and choose "Open Solution".
- With the C# Dev Kit installed, you also have the option to open the Command Palette
Ctrl+Shift+P
. In the command palette, type/chooseDebug: Select and Start Debugging
.- Choose "C#" from the dropdown. If you've properly opened the PMDOData.sln solution, you should have several Launch Configurations available. Choose "C#: PMDC".
- Debug will start. If the console complains about not being able to find the correct file from path, you may need to change the relative paths specified for the
-asset
argument in thePMDC/PMDC/Properties/launchSettings.json
file. - Once this debug configuration is chosen, you can start debugging quickly by going to the Debug tab and selecting the green button next to "Run and Debug".
Jetbrains Rider
Made by: Trio-#4442
- Download .NET 8.0. You want to download the x64 version. Confirm that it is installed using the command
dotnet --list-runtimes
. - Recursively clone the PMDO repository using
git clone --recurse-submodules -j8 https://github.com/audinowho/PMDODump.git
. - Copy all of the
.dylib
files inPMDC/PMDC/runtimes
folders toPMDC/PMDC
. Here’s what your file structure should look like:
Jetbrains Rider requires a paid subscription.
- Debug should run out of the box. Set the configuration to PMDC and click "Debug", and you should be all ready to go!
Gitignore considerations
In your ~/.gitignore_global
file, add the following files for git to ignore:
# Debug logs (npm, yarn) *.log # Editor artifacts .*.sw[a-z] *~ .#* .vscode .idea # OS files Thumbs.db .DS_Store
You may want to include more. Modified from here.