bug 1100335 - Use OutputDebugString on Windows in js_DumpBacktrace. r=jorendorff
authorTed Mielczarek <ted@mielczarek.org>
Wed, 17 Dec 2014 13:24:57 -0500
changeset 238455 dffb39f032221e508071a12b06a455292cf47145
parent 238454 734517b508b5ffc5233df13d9a6d47a83fedeaac
child 238456 51f6b5ca2e47396f0b58372e48c9f1f8613c0ef8
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-esr52@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1100335
milestone38.0a1
bug 1100335 - Use OutputDebugString on Windows in js_DumpBacktrace. r=jorendorff
js/src/jsobj.cpp
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -3926,16 +3926,21 @@ js_DumpBacktrace(JSContext *cx)
         const char *filename = JS_GetScriptFilename(i.script());
         unsigned line = PCToLineNumber(i.script(), i.pc());
         JSScript *script = i.script();
         sprinter.printf("#%d %14p   %s:%d (%p @ %d)\n",
                         depth, (i.isJit() ? 0 : i.interpFrame()), filename, line,
                         script, script->pcToOffset(i.pc()));
     }
     fprintf(stdout, "%s", sprinter.string());
+#ifdef XP_WIN32
+    if (IsDebuggerPresent()) {
+        OutputDebugStringA(sprinter.string());
+    }
+#endif
 }
 
 void
 JSObject::addSizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf, JS::ClassInfo *info)
 {
     if (is<NativeObject>() && as<NativeObject>().hasDynamicSlots())
         info->objectsMallocHeapSlots += mallocSizeOf(as<NativeObject>().slots_);