Skip to content

Debugger does not start on C++, C#, Python, Go, PHP code #4221

Closed

Description

@globalww

OS/Web Information

  • Web Browser: Chrome
  • Local OS: Windows 10
  • Remote OS: Ubuntu 21.04
  • Remote Architecture: arm64 on raspberry pi 4B
  • code-server --version: 3.12.0

Steps to Reproduce

  1. Write a CPP code and press debug

Expected

Debugger should start

Actual

Opens launch.json and nothing happens.
Deleting launch.json temporarily solves the problem but after recreating launch.json, same problem happens again.

Screenshot

2

Notes

After updating 3.12.0 this problem started to happen. It worked fine before.
I tried deleting all JSON configuration files and creating it again, reinstalling C/C++ plugin, and selecting other debug options, but nothing worked for me.

I'm not familiar with VSCode so maybe it is my configuration problem, and sorry if it is.

Activity

  1. jsjoeio commented on Sep 22, 2021

    @jsjoeio
    Contributor

    Hmm...I'm wondering if this is a duplicate of any of these:

    I am not familiar with C++. If you can update the repro steps with step-by-step instructions (assume no C++ experience), then I can try locally and look into this.

  2. senyai commented on Sep 22, 2021

    @senyai

    Similar issue here. I have a c++ configuration in launch.json and debugging worked before. It looks like vscode tries to debug file that is currently edited (makes no sense). When launch.json is opened and I try to start c++ debugging by selecting my configuration, I see this message:
    image

  3. jsjoeio commented on Sep 22, 2021

    @jsjoeio
    Contributor

    Hmm...well if you can post repro steps, I can take a look! @senyai

  4. senyai commented on Sep 23, 2021

    @senyai

    Let's try

    1. install gcc and cmake;
    2. Install code-server like this:
    wget https://code-server.dev/install.sh && \
        sh install.sh --version 3.12.0 --method=standalone && \
        rm install.sh &&
    wget https://github.com/microsoft/vscode-cpptools/releases/download/1.6.0/cpptools-linux.vsix && \
        /home/devel/.local/bin/code-server --install-extension cpptools-linux.vsix && \
        /home/devel/.local/bin/code-server --install-extension twxs.cmake && \
        /home/devel/.local/bin/code-server --install-extension ms-vscode.cmake-tools && \
        /home/devel/.local/bin/code-server --install-extension ms-python.python && \
        /home/devel/.local/bin/code-server --install-extension mhutchie.git-graph && \
        /home/devel/.local/bin/code-server --install-extension christian-kohler.path-intellisense
    
    1. Create directory with 2 files:
      CMakeLists.txt:
    cmake_minimum_required(VERSION 3.10)
    project(code_server_issues_4221)
    set(CMAKE_CXX_STANDARD 17)
    add_executable(code_server_issues_4221 code_server_issues_4221.cpp)
    

    and code_server_issues_4221.cpp:

    #include <iostream>
    
    int main(int argc, char** argv) {
        if (argc == 2) {
            std::cout << "jsjoeio happy\n";
        } else {
            std::cout << "senyai sad\n";
        }
        return 0;
    }
    
    1. Press F1 -> "CMake: Configure"
    2. Press F5, launch.json will be created
    3. Press F5, debugging will not start
  5. senyai commented on Sep 23, 2021

    @senyai

    Very similar issue microsoft/vscode#133178

  6. PabloZaiden commented on Sep 23, 2021

    @PabloZaiden

    It's not related to C++. I'm having the exact same issue with C#.

    And, indeed, this is the commit that fixed it in codespaces: microsoft/vscode@63504d9

    It doesn't seem that has been applied here yet.

  7. cleardusk commented on Sep 23, 2021

    @cleardusk

    The same problem as @globalww @PabloZaiden, when debugging python.
    Will it be fixed in the next release?

  8. jsjoeio commented on Sep 23, 2021

    @jsjoeio
    Contributor

    @senyai thank you for the repro steps!

    Video

    Here is a video of me going through those steps: https://youtu.be/-9y8GLocrqw (still uploading & processing atm)

    When launch.json is opened and I try to start c++ debugging by selecting my configuration, I see this message:

    Same thing happened to me.

  9. added
    bugSomething isn't working
    high-priorityThis issue needs to be resolved ASAP
    and removed
    waiting-for-infoWaiting for more information from submitter
    on Sep 23, 2021
  10. jsjoeio commented on Sep 23, 2021

    @jsjoeio
    Contributor

    And, indeed, this is the commit that fixed it in codespaces: microsoft/vscode@63504d9

    Thanks for linking to the commit! If fixing this means adding that commit to our fork of VS Code then we should be able to make that happen in our current sprint. Adding it to the version milestone.

  11. jsjoeio commented on Sep 23, 2021

    @jsjoeio
    Contributor

    cc @TeffenEllis just giving you a heads-up on this!

  12. 8 remaining items

  13. changed the title [-]Debugger does not start on C++, C#, Python code[/-] [+]Debugger does not start on C++, C#, Python, Go code[/+] on Oct 8, 2021
  14. thxrben commented on Oct 10, 2021

    @thxrben

    For me, the debugging works on the first time i reload the window.
    After that, i cant start the debugger. It then asks me to select an environment and then like discussed here just opens the launch.json file.
    It even executes my Build-Task from tasks.json correctly, and then debugs it properly with breakpoints etc.
    The project is written in C.

    Just saw that frank8922 wrote that too. Exactly the same behaviour for me.

  15. bonarealm commented on Dec 1, 2021

    @bonarealm

    can not debug php also.

  16. changed the title [-]Debugger does not start on C++, C#, Python, Go code[/-] [+]Debugger does not start on C++, C#, Python, Go, PHP code[/+] on Dec 1, 2021
  17. marius-lupu commented on Dec 12, 2021

    @marius-lupu

    Doesn't work also for me for a Python or a Go app. The solution is to use 3.11.0

  18. lishunan246 commented on Mar 7, 2022

    @lishunan246

    Any updates?

    Was it fixed in v4.1.0?

  19. jsjoeio commented on Mar 7, 2022

    @jsjoeio
    Contributor

    @lishunan246 I haven't checked but you're welcome to and then let us know!

  20. lishunan246 commented on Mar 13, 2022

    @lishunan246

    @lishunan246 I haven't checked but you're welcome to and then let us know!

    I confirm that the debugger works in v4.1.0.

  21. bonarealm commented on Mar 13, 2022

    @bonarealm

    Yes,it works.thanks for your attention and hard works.

  22. jsjoeio commented on Mar 14, 2022

    @jsjoeio
    Contributor

    Thank you @lishunan246 and @bonarealm ♥️

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghigh-priorityThis issue needs to be resolved ASAP

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions