vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

MacOs:Unable to start debugging. Specified argument was out of the range of valid values.

Open elias-1 opened this issue 6 years ago • 5 comments

MacOs 10.13.2 vscode 1.18.1 When I use gbd as my debuger, it returns Unable to start debugging. Specified argument was out of the range of valid values.

Is there a good config example for mac using gdb. I think this problem caused by above version of MacOs 10.12, but I don't know how to solve it.

elias-1 avatar Dec 12 '17 15:12 elias-1

@elias-1 Can you share your launch.json config? You will need to specify the MIMode as gdb and then set the miDebuggerPath to your gdb location but otherwise it should be fine. I know on OS X you are required to sign your debugger executable so gdb needs to be code signed. you can find more information online about how to self sign the executable so it is trusted.

pieandcakes avatar Dec 12 '17 20:12 pieandcakes

@pieandcakes Okay, thx for your help. My launch.json is listed as follow: `{ // 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": "C++ Launch", "type": "cppdbg", "request": "launch", "program": "${workspaceRoot}/xgboost", "args": ["${workspaceRoot}/demo/binary_classification/mushroom.conf"], "cwd" : "${workspaceRoot}/demo/binary_classification", "externalConsole": false, "stopAtEntry": false, "customLaunchSetupCommands": [ { "text": "target-run", "description": "run target", "ignoreFailures": false } ], "MIMode": "gdb", "miDebuggerPath": "/usr/local/bin/gdb", "launchCompleteCommand": "exec-run" } ] }

`

elias-1 avatar Dec 13 '17 01:12 elias-1

@pieandcakes Another useful info is to run gdb in my shell, I have to add set startup-with-shell off to ~/.gdbinit

elias-1 avatar Dec 14 '17 06:12 elias-1

Please Remove below lines:

"customLaunchSetupCommands": [ { "text": "target-run", "description": "run target", "ignoreFailures": false } ],

PaoloZhang avatar Oct 13 '19 06:10 PaoloZhang

Please Remove below lines:

"customLaunchSetupCommands": [ { "text": "target-run", "description": "run target", "ignoreFailures": false } ],

What! This is listed as an example on Microsoft's documentation page and now you're telling us to remove it? Microsoft sucks at documentation. If it doesn't make any money for Microsoft, then it's not worth putting any effort into it. Microsoft should have gone out of business decades ago. Its mediocrity and incompetence is surreal!

Joebeazelman avatar Aug 10 '22 16:08 Joebeazelman

@Joebeazelman If you have a suggestion for how the documentation can be improved, you can file an issue or submit a PR on the docs page or https://github.com/microsoft/vscode-docs/issues , e.g. https://github.com/microsoft/vscode-docs/pull/4914 .

Our extension (and VS Code in general) doesn't make money so it's not a factor in the documentation quality and it's just a matter of whether we invest our time in improving the docs or fixing bugs, etc.

sean-mcmanus avatar Aug 12 '22 01:08 sean-mcmanus