microsoft / microsoft/vscode-cpptools

Stepping over std::vector<std::string> v{""} with g++-12 incorrect jumps to the end of the function

Offen
#11,987 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug debugger help wanted
Vorherrschende Sprache
TypeScript
Sterne
6.2k
Forks
1.7k
Ø Merge
14 Std. 46 Min.
Gemergte PRs (30 T.)
61

Beschreibung

Environment
  • OS and version: Ubuntu22
  • VS Code: latest
  • C/C++ extension: latest
  • GDB / LLDB version: gdb 12.1 (also repros with 13).
Bug Summary and Steps to Reproduce
  1. Use C++ code
#include <vector>
#include <string>
int main()
{
    std::vector<std::string> v{""};
    return 0;
}
  1. Put a breakpoint on the std::vector line and use F5.
  2. Choose to compile with the g++-12 compiler -- it doesn't repro if you switch to g++-11.
  3. Step over the std::vector function.

Bug: The stepping jumps to the bottom of the function instead of going to the next line. This occurs if additional lines of code are added as well. Stepping an extra time goes to the next line (return 0).

image
Debugger Configurations
{
  "tasks": [
    {
      "type": "cppbuild",
      "label": "C/C++: g++-12 build active file",
      "command": "/usr/bin/g++-12",
      "args": [
        "-fdiagnostics-color=always",
        "-g",
        "${file}",
        "-o",
        "${fileDirname}/${fileBasenameNoExtension}"
      ],
      "options": {
        "cwd": "${fileDirname}"
      },
      "problemMatcher": [
        "$gcc"
      ],
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "detail": "Task generated by Debugger."
    }
  ],
  "version": "2.0.0"
}

launch.json is the default generated with F5.
Debugger Logs
...
Other Extensions

No response

Additional Information

I didn't find this bug -- it was found by an "internal team".

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Es ist keine Repository-Datei oder kein Test angegeben. Reproduziere das Verhalten mit dem bereitgestellten C++-Programm, g++-12, GDB 12.1 oder 13 sowie der gezeigten Build-Aufgabe und der standardmäßigen launch.json; vergleiche es mit g++-11. Als erledigt gilt es, wenn das schrittweise Ausführen über die Vektorinitialisierung hinweg korrekt die nächste Quelltextzeile erreicht.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp, vscode
Bereich
devtools
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.