Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disassembly View: wrong current instruction and wrong address in breakpoint command sent to GDB #13002

Open
LaXiS96 opened this issue Nov 26, 2024 · 0 comments
Labels
debugger help wanted Can be fixed in the public (open source) repo.

Comments

@LaXiS96
Copy link

LaXiS96 commented Nov 26, 2024

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 0x1b6 breakpoint was created via the disassembly view, by clicking on the 0x1b6 row which I wanted to break on
  • T1: after restarting the target, the disassembly view shows the breakpoint bound to 0x00000142 instead
    • notice the logs showing it indeed sent a GDB command to bind to 0x142 (322 decimal)
  • T1: pc register shows that GDB indeed halted on 0x142, but the disassembly shows the current instruction to be 0x000001a8
  • 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 pc register
    • this happens quite often and seems to be consistent based on the instructions being debugged

Screenshot T1
Image

Screenshot T2
Image

I am developing for CH32V003 RISC-V 32bit MCU, using:

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

@sean-mcmanus sean-mcmanus added debugger help wanted Can be fixed in the public (open source) repo. labels Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debugger help wanted Can be fixed in the public (open source) repo.
Projects
None yet
Development

No branches or pull requests

2 participants