简体   繁体   English

即使在VS代码中在launch.json中指定了args之后,argc = 1

[英]argc=1 even after specifying args in launch.json in VS code

I'm trying to debug a C program in VS code, the executable of which requires multiple arguments for debugging. 我正在尝试用VS代码调试C程序,其可执行文件需要多个参数进行调试。 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). 在调试过程中,即使在launch.json的args下指定了参数(每个参数用引号引起来)之后,在变量部分下我仍然看到argc = 1(如下面的屏幕截图所示)。 And this is resulting in exit of the program coz of a check for argc value. 这导致退出程序coz来检查argc值。 Did not see this issue in stack overflow so far and hence this post. 到目前为止,还没有在堆栈溢出中看到此问题,因此没有这篇文章。 Would appreciate any help to solve it. 希望能有帮助解决它。

屏幕截图

Raised this issue in VS code' github forum and they confirmed that it's not an issue with VS code but with the C/C++ extension. 在VS代码的github论坛上提出了这个问题,他们确认这不是VS代码的问题,而是C / C ++扩展的问题。 So, raised it in the extension's forum too, haven't heard from them yet. 因此,在扩展程序的论坛中也提出了它,还没有收到他们的来信。

Meanwhile, I updated the extension to the latest one by chance and now argc value is 4 as expected. 同时,我偶然将扩展名更新为最新的扩展名,现在argc值为预期的4。 I see some update to the IntelliSense functionality related to args in the version released 2 days back and guess they fixed the bug in this version. 我在两天前发布的版本中看到了与args相关的IntelliSense功能的一些更新,并且猜测它们已修复了该版本中的错误。 Hope this post helps someone working with old version and facing similar issues. 希望这篇文章对使用旧版本并遇到类似问题的人有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM