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

Is there a way to retrieve the filename of cmake.launchTargetPath #632

Closed
PetePriority opened this issue Jan 11, 2019 · 5 comments
Closed
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: debug/launch help wanted we currently are not planning work on this and would like help from the open source community quick fix the fix is estimated to be quick
Milestone

Comments

@PetePriority
Copy link

Brief Issue Summary

My launch configuration uses remote gdb debugging using pipeTransport like so:

   {
        "version": "0.2.0",
        "configurations": [
            {
                "name": "(gdb) Pipe Launch",
                "type": "cppdbg",
                "request": "launch",
                "program": "${command:cmake.launchTargetPath}",
                "cwd": "${workspaceFolder}",
                "preLaunchTask": "Deploy",
                "pipeTransport": {
                    "pipeCwd": "${workspaceRoot}",
                    "debuggerPath": "/usr/bin/gdb",
                    "pipeProgram": "/usr/bin/ssh",
                    "pipeArgs": [
                        "root@target"
                    ],
                },
                "MIMode": "gdb",
                "setupCommands": [
                    {
                        "description": "Enable pretty-printing for gdb",
                        "text": "-enable-pretty-printing",
                        "ignoreFailures": true
                    },
                ],
            }
        ]
    }

This works fine, as long as the deployment task puts the executable returned by cmake.launchTargetPath on the target at the same location as on the local machine.
Is there a way to extract the filename part of cmake.launchTargetPath such that I can have custom deployment locations? C.f. microsoft/vscode-cpptools#2110 (comment)

Platform and Versions

  • Operating System: Debian 9.2
  • CMake Version: 3.7.2
  • VSCode Version: 1.30.1
  • CMake Tools Extension Version: 1.1.3
  • Compiler/Toolchain: Yocto/toradex toolchain for ARM
@jclay
Copy link

jclay commented Jan 11, 2019

It looks like you could fetch the launchTarget (https://github.com/vector-of-bool/vscode-cmake-tools/blob/6a0218b67119ce3f9101f041182392fafa4e12ab/src/api.ts#L275)

Could you instead have program call a script which accepts the target and then builds the path you need, and then calls the executable you're wanting to launch?

@PetePriority
Copy link
Author

Using an external script would be possible, but I would like to keep the configuration as simple as possible.

How would I access the launchTarget value from within the launch json? I've already tried "program": "${command:cmake.launchTarget}", but that didn't work.

@KoeMai
Copy link
Contributor

KoeMai commented Apr 30, 2019

The Implementation does not support it yet. I took a looked into the implementation, the information is very close to the extension API api.ExecutableTarget.

@minkir014
Copy link

You said the deployment made the matter works well. So what is the problem?

@bobbrow bobbrow added enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: debug/launch labels Jul 19, 2019
@andreeis andreeis added this to the On Deck milestone Apr 28, 2020
@andreeis andreeis added help wanted we currently are not planning work on this and would like help from the open source community quick fix the fix is estimated to be quick labels Apr 29, 2020
@bobbrow
Copy link
Member

bobbrow commented Sep 17, 2020

This is available in 1.4.2

@bobbrow bobbrow closed this as completed Sep 17, 2020
@bobbrow bobbrow modified the milestones: On Deck, 1.4.2 Sep 17, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: debug/launch help wanted we currently are not planning work on this and would like help from the open source community quick fix the fix is estimated to be quick
Projects
None yet
Development

No branches or pull requests

6 participants