Skip to content

Debug Button Doesn't Work #1412

Closed
Closed
@Tabrizian

Description

@Tabrizian

Brief Issue Summary

The debug button doesn't work in vscode-remote inside containers.

Expected:

Show a list of tragets to select for debug.

Apparent Behavior:

Show error message below:
Failed to prepare executable target with name 'undefined'

Platform and Versions

  • Operating System:
  • CMake Version: 3.18.1
  • VSCode Version: 1.48.0
  • CMake Tools Extension Version: 1.4.1
  • Compiler/Toolchain: gcc7.5

Activity

definelicht

definelicht commented on Jan 28, 2021

@definelicht

I'm also getting this when running via SSH to a remote machine:

target_name_undefined

Any insight would be appreciated!

andreeis

andreeis commented on Jan 28, 2021

@andreeis
Contributor

Thank you for opening this report. We will investigate why the quickPick with the launch targets is not automatically shown.
One possible reason is a failed configure. Do you confirm that your project configures successfully?

In the meantime, you can specifically select a launch target via the command "CMake: Set Debug Target" in the pallette. Then hopefully the debug operation will work for you. Please let us know if this workaround works.

definelicht

definelicht commented on Jan 29, 2021

@definelicht

Manually configuring the debug target fixed the issue for me - thank you.

The project configured and built as expected when I experienced this issue, so I don't think the cause was a failed configure.
Let me know what additional information I can provide.

andreeis

andreeis commented on Jan 29, 2021

@andreeis
Contributor

Let us know if it happens again after you reload and don't manually configure anything. Make sure you don't have CMake.configureOnOpen set to false.

paleomoon

paleomoon commented on Nov 19, 2021

@paleomoon

This happened when I made a mistake in CMakeList.txt: set(CMAKE_BUILD_TYPE DEBUG).
Change to set(CMAKE_BUILD_TYPE Debug) fixed the issue 😂.

maximilianmordig

maximilianmordig commented on Aug 22, 2022

@maximilianmordig

I made it work by making sure that it is Debug rather than DEBUG, (setting "cmake.loggingLevel": "debug" in .vscode/settings.json to get verbose logs), deleting <cmake_build_folder>/.cache, then reload vscode window, then run set debug target which asks me for the target, as expected.

Eveheeero

Eveheeero commented on Jan 28, 2023

@Eveheeero

on my case, this happened when CMakePresets.json has no cacheVariables::CMAKE_BUILD_TYPE

gcampbell-msft

gcampbell-msft commented on Jul 6, 2023

@gcampbell-msft
Collaborator

Closing this as it seems that the issue comes from when the CMAKE_BUILD_TYPE is incorrectly defined. Please let us know if it should be re-opened or revisited for any reason.

cyfex

cyfex commented on Aug 11, 2023

@cyfex

For me, CMake: Reset Cmake Tools Extension State (For troubleshooting) works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @cyfex@definelicht@Tabrizian@maximilianmordig@bobbrow

        Issue actions

          Debug Button Doesn't Work · Issue #1412 · microsoft/vscode-cmake-tools