From 7a1240b2f10f3ff695a933a40ce7950e5e6a9e04 Mon Sep 17 00:00:00 2001 From: Nathan Glenn Date: Thu, 24 Aug 2023 18:28:16 -0500 Subject: [PATCH] VSCode files * Suggested project extensions for developing in C/C++, Python and Soar * Configuration for C/C++ IntelliSense * Debug and run launch configurations --- .gitignore | 2 -- .vscode/c_cpp_properties.json | 21 ++++++++++++ .vscode/extensions.json | 8 +++++ .vscode/launch.json | 61 +++++++++++++++++++++++++++++++++++ 4 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 .vscode/c_cpp_properties.json create mode 100644 .vscode/extensions.json create mode 100644 .vscode/launch.json diff --git a/.gitignore b/.gitignore index 9b07309489..2f855b0561 100644 --- a/.gitignore +++ b/.gitignore @@ -518,5 +518,3 @@ build_*.* testCommandToFile-output.soar soarversion build_time_date - -.vscode/ diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000000..2ae9167b2d --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,21 @@ +{ + "configurations": [ + { + "name": "Mac", + "macFrameworkPath": [ + "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks" + ], + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "cStandard": "c17", + "cppStandard": "c++17", + "intelliSenseMode": "macos-clang-arm64", + // build the project once to generate this file + "compileCommands": "${workspaceFolder}/compile_commands.json", + "compilerPath": "/usr/bin/clang" + } + ], + "version": 4 +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000000..e9036e5f7d --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "ms-vscode.cpptools", + "ms-python.python", + "editorconfig.editorconfig", + "bdegrend.soar" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000000..53ba2399e7 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,61 @@ +{ + // 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": "Debug UnitTests", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/out/UnitTests", + // "args": ["-e", "PRIMS_Sanity1", "-e", "PRIMS_Sanity2", "-f", "testSmemArithmetic", "-l", "-c", "FullTestsClientThread"], + "args": ["-e", "PRIMS_Sanity1","-c", "MiscTests"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}/out", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "osx": { + "MIMode": "lldb", + "targetArchitecture": "ARM64" + } + }, + { + "name": "Debug Soar CLI", + "type": "cppdbg", + "request": "attach", + "program": "${workspaceRoot}/out/soar", + "MIMode": "gdb", + "osx": { + "MIMode": "lldb", + "targetArchitecture": "ARM64" + } + }, + { + "name": "Debug soar.dll loaded by Java", + "type": "cppdbg", + "request": "attach", + "program": "${env:JAVA_HOME}/bin/java", + "MIMode": "gdb", + "osx": { + // Keep in mind that VSCode might freeze for you! You may need to use lldb directly instead. + // https://github.com/microsoft/vscode-cpptools/issues/7240 + // You may also need to codesign your java executable with permissions to debug: + // https://stackoverflow.com/questions/66575538/xcode-lldb-cant-attach-to-macos-system-program-bin-cp-not-allowed-to-attach + "MIMode": "lldb", + "targetArchitecture": "ARM64" + }, + }, + { + "name": "Debug project build", + "type": "python", + "request": "launch", + "program": "scons/scons.py", + "args": ["--scu", "--dbg", "all", "performance_tests"], + "console": "integratedTerminal", + "justMyCode": false + }, + // TODO: Python debugger for scons build + ] +}