Skip to content

Getting a JS callstack in the debugger

Chris Glein edited this page Feb 4, 2023 · 6 revisions

Get WinDbg Preview from the store https://www.microsoft.com/store/productId/9PGJGD53TN86

Use WinDbg to launch your app with the debugger attached from the start. Use "File"->"Launch app package". You can use the search box in the top right to find your app (e.g. to debug React Native Gallery search for "gallery" and select from the list). When you find it, press "Launch".

Enable break on first chance C++ exceptions

sxe eh

Resume execution

g

Load the JS debugger extension that matches your build (important if you're on a prerelease windows build). Get your branch/version information with this command:

vertarget

And plug it in to load the extension like so:

!load \\winbuilds\release\ni_moment_mybranchname\23144.1000.230201-1554\amd64fre\bin\jscript\jd.dll

You'll need symbols to go with it. Enable verbose mode for symbols and quickly look at your symbol path

!sym noisy
.sympath 

It's likely lacking any reference for private symbols. Add the private symbol server

.sympath+ SRV*https://symweb

Your symbol path should by updated now. Reload the chakra symbols

.reload -f chakra

Good now?

lm vm chakra

Turn off all that symbol noise

!sym quiet

Now you should be able to get a callstack with resolved symbols

k

And get the JavaScript stack

!jstack

(Needs validation) Some potentially helpful links for more information: