microsoft / microsoft/vscode-cpptools

windows 使用vscode 远程debian11 gdb调试代码 遇到错误

Open
#13,792 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugger help wanted question
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and version: windows 11
  • VS Code: 1.102.3
  • C/C++ extension: C/C++ v1.26.3
  • OS and version of remote machine (if applicable): debian 11
  • GDB / LLDB version: GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git
Bug Summary and Steps to Reproduce

Bug Summary: 无法加载源“./csu/../csu/libc-start.c”: 'SourceRequest' not supported.。

#include <stdio.h>

int main() {
printf("Hello world!\n");
return 0;
}

在main函数上打的断点,调试在最后一个‘}’ 时报错。

我已经在csdn里找了,也翻遍了类似问题的帖子,ai也问了,折腾了很久,未求得解!希望可以在此处解惑!!!
Steps to reproduce:

  1. In this environment...
  2. With this config...
  3. Do '...'
  4. See error...
Debugger Configurations
{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
    {
        "name": "(gdb) 启动",
        "type": "cppdbg",
        "request": "launch",
        "program": "输入程序名称,例如 ${workspaceFolder}/a.out",
        "args": [],
        "stopAtEntry": false,
        "cwd": "${fileDirname}",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "setupCommands": [
            {
                "description": "为 gdb 启用整齐打印",
                "text": "-enable-pretty-printing",
                "ignoreFailures": true
            },
            {
                "description": "将反汇编风格设置为 Intel",
                "text": "-gdb-set disassembly-flavor intel",
                "ignoreFailures": true
            }
        ]
    }
    ]
}

{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: gcc 生成活动文件",
            "command": "/usr/bin/gcc",
            "args": [
                "-fdiagnostics-color=always",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "调试器生成的任务。"
        }
    ],
    "version": "2.0.0"
}
Debugger Logs
=thread-group-added,id="i1"
GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=cmd-param-changed,param="pagination",value="off"
Stopped due to shared library event (no libraries added or removed)
Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.

Breakpoint 1, main () at /home/maoyu/Code/Hello.c:4
4	    printf("Hello world!\n");
Loaded '/lib/x86_64-linux-gnu/libc.so.6'. Symbols loaded.
Execute debugger commands using "-exec <command>", for example "-exec info registers" will list registers in use (when GDB is the debugger)
[Inferior 1 (process 19670) exited normally]
The program '/home/maoyu/Code/Hello' has exited with code 0 (0x00000000).
Other Extensions

No response

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the supplied debugger configuration and GDB log, focusing on the SourceRequest error for ./csu/../csu/libc-start.c after main exits. Reproduce with the stated Windows 11, Debian 11, VS Code 1.102.3, and GDB 10.1 setup; done means identifying whether the extension or configuration causes the failure and documenting a verified fix or workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.