Skip to content

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

@windows0041

Description

@windows0041

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    debuggerhelp wantedCan be fixed in the public (open source) repo.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions