microsoft / microsoft/vscode-cpptools

pretty-print not working under remote attach debug mode

Open
#11,851 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Environment
  • OS and version: Windows 11 23H2
  • VS Code: 1.85.1
  • C/C++ extension: 1.18.5
  • OS and version of remote machine (if applicable): CentOS Linux release 7.9.2009 (Core)
  • GDB / LLDB version: GDB 8.3-3.el7
Bug Summary and Steps to Reproduce

Bug Summary:
When I debug remote running process via attach request type, the pretty-printing option seemingly not working.
For example, the std::string variables didn't show the literal value but show npos value.

image

Steps to reproduce:

  1. Start gdbserver in remote machine
  2. Configure GDB attach config, and set break point
  3. Start debugging and see the variables' value
  4. The value cannot show properly

Edit:
The above issue not appeared when debugging the local programs.

Debugger Configurations
{
    "name": "(gdb) Attach GDB-Server",
    "type": "cppdbg",
    "request": "attach",
    "program": "${workspaceFolder}/nginx/objs/nginx",
    "MIMode": "gdb",
    "miDebuggerPath": "/opt/rh/devtoolset-9/root/usr/bin/gdb",
    "miDebuggerServerAddress": "<remote-address>:<gdbserver-port>",
    "useExtendedRemote": true,
    "setupCommands": [
        {
            "description": "Enable pretty-printing for gdb",
            "text": "-enable-pretty-printing",
            "ignoreFailures": true
        },
        {
            "description": "Set Disassembly Flavor to Intel",
            "text": "-gdb-set disassembly-flavor intel",
            "ignoreFailures": true
        }
    ]
}
Debugger Logs
1: (245) ->(gdb)
1: (248) 1001: elapsed time 6
1: (263) <-1002-enable-pretty-printing
1: (263) ->1002^done
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

Start by reproducing the issue with the provided gdbserver remote attach configuration, including the attach request, useExtendedRemote, and -enable-pretty-printing setup command. Compare remote and local debugging behavior for std::string values; done means remote-attached variables display their literal values instead of npos.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.