Skip to content

Tips for debugging on Windows? #17253

Description

@eugeneo

Is there any guide on debugging core Node.js core on Windows? I open node.vcxproj in VS 2017, do a build. Then when I add a single printf statement to a file, it takes Visual Studio forever to rebuild. I also have tried vcbuild.bat from the command prompt, it is just as slow.

It's also impossible to debug with VS as it did not find some header.

On other platforms (even on a less powerful workstation) rebuild is near instant. This issue is making it impossible to fix those failing tests on Windows...

Activity

  1. added
    buildIssues and PRs related to Node.js builds or CI infrastructure.
    questionIssues asking questions about Node.js.
    windowsIssues and PRs related to the Windows platform.
    on Nov 22, 2017
  2. bnoordhuis commented on Nov 22, 2017

    @bnoordhuis
    Member

    Paging @nodejs/platform-windows.

  3. refack commented on Nov 22, 2017

    @refack
    Contributor

    Try building a "Debug" target, linking is much faster (it's the linking that takes several minutes in 100% CPU). But It's possible that a debug build will not reproduce.

    Another option is to try reducing the level of link time optimizations:
    image

    As for GUI debugging, that usually works for me.

  4. refack commented on Nov 22, 2017

    @refack
    Contributor

    another idea: build using ninja (python configure --dest-cpu=x64 --ninja) and only use VS for debugging (right click project => debug => "start new instance" should not try to build)
    image

    Also maybe checkout https://x64dbg.com/

  5. eugeneo commented on Nov 22, 2017

    @eugeneo
    ContributorAuthor

    Yep, does not repro in Debug build (I'm looking into #15558). So far I traced it into V8 (paused event is triggered multiple times).

    Ninja definitely looks like a more comfortable build solution but it is still horribly slow.

  6. refack commented on Nov 22, 2017

    @refack
    Contributor

    Yeah I had the same experience while trying to dig into #15558... At least now we have a positive-control to check how link optimizations affect the binary.

    BTW: did you check that all accesses to libuv are thread safe?

  7. eugeneo commented on Nov 22, 2017

    @eugeneo
    ContributorAuthor

    @refack

    I dumped my findings so far on that PR. I will keep investigating.

  8. bzoz commented on Feb 21, 2018

    @bzoz
    Contributor

    The rebuild time should be fixed by #17393

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to Node.js builds or CI infrastructure.questionIssues asking questions about Node.js.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions