Is it possible dropping --debugger
and --debugger-pipe
when debugging cmake scripts?
#3891
-
I use CMake Tools extension to debug a cmake script file, When debugging,
In fact, my actual I read the document https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/debug.md , but not found solution. My {
// 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": [
{
"type": "cmake",
"request": "launch",
"name": "CMake: Configure",
"cmakeDebugType": "script",
"scriptPath": "${workspaceFolder}/test.cmake",
"scriptArgs": [
"-DHELLO=WORLD",
"-DCMAKE_BUILD_TYPE=Debug"
],
"clean": false,
"configureAll": false
}
]
} A sample message("Welcom to CMake script mode!")
message("Hello, ${HELLO}")
message(STATUS "CMAKE_ARGC: ${CMAKE_ARGC}")
foreach(_arg RANGE ${CMAKE_ARGC})
message(STATUS "${_arg}: ${CMAKE_ARGV${_arg}}")
endforeach()
function(add_numbers num1 num2 OUTPUT_VAR)
math(EXPR output "${num1} + ${num2}")
set(${OUTPUT_VAR} ${output} PARENT_SCOPE)
endfunction()
set(my_result 0)
add_numbers(5 3 my_result)
message("5 + 3 = ${my_result}")
message("bye~") |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Just found the source where extra args are pushed: https://github.com/microsoft/vscode-cmake-tools/blob/main/src/debug/debuggerScriptDriver.ts#L25-L30 @gcampbell-msft Is it possible that I remove extra args when debug CMake script? |
Beta Was this translation helpful? Give feedback.
-
@zchrissirhcz No, the way that the cmake debugger works is that you have to pass these arguments to be able to debug. Is there some other scenario that you're trying to complete that we don't support? |
Beta Was this translation helpful? Give feedback.
@zchrissirhcz No, the way that the cmake debugger works is that you have to pass these arguments to be able to debug. Is there some other scenario that you're trying to complete that we don't support?