microsoft / microsoft/vscode-cpptools

Unjustified "Trace/breakpoint trap" with GDB server

Offen
#1,298 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

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

Beschreibung

First of all thank you for all this work, it's great.
I'm using vscode+cpptools+IAR extension to deveolp embedded device software.
Everything is working fine (with the already known limitation), but there's an issue that I'm not able to identify.
The issue is present always, and could be reproduced in the following ways:

-Each time I launch the server, and no breakpoint are set before the main (that is not the real entry point), I get a Trace/breakpoint trap and the program stop at it. stopAtEntry settings makes no difference.

-Each time I press pause the program correctly stop at the point where it's running, however it generates again Trace/breakpoint trap, even if it knows that it was me requiring the program to pause.

-Each time I set a breakpoint while the program is running, and the breakpoint is far enough from PC, I get a Trace/breakpoint trap in the exact same way as I I had pressed pause.

Since this behaviour is the same on Visual Studio 2017 my first guess is that it has to do to some IPC being out of sync and looked at the common denominator: the MIEngine. I tried then to debug the MIEngine as described in cpptools documentation folder, but cpptools failed to start with the my newly produced binary (sign required?).

The debugger and GDB server I'm using is JLink, and vscode and vscode-cpptools are updated.

This is the launch.json configuration file, I think that it would be easy to reproduce by just using a different binary and a jlink.

{
  "version": "0.2.1",
  "configurations": [
    {
      "name": "Debug J-Link",
      "type": "cppdbg",
      "request": "launch",
      "program": "${workspaceRoot}/project/build/debug/project.out",
      "stopAtEntry": true,
      "cwd": "${workspaceRoot}",
      "externalConsole": false,
      "MIMode": "gdb",
      "miDebuggerPath": "arm-none-eabi-gdb.exe",
      "debugServerPath": "JLinkGDBServerCL.exe",
      "debugServerArgs": "-if swd -singlerun -strict -endian little -speed auto -port 3333 -device STM32F303VE -vd -halt",
      "serverStarted": "Connected\\ to\\ target",
      "targetArchitecture": "arm",
      "serverLaunchTimeout": 5000,
      "filterStderr": false,
      "filterStdout": true,
      "logging": {
        "trace": false,
        "traceResponse": false,
        "engineLogging": true
      },
      "setupCommands": [
        {"text": "target remote localhost:3333"},
        {"text": "monitor flash breakpoints = 1"},
        {"text": "monitor flash download = 1"},
        {"text": "monitor reset"},
        {"text": "load project.out"},
        {"text": "monitor reset"}
      ]
    }
  ]
}

Below the screen of the error, and a trace log when I press pause:

pause_trace.txt

pause

main

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

Beginnen Sie mit der an das Issue angehängten launch.json-Konfiguration und pause_trace.txt und reproduzieren Sie anschließend das Verhalten mit dem J-Link GDB server und der aufgeführten MIEngine-Debugging-Konfiguration. Vergleichen Sie das Verhalten bei Start, Pause und Breakpoints, um festzustellen, warum ein Trace/breakpoint trap gemeldet wird; erledigt ist die Aufgabe, wenn diese Aktionen keinen ungerechtfertigten Trap mehr erzeugen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp, vscode
Bereich
devtools, embedded-iot
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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