Defrag Tools #184 - JavaScript in WinDbg Preview

Sign in to queue

The Discussion

  • User profile image
    dbgeek

    Hello!
     
    I want to report an WinDbg-issue concerning the execution
    of a javascript-function as a breakpoint-command.
    This observation was made in WinDbg 10.0.16267.1000 X86
    and also in the current WinDbg Preview
    with a native C++ program.
     
    ++++ Test Setup ++++
    In my javascript-file I have the following function:
     
    function test()
    {
       var ctl = host.namespace.Debugger.Utility.Control;
        host.diagnostics.debugLog(">>> Test\n");
       ctl.ExecuteCommand("g");
    }
     
    Then I define  a breakpoint-command to call this javascript-function:
     
    bs 0 "dx @$scriptContents.test()"
     
    ++++ Test Result ++++
    The output ">>> Test" is only shown the first time
    when breakpoint 0 is hit.
    Subsequently hitting breakpoint 0 does not
    produce any output.

    --> WinDbg:
    After several hits, windbg breaks at breakpoint 0.
    When I stop the debug process (Shift-F5)
    WinDbg crashes in ChakraCore.

    --> WinDbg Preview: stack overflow

    ++++ Remarks ++++
    1) Doing the analogous test with "old style" windbg-commands works:

    bs 0 ".printf \">>> Test\\n\";g;"


    2) Calling javascript-functions as in the test-scenario above worked in previous versions of WinDbg.

    ++++ Questions ++++
    1) Can you reproduce this issue on your site ?
    2) Is it legal to use javascript-functions in this way ?
    Your feedback is greatly appreciated! (I posted this issue to
    windbgfb@microsoft.com but did not get a feedback.)

    Kind/Best regards,
     
    Hannes

  • User profile image
    ChadBeeder

    @dbgeek: To make sure the debugger team gets this and can track it appropriately, it's probably best to submit this report via the Feedback Hub from WinDbg Preview.

Add Your 2 Cents