microsoft / microsoft/vscode-cpptools

[cppvsdbg] The condition for a breakpoint failed to execute if expression is a string

Open
#5,676 8 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug debugger
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Type: Debugger

Setup a valid conditional breakpoint and got an exception or debugger stops every time in the breakpoint set. The expected result is to stop just once. Condition is valid, evaluated in debug console.

#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main()
{
    vector<string> msg {"Hello", "C++", "World", "from", "VS Code", "and the C++ extension!"};
    string text ;
    for (const string& word : msg)
    {
        cout << word << " ";
        text = word; //breakpoint here expression: text=="from"
        if (word=="from")
        {
            cout << " -> ";
        }
    }
    cout << endl;
}

Version: 1.46.1 (system setup)
Electron: 7.3.1
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18363

  • C/C++ Extension Version: 0.28.3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with cppvsdbg using the provided C++ sample and the conditional breakpoint expression text=="from". Inspect the conditional breakpoint evaluation path for string expressions, then verify that a valid condition stops only once rather than raising an exception or stopping on every hit.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, typescript
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.