microsoft / microsoft/vscode-cpptools
Disassembly View: wrong current instruction and wrong address in breakpoint command sent to GDB
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 6.2k
- Forks
- 1.7k
- Ø Merge
- 14 Std. 46 Min.
- Gemergte PRs (30 T.)
- 61
Beschreibung
Environment
- OS and version: Windows 11 22631.4460
- VS Code: 1.95.3
- C/C++ extension: v1.22.11
- OS and version of remote machine (if applicable): none
- GDB / LLDB version: GDB 15.2 from MSYS2
mingw-w64-ucrt-x86_64-gdb-multiarch
Bug Summary and Steps to Reproduce
Referencing the screenshots below:
- the
0x1b6breakpoint was created via the disassembly view, by clicking on the0x1b6row which I wanted to break on - T1: after restarting the target, the disassembly view shows the breakpoint bound to
0x00000142instead- notice the logs showing it indeed sent a GDB command to bind to
0x142(322 decimal)
- notice the logs showing it indeed sent a GDB command to bind to
- T1:
pcregister shows that GDB indeed halted on0x142, but the disassembly shows the current instruction to be0x000001a8 - T2: after stepping over once, the disassembly view changes to 64bit long addresses and does not show the disassembled instructions
- note how the current instruction address now matches the
pcregister - this happens quite often and seems to be consistent based on the instructions being debugged
- note how the current instruction address now matches the
Screenshot T1
Screenshot T2
I am developing for CH32V003 RISC-V 32bit MCU, using:
- custom built GCC 14.2 rv32ec-ilp32e (riscv32-unknown-elf) in MSYS2 UCRT64 from https://github.com/riscv-collab/riscv-gnu-toolchain
- gdb-multiarch from MSYS2 package
mingw-w64-ucrt-x86_64-gdb-multiarch 15.2-2 minichlink.exefrom https://github.com/cnlohr/ch32v003fun/tree/1ea96b14248628a209816963821b088dc8ecf506/minichlink as a GDB debug server
Debugger Configurations
launch.json:
{
"name": "Launch (minichlink)",
"type": "cppdbg",
"request": "launch",
"cwd": "${workspaceFolder}",
"program": "${workspaceRoot}/build/firmware.elf",
// "stopAtEntry": true,
"debugServerPath": "${workspaceFolder}/minichlink.exe",
"debugServerArgs": "-aG",
"MIMode": "gdb",
"miDebuggerPath": "E:/msys64/ucrt64/bin/gdb-multiarch.exe",
"miDebuggerServerAddress": "localhost:2000",
"setupCommands": [
{
"text": "-enable-pretty-printing",
"ignoreFailures": true,
},
],
"svdPath": "${workspaceFolder}/CH32V003xx.svd",
"logging": {
"engineLogging": true,
"trace": true,
"traceResponse": true
}
}
Debugger Logs
https://pastebin.com/gUCjBxwv
Other Extensions
Cortex-Debug and other related extensions are installed, but disabling all of them does not make a difference.
Additional Information
No response
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das Problem mit der bereitgestellten launch.json-Konfiguration zu reproduzieren, und untersuche die im Bericht verlinkten GDB-Engine-Logs. Vergleiche die Breakpoint-Adresse, das pc-Register, die aktuelle Instruktion und das Disassembly nach dem Stepping; als abgeschlossen gilt es, wenn die angeforderte Adresse an GDB gesendet wird und das Disassembly korrekt und mit Inhalt bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cpp, typescript
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 38/100