Vscode-cpptools: argc=1 even after specifying args in launch.json in VS code

Created on 24 Jun 2018  路  5Comments  路  Source: microsoft/vscode-cpptools

Type: Debugger

  • OS and Version: Ubuntu 16.04
  • VS Code Version: 1.18.1
  • C/C++ Extension Version: C/C++ 0.16.1 (Microsoft)
  • I'm trying to debug a C program in VS code, the executable of which requires multiple arguments for debugging. While debugging is in progress, I see that argc = 1 under the variables section even after specifying the arguments (each argument in separate quotes) under args in launch.json (as in screenshot below). And this is resulting in exit of the program coz of a check for argc value

Steps to reproduce the behavior:

  1. Specify the path to program and arguments in launch.json
  2. Insert a breakpoint in the code before the argc check condition
  3. Start debugging
  4. Go step by step from the breakpoint
  5. Will see that argc = 1 under variables section and the program will exit after the argc check

args_error

debugger more info needed

All 5 comments

@KrishnanParameswaran I wrote a sample program and am not getting the same value:
image

Please provide a repro project.

So I happened to update the extension to the latest version (0.17.5 released on 21st June 2018) and now argc gives the right value. There is a mention of Intellisense update (on args provider) in changelog. Would like to know if that is related to argc issue as well

The IntelliSense args provider is different from the debugger one. 0.16.1 is 3 months old so some debugger change since then could have fixed it.

@KrishnanParameswaran i'm glad its working. I think we did a better job handling args but it might not be called out in the change log.

Was this page helpful?
0 / 5 - 0 ratings