JSBool xpc_DumpJSStack(JSContext* cx, JSBool showArgs, JSBool showLocals, JSBool showThisProps) { char* buf; buf = FormatJSStackDump(cx, nsnull, showArgs, showLocals, showThisProps); if(buf) { fputs(buf, stdout); JS_smprintf_free(buf); } else puts("Failed to format JavaScript stack for dump"); return JS_TRUE; }
char* xpc_PrintJSStack(JSContext* cx, JSBool showArgs, JSBool showLocals, JSBool showThisProps) { char* buf; JSExceptionState *state = JS_SaveExceptionState(cx); if(!state) puts("Call to a debug function modifying state!"); JS_ClearPendingException(cx); buf = FormatJSStackDump(cx, nsnull, showArgs, showLocals, showThisProps); if(!buf) puts("Failed to format JavaScript stack for dump"); JS_RestoreExceptionState(cx, state); return buf; }
JSBool xpc_DumpJSStack(JSContext* cx, JSBool showArgs, JSBool showLocals, JSBool showThisProps) { char* buf; JSExceptionState *state = JS_SaveExceptionState(cx); if(!state) puts("Call to a debug function modifying state!"); JS_ClearPendingException(cx); buf = FormatJSStackDump(cx, nsnull, showArgs, showLocals, showThisProps); if(buf) { fputs(buf, stdout); JS_smprintf_free(buf); } else puts("Failed to format JavaScript stack for dump"); JS_RestoreExceptionState(cx, state); return JS_TRUE; }