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

Source mapping not working if a folder inside the project root is given #13242

Open
vinodappu opened this issue Feb 6, 2025 · 1 comment
Open
Labels
bug debugger help wanted Can be fixed in the public (open source) repo.

Comments

@vinodappu
Copy link

Environment

  • OS and version: Windows 111
  • VS Code: 1.96.4
  • C/C++ extension:1.23.4
  • GDB / LLDB version:13.2

Bug Summary and Steps to Reproduce

Bug Summary:
SourceMapping is not working if I tried to map a folder inside the project root directory.

Ie: : is working but /src:/src is not working.

Steps to reproduce:

  1. I've used a C/C++ project built using eclipse. I build it inside a folder and moved the entire folder to another location.
  2. Created a launch configuration for qemu using the relocated project and it's elf
  3. Mapped source till /src folder and debug
  4. I got The editor could not be opened because the file was not found in the editor. I was expecting the editor opens the mapped source file.

engine_debug_log.txt

Debugger Configurations

{
    "configurations": [
        {
           "logging": { "engineLogging": true, "trace": true, "traceResponse": true },
            "name": "test-qemu",
            "type": "cppdbg",
            "request": "launch",
            "program": "c:\\Users\\Ashling\\AppData\\Local\\Ashling\\qemu32_baremetal\\Debug\\qemu32_baremetal.elf",
            "args": [],
            "stopAtConnect": true,
            "stopAtEntry": true,
            "cwd": "c:\\Users\\Ashling\\AppData\\Local\\Ashling\\qemu32_baremetal",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "riscv32-unknown-elf-gdb.exe",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "Set RISC-V architecture",
                    "text": "set arch riscv:rv32",
                    "ignoreFailures": true
                },
                {
                    "description": "Set remote timeout",
                    "text": "set remotetimeout 250",
                    "ignoreFailures": true
                },
                {
                    "description": "Disable thread event printing",
                    "text": "set print thread-events off",
                    "ignoreFailures": true
                }
            ],
            "postRemoteConnectCommands": [
                {
                    "description": "Remove the default `break -f main` inserted by cppdbg (github issue: vscode-cpptools#8011)",
                    "text": "delete 1",
                    "ignoreFailures": true
                },
                {
                    "description": "Load command",
                    "text": "load",
                    "ignoreFailures": true
                }
            ],
            "miDebuggerServerAddress": "localhost:1234",
            "serverLaunchTimeout": 5000,
            "debugServerArgs": "--gdb tcp::1234 --machine virt --nographic -S --bios none -d cpu_reset",
            "debugServerPath": "qemu-system-riscv32.exe",
            "filterStderr": true,
            "hardwareBreakpoints": {
                "require": false,
                "limit": 4
            },
            "symbolLoadInfo": {
                "loadAll": true,
                "exceptionList": ""
            },
            "sourceFileMap": {
                "C:\\workspace_ms\\qemu32_baremetal\\qemu32_baremetal\\src": "c:\\Users\\Ashling\\AppData\\Local\\Ashling\\qemu32_baremetal\\src"
            }
        }
    ]
}

Debugger Logs

Attached in the issue.

Other Extensions

No response

Additional Information

If I map without /src folder, it's working.

Copy link

Thank you for reporting this issue. We’ll let you know if we need more information to investigate it. Additionally, if you're working with GDB/LLDB, please note that the code is open source at https://github.com/microsoft/MIEngine/wiki/Contributing-Code . Your contributions are always welcome and appreciated.

@github-actions github-actions bot added the help wanted Can be fixed in the public (open source) repo. label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug debugger help wanted Can be fixed in the public (open source) repo.
Projects
None yet
Development

No branches or pull requests

2 participants