0

Handling High-Frequency Breakpoints in JavaScript

I want to create a breakpoint that invokes a JavaScript function. WinDbg/dx echoes the call to that function every time the breakpoint is hit. This kills performance and readability of output.

Here's my breakpoint command.

> bp ucrtbase!malloc "dx @$scriptContents.OnMallocEntry(); gc"

When it runs, I see endless copies of

@$scriptContents.OnMallocEntry()
@$scriptContents.OnMallocEntry()
@$scriptContents.OnMallocEntry()
@$scriptContents.OnMallocEntry()
@$scriptContents.OnMallocEntry()
@$scriptContents.OnMallocEntry()

Is there some way to avoid this echoing?

  • Can I invoke the function some other way besides dx?
  • Can I suppress the echo?
  • try inserting -r 0 like dx -r 0 @$blah,foo() – blabb Aug 2 '19 at 4:35
  • @blabb (10.0.17134.12 X86) Nope. Out of curiosity, why might that have accomplished this? Do I need to upgrade my target platform version? – mojo Aug 2 '19 at 12:39
  • when returning some thing from a js function it used to print the Length which i suppressed by setting the Recursion Depth so thought you should give it a try 0:000> dx -r 5 @$scripts.foo.Contents.dothing() @$scripts.foo.Contents.dothing() : hello dx Length : 0x9 0:000> dx -r 0 @$scripts.foo.Contents.dothing() @$scripts.foo.Contents.dothing() : hello dx – blabb Aug 2 '19 at 17:40
0

There will be a WinDbg Preview release in February or March with a new '-s' switch to 'dx', so you'll be able to run 'dx -s foo' to get the behavior you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.