diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js
index 97d0fa3a013323cee5624eadf55911722285334c..480ce36a2ec3f22562dac99dcedc51e855309579 100644
--- a/pd/nw/pdgui.js
+++ b/pd/nw/pdgui.js
@@ -731,8 +731,12 @@ function pd_error_select_by_id(objectid) {
 
 exports.pd_error_select_by_id = pd_error_select_by_id;
 
-function gui_post_error(objectid, loglevel, error_msg) {
+function gui_post_error(objectid, loglevel, error_msg, trace_array) {
+    var i;
     do_post(objectid, "error", error_msg, "error", loglevel);
+    for (i = 0; i < trace_array.length; i++) {
+        post(trace_array[i][1] + ": " + trace_array[i][2]);
+    }
 }
 
 // This is used specifically by [print] so that we can receive the full
diff --git a/pd/src/s_print.c b/pd/src/s_print.c
index 19d1760cb0b40e67c5bc9525af06cb763153e532..dde95fd649ed6ad1aab391c5f4f23f350e977c9b 100644
--- a/pd/src/s_print.c
+++ b/pd/src/s_print.c
@@ -3,6 +3,9 @@
 * WARRANTIES, see the file, "LICENSE.txt," in this distribution.  */
 
 #include "m_pd.h"
+// hm... we really don't want this...
+#include "m_imp.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdarg.h>
@@ -65,10 +68,22 @@ static void doerror(const void *object, const char *s)
         //sys_vgui("pdtk_posterror {%s} 1 {%s}\n",
         //    strnpointerid(obuf, object, MAXPDSTRING),
         //    strnescape(upbuf, s, MAXPDSTRING));
-        gui_vmess("gui_post_error", "sis",
+        gui_start_vmess("gui_post_error", "sis",
             strnpointerid(obuf, object, MAXPDSTRING),
             1,
             strnescape(upbuf, s, MAXPDSTRING));
+        int i;
+        gui_start_array();
+        for (i = pd_stackn - 1; i >= 0; i--)
+        {
+            gui_start_array();
+            gui_x((long unsigned int)pd_stack[i].self);
+            gui_s(class_getname(pd_class(pd_stack[i].self)));
+            gui_s(pd_stack[i].s->s_name);
+            gui_end_array();
+        }
+        gui_end_array();
+        gui_end_vmess();
     }
 }