microsoft / microsoft/vscode-cpptools

[LLDB] lldb-mi debugger not able to take input file as an exe argument

Open
#1,219 20 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi, I am trying to debug a program which takes a input file. It works in command line when I run it as ./a.out <testinput.txt and when I try to debug it I get the following output and debugger hangs as if it doesnot get any input.

Launching: '/Users/wge/Github/CSE340cpp/Pj3/a.out'
Working directory: '/Users/wge/Github/CSE340cpp/Pj3'
2 arguments:
argv[0] = '/Users/wge/Github/CSE340cpp/Pj3/a.out'
argv[1] = '<testa8t.txt'

I did try put < and testfile.txt in two arguments with no difference.
I set the external console to be true but it doesn't seem like there is a way for cpp debugger to accept a input like regular command line would?
I am using vscode 1.17 and lastest cpp extension with lldb on Mac OSX.

{
"version": "0.2.0",
"configurations": [
{
"name": "(lldb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/a.out",
"args": ["<testa8t.txt"],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true,
"osx": {
"MIMode": "lldb"
}
}
]
}

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 reported launch.json configuration on macOS with LLDB, focusing on the args and externalConsole settings. Confirm whether stdin redirection from the input file is delivered to the debugged program; done means the program accepts the file input while launched through the C/C++ debugger.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, vscode
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.