1
0
mirror of https://gitlab.com/lander-team/lander-cpp.git synced 2025-06-16 15:17:23 +00:00

add debugging

This commit is contained in:
Anson Biggs 2021-09-16 18:09:38 -07:00
parent 33ebdabc07
commit dcd15f161d
4 changed files with 43 additions and 8 deletions

29
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,29 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "g++ - Build and debug simulation",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/main.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "Debug"
}
]
}

View File

@ -43,4 +43,5 @@
"C_Cpp.clang_format_fallbackStyle": "LLVM", "C_Cpp.clang_format_fallbackStyle": "LLVM",
"editor.formatOnSave": true, "editor.formatOnSave": true,
"editor.formatOnPaste": true, "editor.formatOnPaste": true,
"python.formatting.provider": "black",
} }

8
.vscode/tasks.json vendored
View File

@ -3,15 +3,15 @@
"tasks": [ "tasks": [
{ {
"type": "cppbuild", "type": "cppbuild",
"label": "Debug", "label": "Build simulation",
"command": "g++", "command": "g++",
"args": [ "args": [
"-g", "-g",
"${workspaceFolder}\\src\\main.cpp", "${workspaceFolder}/src/main.cpp",
"-o", "-o",
"${workspaceFolder}\\main.exe", "${workspaceFolder}/main.exe",
"-I", "-I",
"${workspaceFolder}\\include" "${workspaceFolder}/include"
], ],
"options": { "options": {
"cwd": "${fileDirname}" "cwd": "${fileDirname}"

View File

@ -1,25 +1,30 @@
# LanderCpp # LanderCpp
## System Requirements ## System Requirements
*Note: these are only necessary if you plan on messing around with the source code. If you just want to see the end result, you should be able to go into the build/release directory and run the executable with no problems*
_Note: these are only necessary if you plan on messing around with the source code. If you just want to see the end result, you should be able to go into the build/release directory and run the executable with no problems_
- Visual Studio Code / C++ Extension - Visual Studio Code / C++ Extension
- mingw64 Compiler - mingw64 Compiler
- gdb debugger
For help with setting up your environment on Windows, reference this site: https://code.visualstudio.com/docs/languages/cpp The best way to install is by following this guide for [Windows](https://code.visualstudio.com/docs/cpp/config-mingw) or for [Linux](https://code.visualstudio.com/docs/cpp/config-linux)
The json files are already configured, so if you need any assistance with installing things in the right places, I would reference tasks.json under the .vscode folder
## Overview ## Overview
- Make sure to build from main.cpp
- main.cpp contains all of user defined initial conditions - main.cpp contains all of user defined initial conditions
- sim.h contains all of the simulation calculations - sim.h contains all of the simulation calculations
- As of right now, the executable just spits out a csv file... - As of right now, the executable just spits out a csv file...
- Currently using simPlot.m to plot all of the data in the csv file. So I suggest having Matlab open while you're messing aound with this. - Currently using simPlot.m to plot all of the data in the csv file. So I suggest having Matlab open while you're messing aound with this.
## Known Issues ## Known Issues
- See issue tracker - See issue tracker
## Results ## Results
These results are from the latest simulation automatically built with the code from the Master branch. To get code from the most recent commits go to [Pipelines](https://gitlab.com/lander-team/lander-cpp/-/pipelines) where you can download the artifacts from each commit.
Download the raw CSV: https://lander-team.gitlab.io/lander-cpp/simOut.csv Download the raw CSV: https://lander-team.gitlab.io/lander-cpp/simOut.csv
Download Linux Binaries: https://lander-team.gitlab.io/lander-cpp/sim.out Download Linux Binaries: https://lander-team.gitlab.io/lander-cpp/sim.out