microsoft / microsoft/vscode-cpptools

Args array not passed to the debugged processes command line

Open
#2,391 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugger more info needed
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Type: Debugger
Input information below

Describe the bug

  • OS and Version: Ubuntu 14.04.1 LTS

  • VS Code Version: 1.25.1

  • C/C++ Extension Version: 0.17.7

  • gdb Version: GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git

  • Other extensions you installed (and if the issue persists after disabling them): C++ Intellisense 0.2.2, CMake 0.0.17, CMake Tools 1.1.1, CMake Tools Helper 0.2.1, Git Easy 1.9.1, Git History 0.4.2, Git Merger 0.4.1, Git Tags 1.3.1, Git Tree Compare 1.3.0, gitignore 1.0.1, gitk 1.3.2

  • A clear and concise description of what the bug is.
    Using gdb debugger. The command line arguments given in launch.json in the "args" array is not passed to the debugged processes (the setting has no effect). See the below screenshot.

To Reproduce
Steps to reproduce the behavior:

  1. Using gdb debugger on Ubuntu Linux
  2. Add command line arguments to launch.json
  3. Start debugging and check the command line of the debugged processes (check argc from main())
  4. See the command line from launch.json is not passed to the debugged process

My launch.json file:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/build/provisioning-server",
            "args": ["../../DALI Development Signer.der"],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "Command-line arguments",
                    "text": "-exec set args \"../../DALI Development Signer.der\"",
                }
            ]
        }
    ]
}

screenshot_20180813_113312

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 with the launch.json configuration and the gdb launch path, then reproduce the issue using argc from main() on Ubuntu. Trace how the args array is handled when debugging with gdb; done means the configured argument reaches the debugged process command line.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.