Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Invoke at runtime the debugger *windows only* #3390

Closed
migounette opened this issue Jun 8, 2012 · 2 comments
Closed

Invoke at runtime the debugger *windows only* #3390

migounette opened this issue Jun 8, 2012 · 2 comments

Comments

@migounette
Copy link

Under Linux we can use the SIGUSR1 signal in order to order to start the debugger.

It's usefull when you have a child process and you want to debug it.

With windows a RegisterDebugSignalHandler is used, this a share memory with a pointer to function in it.

I don't see any example how to use, except if I run an external program in order to invoke this method ?

It would great if someone can describe how you to start the debugger via node under windows.

Thanks for your ligths

@piscisaureus
Copy link

node debug -p «pid»

@migounette
Copy link
Author

node debug -p «pid» : two problems with this approach:

  1. When you fork the debugger does not follow the child, the idea was to invoke the debbuger at runtime and wait it.
  2. The node debug -p <> is not compatible when you try to search a problem of fork

That's why I was searching an equivalent of SIGUSR1 for Windows

function waitms(msToWait)
{
var date = new Date();
var curDate = null;

do { 
    curDate = new Date();   
    debugger;
} 
while(curDate-date < msToWait);

}

process.kill(process.pid, 'SIGUSR1');

        // Now it's time to set a breakpoint
        process.nextTick(function () {
            waitms(options.debug.timeout);              
            ... continue my job....
        });                 

joaocgreis pushed a commit that referenced this issue Aug 24, 2015
Backports http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=aab3560b65b9254d17770bb6fe3ca7edd7451429
from openssl upstream, to add support for Visual Studio 2015. This is
already included in the newer openssl 1.0.2.

Original commit message:

  e_os.h: limit _MSC_VER trickery to older compilers.

  PR: #3390

Original pull request:

  http://rt.openssl.org/Ticket/Display.html?user=guest&pass=guest&id=3390

PR-URL: #25857
Reviewed-By: Alexis Campailla <alexis@janeasystems.com>
joaocgreis pushed a commit that referenced this issue Sep 16, 2015
Backports http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=aab3560b65b9254d17770bb6fe3ca7edd7451429
from openssl upstream, to add support for Visual Studio 2015. This is
already included in the newer openssl 1.0.2.

Original commit message:

  e_os.h: limit _MSC_VER trickery to older compilers.

  PR: #3390

Original pull request:

  http://rt.openssl.org/Ticket/Display.html?user=guest&pass=guest&id=3390

This was ported to v0.10 in #25857

PR-URL: nodejs/node#2843
Reviewed-By: rvagg - Rod Vagg <rod@vagg.org>
Reviewed-By: orangemocha - Alexis Campailla <orangemocha@nodejs.org>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
jBarz pushed a commit to ibmruntimes/node that referenced this issue Nov 4, 2016
Backports http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=aab3560b65b9254d17770bb6fe3ca7edd7451429
from openssl upstream, to add support for Visual Studio 2015. This is
already included in the newer openssl 1.0.2.

Original commit message:

  e_os.h: limit _MSC_VER trickery to older compilers.

  PR: nodejs#3390

Original pull request:

  http://rt.openssl.org/Ticket/Display.html?user=guest&pass=guest&id=3390

This was ported to v0.10 in nodejs#25857

PR-URL: nodejs/node#2843
Reviewed-By: rvagg - Rod Vagg <rod@vagg.org>
Reviewed-By: orangemocha - Alexis Campailla <orangemocha@nodejs.org>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants