Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure vs代码的Sphere SDK中不可见且锁定的断点_Azure_Iot_Azure Iot Hub_Azure Sphere - Fatal编程技术网

Azure vs代码的Sphere SDK中不可见且锁定的断点

Azure vs代码的Sphere SDK中不可见且锁定的断点,azure,iot,azure-iot-hub,azure-sphere,Azure,Iot,Azure Iot Hub,Azure Sphere,我正在尝试开始微软的azure sphere开发 当我尝试调试vs内的任何代码时,它告诉我在应用程序的第一行设置了一个断点。 但是,vs代码在“断点”选项卡中不显示任何断点 我正在windows 10上运行最新的VS代码版本1.44,Azure Sphere扩展名为20.1。同样的问题也出现在Linux上 要复制错误,请执行以下操作: 从github下载 安装VisualStudio代码的Azure sphere扩展。 在visual studio代码中打开azure sphere sample

我正在尝试开始微软的azure sphere开发

当我尝试调试vs内的任何代码时,它告诉我在应用程序的第一行设置了一个断点。 但是,vs代码在“断点”选项卡中不显示任何断点

我正在windows 10上运行最新的VS代码版本1.44,Azure Sphere扩展名为20.1。同样的问题也出现在Linux上

要复制错误,请执行以下操作:

从github下载 安装VisualStudio代码的Azure sphere扩展。 在visual studio代码中打开azure sphere samples\samples\HelloWorld\HelloWorld\u HighLevelApp中的HelloWorld\u HighLevelApp文件夹。 转到Debug选项卡并点击左上角的绿色播放按钮。按钮旁边应该写着LaunchforAzure Sphere高级应用程序gdb 对我来说,这不是一个错误,但输出控制台显示:

Deploying image...
Starting debugger....

Process /mnt/apps/1689d8b2-c835-2e27-27ad-e894d6d15fa9/bin/app created; pid = 2233
Listening on port 2345

Remote debugging from host 192.168.35.1, port 54911

Starting CMake Hello World application...
...
Breakpoint 1, main () at ../../main.c:45
45  {
Loaded 'target:/usr/lib/libapplibs.so.0'. Symbols loaded.
Loaded 'target:/lib/libgcc_s.so.1'. Symbols loaded.
Loaded 'target:/usr/lib/libc++runtime.so.1'. Symbols loaded.
调试控制台显示:

Deploying image...
Starting debugger....

Process /mnt/apps/1689d8b2-c835-2e27-27ad-e894d6d15fa9/bin/app created; pid = 2233
Listening on port 2345

Remote debugging from host 192.168.35.1, port 54911

Starting CMake Hello World application...
...
Breakpoint 1, main () at ../../main.c:45
45  {
Loaded 'target:/usr/lib/libapplibs.so.0'. Symbols loaded.
Loaded 'target:/lib/libgcc_s.so.1'. Symbols loaded.
Loaded 'target:/usr/lib/libc++runtime.so.1'. Symbols loaded.
是否有解决问题的方法/计划

补充1: 为了提供额外的说明,这里有一个屏幕截图,显示控制台输出断点集和ui无断点集的未匹配
Azure Sphere使用gdbserver向设备提供调试通道。gdb的默认行为是在进入main时中断。这可能会让Windows上的人感到困惑,因为他们希望运行到断点的行为在Visual Studio中很常见。对于我们与GDB的接口,为了保持一致,我们特意在VisualStudio中输入main时跳过断点。实际上,您可以在“调试日志输出”窗口中看到跳过的断点

对于VS代码,当您在Windows上时,我们也跳过main上的断点。从上面的输出来看,您似乎在Linux上。我已经有好几个星期没有在Linux上使用它了,所以我想不起来它的行为是否有意在Linux上有所不同。对于我来说,在Linux上进入main时中断是有意义的,因为这是使用GDB时的常见期望,GDB在Linux上比在Windows上更常见。我会检查这是否是故意的,然后回复,但我怀疑是。

解决方案:

最后我找到了问题的根源。VisualStudio代码在调试sphere设备时的行为与普通c代码略有不同

当您启动调试模式并且最初没有设置断点时,在您设置断点之前,它不会开始运行您的程序。在纯c调试中,程序只需运行,打印的值显示在调试控制台中