Defrag Tools #184 - JavaScript in WinDbg Preview

Sign in to queue

Description

In this episode of Defrag Tools, we continue our series on the new WinDbg Preview. Andrew Richards is joined by Bill Messmer to talk about the updated scripting engine.

Related Links:

WinDbg Preview (download from Microsoft Store)
Documentation for WinDbg Preview (Dev Center)
Announcement blog post

Related Episodes:

Defrag Tools #138 - Debugging - 'dx' Command Part 1
Defrag Tools #139 - Debugging - 'dx' Command Part 2
Defrag Tools #169 - Debugging Tools For Windows Team
Defrag Tools #170 - Debugger - JavaScript Scripting
Defrag Tools #182 - WinDbg Preview Part 1
Defrag Tools #183 - WinDbg Preview Part 2

 

Embed

Download

Download this episode

Download captions

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