microsoft / microsoft/vscode-cpptools

Unjustified "Trace/breakpoint trap" with GDB server

Aperta
#1,298 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

debugger embedded
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con la configurazione launch.json e il file pause_trace.txt allegati all’issue, quindi riproduci il comportamento usando il J-Link GDB server e la configurazione di debug MIEngine indicata. Confronta il comportamento di avvio, pausa e breakpoint per determinare perché viene segnalato un Trace/breakpoint trap; il lavoro è completato quando queste azioni non producono più un trap ingiustificato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp, vscode
Ambito
devtools, embedded-iot
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.