Skip to content

Command line arguments are not forwarded to the program when debugging #1242

@m-kro

Description

@m-kro

Describe the bug
I want to debug a program which accepts arguments. When I use the Managed Build (Legacy Makefile?), the arguments from the debug configuration cannot be accessed while debugging. Instead it looks like the program didn't get any further arguments supplied.

To Reproduce
Steps to reproduce the behavior:

  1. Create new C++ project in Eclipse: Managed Build, Executable, choose Hello World Project
  2. Edit the main function in the cpp source to have the signature int main(int argc, const char* argv[]) to be able to access program arguments
  3. Create a debug configuration (Run > Debug Configurations > C/C++ Application), set "a b c" in program arguments field, confirm with Apply
  4. Add a breakpoint in the first line of the main function (or activate the option to stop there by default)
  5. Inspect argc parameter in Debug. It reads 1 instead of 4 (3 program arguments) and the program arguments from the debug configuration are not accessible

Expected behavior
The arguments from the debug configuration should be accessible in the main function.

Version Information (please complete the following information):

  • Linux, Eclipse 2025-06, CDT 12.1.0

Additional context
GDB traces

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions