microsoft / microsoft/vscode-cpptools
pretty-print not working under remote attach debug mode
Nobody has claimed this yet.
- 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.
Steps to reproduce:
- Start
gdbserverin remote machine - Configure GDB attach config, and set break point
- Start debugging and see the variables' value
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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