Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger rewrites date-times being passed through the args array #238514

Closed
jeremy-rifkin opened this issue Jan 23, 2025 · 2 comments
Closed

Debugger rewrites date-times being passed through the args array #238514

jeremy-rifkin opened this issue Jan 23, 2025 · 2 comments
Assignees

Comments

@jeremy-rifkin
Copy link
Contributor

jeremy-rifkin commented Jan 23, 2025

Does this issue occur when all extensions are disabled?: I need to use the C++ extension but it appears this bug does not occur within the C++ extension.

  • VS Code Version: 1.96.4
  • OS Version: Macos, linux, windows, multiple versions

Steps to Reproduce:

  1. Open a folder in vscode
  2. Add a simple entry to launch.json passing a timestamp like 2025-01-16T14:30:00.0Z, e.g.
        {
            "name": "bug repro",
            "type": "cppdbg",
            "request": "launch",
            "program": "/bin/echo",
            "args": ["2025-01-16T14:30:00.0Z"],
            "cwd": "${workspaceFolder}",
            "MIMode": "gdb",
            "miDebuggerPath": "/usr/bin/gdb",
        },
  1. Observe the program be passed 01/16/2025 14:30:00

Somehow vscode is silently rewriting my argument.

I briefly stepped through a local build of vscode ealier and this does not appear to be done in the C++ extension.

I was debugging a program earlier which requires a specific timestamp format and this vscode bug made it impossible for me to debug my program in the IDE.

@roblourens
Copy link
Member

it appears this bug does not occur within the C++ extension.

Are you sure? I don't see this with node, only c++, and I'd expect they are parsing the args strangely. microsoft/vscode-cpptools#13241

@jeremy-rifkin
Copy link
Contributor Author

jeremy-rifkin commented Feb 22, 2025

I am not sure. I spent some time debugging a local version of vscode and it appeared to originate in vscode not the extension. I can report to vscode-cpptools. nvm I see that has already been done.

gregg-miskelly pushed a commit to microsoft/MIEngine that referenced this issue Feb 24, 2025
When parsing launch options from JSON, the JSON parser's default behavior is – for whatever reason – to parse slightly datetime-ish looking strings as date objects. This PR explicitly forbids this behavior when parsing launch options.

Partially fixes #1491, microsoft/vscode-cpptools#13241 and microsoft/vscode#238514.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants