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

Unable to debug using executionWrapper #452

Open
5 tasks done
twhittock-disguise opened this issue Nov 19, 2024 · 1 comment
Open
5 tasks done

Unable to debug using executionWrapper #452

twhittock-disguise opened this issue Nov 19, 2024 · 1 comment

Comments

@twhittock-disguise
Copy link

twhittock-disguise commented Nov 19, 2024

Checklist

  • The issue is about this extension and NOT about a fork.
  • Checked the ALL the SUPPORT document.
  • The latest version of the extension was used.
  • It is not related to remote-vscode or I checked the following issue
  • Imagine yourself into my position and think how hard to debug the issue without insufficient information.
    I understand that you have privacy concerns and I expect you to understand that this extension is developed for free.
    Thanks.

Describe the bug

First, thank you for an excellent extension! I have an unusual test system which involves compiling only some of my tests as dll files on windows. In order to run the tests, I need to use an execution wrapper, which works fantastically to run the tests.

However, when attempting to debug a test with the wrapper, there is no way to cause the debugger to launch the wrapper, rather than the dll which is found by scanning

To Reproduce

  1. Set up configuration as below
  2. Attempt to debug normal test - success
  3. Attempt to debug wrapped test - attempts to debug the dll instead of execution wrapper.
    "testMate.cpp.test.advancedExecutables": [
        {
            "name": "${filename}",
            "pattern": "${workspaceFolder}/build/my_test.exe",
            "cwd": "${absDirpath}",
        },
        {
            "name": "${filename}",
            "pattern": "${workspaceFolder}/build/*_test.dll",
            "executableSuffixToInclude": [ ".exe", ".dll" ],
            "executionWrapper": {
                "path": "${workspaceFolder}/build/wrapper_test.exe",
                "args": [ "${cmd}", "${argsFlat}" ]
            },
            "cwd": "${absDirpath}"
        }
    ],
    "testMate.cpp.debug.breakOnFailure": true,
    "testMate.cpp.debug.configTemplate": {
        "type": "cppvsdbg",
        "program": "${exec}",
        "args": "${argsArray}",
        "cwd": "${cwd}",
        "env": "${envObj}",
        "environment": "${envObjArray}",
        "sourceFileMap": "${sourceFileMapObj}"
    },

Screenshots (optional)

Desktop

  • Extension Version: unknown, updated via vscode - up to date as of 2024/11/19
  • VS Code Version: 1.95.3
  • Catch2 / Google Test / DOCTest Version: Catch 3.7.0
  • OS Type and Version: Windows 11
  • Using remote-ssh/docker/wsl?: No

Regression bug?

No

Log

testmate.log

@twhittock-disguise
Copy link
Author

twhittock-disguise commented Nov 19, 2024

OK it turns out you can create a local debug.configTemplate in each test which allows you to enter the program again. I think this is less important than before, but it would be a "nice to have" to have the execution wrapper command be easy to select as the debug command, somehow.

So the example config dealing with the dll test is changed to:

        {
            "name": "${filename}",
            "pattern": "${workspaceFolder}/build/*_test.dll",
            "executableSuffixToInclude": [ ".exe", ".dll" ],
            "executionWrapper": {
                "path": "${workspaceFolder}/build/wrapper_test.exe",
                "args": [ "${cmd}", "${argsFlat}" ]
            },
            "cwd": "${absDirpath}",
            "debug.configTemplate": {
                "type": "cppvsdbg",
                "program": "${workspaceFolder}/build/wrapper_test.exe",
                "args": "${exec} ${argsStr}", // does the same as `"args": [ "${cmd}", "${argsFlat}" ]` in executionWrapper
                "cwd": "${cwd}",
                "env": "${envObj}",
                "environment": "${envObjArray}",
                "sourceFileMap": "${sourceFileMapObj}"
            }
        }

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

1 participant