franneck94 / Vscode-C-Cpp-Runner

🚀 Compile, run and debug single or multiple C/C++ files with ease. 🚀
MIT License
53 stars 14 forks source link

I can't evaluate any valuable in the debug console. #56

Closed obdopqo closed 2 years ago

obdopqo commented 2 years ago

Issue Type: Bug

I tried to debug a C++ program and had set a breakpoint. After it paused at the breakpoint, I type "s"(which is a "char s[100]" type) in the debug console and saw this:

Stopping due to fatal error: ArgumentException: An item with the same key has already been added. Key: (Microsoft.MIDebugEngine.AD7StackFrame, s)

example program:

#include <cstdio>
int main(){
    char s[100]="12345";
    printf("%s\n",s);
    return 0; // breakpoint was at this line
}

Complie and debug it, type "s" and press Enter in the debug console.

Expected behaviour:
Output the value of s(v [100])

In fact, the output is:

v[100]
Stopping due to fatal error: ArgumentException: An item with the same key has already been added. Key: (Microsoft.MIDebugEngine.AD7StackFrame, s)

and it really stopped.

Extension version: 3.1.1 VS Code version: Code 1.64.0 (5554b12acf27056905806867f251c859323ff7e9, 2022-02-03T04:22:20.678Z) OS version: Windows_NT x64 10.0.19044 Restricted Mode: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz (4 x 1796)| |GPU Status|2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|3.88GB (0.39GB free)| |Process Argv|--crash-reporter-id bd903514-af47-4b2c-a7cf-a7f419814ce4| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 pythonvspyl392cf:30425750 pythontb:30283811 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 pythondataviewer:30285071 vscod805cf:30301675 pythonvspyt200:30340761 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 vsc1dsc:30433058 pythonvs932:30410667 wslgetstarted:30433507 vscop453:30404998 vsrem710:30416614 ```
franneck94 commented 2 years ago

Hi, this extension just uses Mircosoft's official C/C++ extension for debugging. So if there is any bug you should raise an issue there. However, maybe I can help you. Are you using GCC, Clang, or MSVC Compiler? Can you send a screenshot of your described use case?

obdopqo commented 2 years ago

Thanks for your reply.After I post this issue, I searched on GitHub and found the same issue I meet, which is at https://github.com/microsoft/vscode-cpptools/issues/8760 .The bug was fixed and the issue was closed today.Message ID: @.***>