Bug 960108 - JS::DescribeStack should show the whole stack for the runtime, across all contexts and the event loop, not just the current stack on the passed-in JSContext. r=bz
☠☠ backed out by b96ae9f43a89 ☠ ☠
authorAndrea Marchesini <amarchesini@mozilla.com>
Thu, 16 Jan 2014 08:26:49 -0500
changeset 163698 b971b8137039052358ac0aeb5b23d6f588b8bb55
parent 163697 796c5b4ce4708b53991205c5bb91e913f8cca4bc
child 163699 8d3e02a7f23ce58733e4ee20fa64d9c9637835b8
push id38544
push userryanvm@gmail.com
push dateThu, 16 Jan 2014 13:27:44 +0000
treeherdermozilla-inbound@8d3e02a7f23c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs960108
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 960108 - JS::DescribeStack should show the whole stack for the runtime, across all contexts and the event loop, not just the current stack on the passed-in JSContext. r=bz
js/src/vm/OldDebugAPI.cpp
--- a/js/src/vm/OldDebugAPI.cpp
+++ b/js/src/vm/OldDebugAPI.cpp
@@ -929,17 +929,20 @@ js_CallContextDebugHandler(JSContext *cx
     }
 }
 
 JS_PUBLIC_API(JS::StackDescription *)
 JS::DescribeStack(JSContext *cx, unsigned maxFrames)
 {
     Vector<FrameDescription> frames(cx);
 
-    for (NonBuiltinScriptFrameIter i(cx); !i.done(); ++i) {
+    for (NonBuiltinScriptFrameIter i(cx, ScriptFrameIter::ALL_CONTEXTS,
+                                     ScriptFrameIter::GO_THROUGH_SAVED,
+                                     cx->compartment()->principals);
+         !i.done(); ++i) {
         FrameDescription desc(i.script(), i.maybeCallee(), i.pc());
         if (!frames.append(desc))
             return nullptr;
         if (frames.length() == maxFrames)
             break;
     }
 
     JS::StackDescription *desc = js_new<JS::StackDescription>();